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
)
22 MobileCellInfo::MobileCellInfo(nsPIDOMWindow
* aWindow
)
24 , mGsmLocationAreaCode(-1)
26 , mCdmaBaseStationId(-1)
27 , mCdmaBaseStationLatitude(-1)
28 , mCdmaBaseStationLongitude(-1)
36 MobileCellInfo::Update(nsIMobileCellInfo
* aInfo
)
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
);
52 MobileCellInfo::WrapObject(JSContext
* aCx
)
54 return MozMobileCellInfoBinding::Wrap(aCx
, this);