Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / mobileconnection / MobileCellInfo.cpp
blob14ad3c7f2dbdb6c7271ce18115a5452260a5d7a1
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "MobileCellInfo.h"
8 #include "mozilla/dom/MozMobileCellInfoBinding.h"
10 using namespace mozilla::dom;
12 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MobileCellInfo, mWindow)
14 NS_IMPL_CYCLE_COLLECTING_ADDREF(MobileCellInfo)
15 NS_IMPL_CYCLE_COLLECTING_RELEASE(MobileCellInfo)
17 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MobileCellInfo)
18 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
19 NS_INTERFACE_MAP_ENTRY(nsISupports)
20 NS_INTERFACE_MAP_END
22 MobileCellInfo::MobileCellInfo(nsPIDOMWindow* aWindow)
23 : mWindow(aWindow)
24 , mGsmLocationAreaCode(-1)
25 , mGsmCellId(-1)
26 , mCdmaBaseStationId(-1)
27 , mCdmaBaseStationLatitude(-1)
28 , mCdmaBaseStationLongitude(-1)
29 , mCdmaSystemId(-1)
30 , mCdmaNetworkId(-1)
32 SetIsDOMBinding();
35 void
36 MobileCellInfo::Update(nsIMobileCellInfo* aInfo)
38 if (!aInfo) {
39 return;
42 aInfo->GetGsmLocationAreaCode(&mGsmLocationAreaCode);
43 aInfo->GetGsmCellId(&mGsmCellId);
44 aInfo->GetCdmaBaseStationId(&mCdmaBaseStationId);
45 aInfo->GetCdmaBaseStationLatitude(&mCdmaBaseStationLatitude);
46 aInfo->GetCdmaBaseStationLongitude(&mCdmaBaseStationLongitude);
47 aInfo->GetCdmaSystemId(&mCdmaSystemId);
48 aInfo->GetCdmaNetworkId(&mCdmaNetworkId);
51 JSObject*
52 MobileCellInfo::WrapObject(JSContext* aCx)
54 return MozMobileCellInfoBinding::Wrap(aCx, this);