mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
988b8e01be
The only manual changes here are to BindingUtils.h, BindingUtils.cpp, Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp, dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp, Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp, Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The rest of this diff was generated by running the following commands: find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
234 lines
4.7 KiB
C++
234 lines
4.7 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "mozilla/dom/IccInfo.h"
|
|
|
|
#include "nsPIDOMWindow.h"
|
|
|
|
#define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \
|
|
{ \
|
|
uint32_t i = 0; \
|
|
for (const EnumEntry* entry = _enumType##Values::strings; \
|
|
entry->value; \
|
|
++entry, ++i) { \
|
|
if (_string.EqualsASCII(entry->value)) { \
|
|
_enum.SetValue(static_cast<_enumType>(i)); \
|
|
} \
|
|
} \
|
|
}
|
|
|
|
using namespace mozilla::dom;
|
|
|
|
// IccInfo
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(IccInfo, mWindow, mIccInfo)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(IccInfo)
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(IccInfo)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IccInfo)
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
NS_INTERFACE_MAP_END
|
|
|
|
IccInfo::IccInfo(nsPIDOMWindow* aWindow)
|
|
: mWindow(aWindow)
|
|
{
|
|
}
|
|
|
|
void
|
|
IccInfo::Update(nsIIccInfo* aInfo)
|
|
{
|
|
mIccInfo = aInfo;
|
|
}
|
|
|
|
JSObject*
|
|
IccInfo::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
{
|
|
return MozIccInfoBinding::Wrap(aCx, this, aGivenProto);
|
|
}
|
|
|
|
Nullable<IccType>
|
|
IccInfo::GetIccType() const
|
|
{
|
|
if (!mIccInfo) {
|
|
return Nullable<IccType>();
|
|
}
|
|
|
|
nsAutoString type;
|
|
Nullable<IccType> iccType;
|
|
|
|
mIccInfo->GetIccType(type);
|
|
CONVERT_STRING_TO_NULLABLE_ENUM(type, IccType, iccType);
|
|
|
|
return iccType;
|
|
}
|
|
|
|
void
|
|
IccInfo::GetIccid(nsAString& aIccId) const
|
|
{
|
|
if (!mIccInfo) {
|
|
aIccId.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mIccInfo->GetIccid(aIccId);
|
|
}
|
|
|
|
void
|
|
IccInfo::GetMcc(nsAString& aMcc) const
|
|
{
|
|
if (!mIccInfo) {
|
|
aMcc.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mIccInfo->GetMcc(aMcc);
|
|
}
|
|
|
|
void
|
|
IccInfo::GetMnc(nsAString& aMnc) const
|
|
{
|
|
if (!mIccInfo) {
|
|
aMnc.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mIccInfo->GetMnc(aMnc);
|
|
}
|
|
|
|
void
|
|
IccInfo::GetSpn(nsAString& aSpn) const
|
|
{
|
|
if (!mIccInfo) {
|
|
aSpn.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mIccInfo->GetSpn(aSpn);
|
|
}
|
|
|
|
bool
|
|
IccInfo::IsDisplayNetworkNameRequired() const
|
|
{
|
|
if (!mIccInfo) {
|
|
return false;
|
|
}
|
|
|
|
bool isDisplayNetworkNameRequired;
|
|
mIccInfo->GetIsDisplayNetworkNameRequired(&isDisplayNetworkNameRequired);
|
|
|
|
return isDisplayNetworkNameRequired;
|
|
}
|
|
|
|
bool
|
|
IccInfo::IsDisplaySpnRequired() const
|
|
{
|
|
if (!mIccInfo) {
|
|
return false;
|
|
}
|
|
|
|
bool isDisplaySpnRequired;
|
|
mIccInfo->GetIsDisplaySpnRequired(&isDisplaySpnRequired);
|
|
|
|
return isDisplaySpnRequired;
|
|
}
|
|
|
|
// GsmIccInfo
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_INHERITED(GsmIccInfo, IccInfo, mGsmIccInfo)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(GsmIccInfo)
|
|
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
|
|
|
|
NS_IMPL_ADDREF_INHERITED(GsmIccInfo, IccInfo)
|
|
NS_IMPL_RELEASE_INHERITED(GsmIccInfo, IccInfo)
|
|
|
|
GsmIccInfo::GsmIccInfo(nsPIDOMWindow* aWindow)
|
|
: IccInfo(aWindow)
|
|
{
|
|
}
|
|
|
|
void
|
|
GsmIccInfo::Update(nsIGsmIccInfo* aInfo)
|
|
{
|
|
nsCOMPtr<nsIIccInfo> iccInfo = do_QueryInterface(aInfo);
|
|
MOZ_ASSERT(iccInfo);
|
|
|
|
IccInfo::Update(iccInfo);
|
|
mGsmIccInfo = aInfo;
|
|
}
|
|
|
|
JSObject*
|
|
GsmIccInfo::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
{
|
|
return MozGsmIccInfoBinding::Wrap(aCx, this, aGivenProto);
|
|
}
|
|
|
|
void
|
|
GsmIccInfo::GetMsisdn(nsAString& aMsisdn) const
|
|
{
|
|
if (!mGsmIccInfo) {
|
|
aMsisdn.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mGsmIccInfo->GetMsisdn(aMsisdn);
|
|
}
|
|
|
|
// CdmaIccInfo
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_INHERITED(CdmaIccInfo, IccInfo, mCdmaIccInfo)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(CdmaIccInfo)
|
|
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
|
|
|
|
NS_IMPL_ADDREF_INHERITED(CdmaIccInfo, IccInfo)
|
|
NS_IMPL_RELEASE_INHERITED(CdmaIccInfo, IccInfo)
|
|
|
|
CdmaIccInfo::CdmaIccInfo(nsPIDOMWindow* aWindow)
|
|
: IccInfo(aWindow)
|
|
{
|
|
}
|
|
|
|
void
|
|
CdmaIccInfo::Update(nsICdmaIccInfo* aInfo)
|
|
{
|
|
nsCOMPtr<nsIIccInfo> iccInfo = do_QueryInterface(aInfo);
|
|
MOZ_ASSERT(iccInfo);
|
|
|
|
IccInfo::Update(iccInfo);
|
|
mCdmaIccInfo = aInfo;
|
|
}
|
|
|
|
JSObject*
|
|
CdmaIccInfo::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
{
|
|
return MozCdmaIccInfoBinding::Wrap(aCx, this, aGivenProto);
|
|
}
|
|
|
|
void
|
|
CdmaIccInfo::GetMdn(nsAString& aMdn) const
|
|
{
|
|
if (!mCdmaIccInfo) {
|
|
aMdn.SetIsVoid(true);
|
|
return;
|
|
}
|
|
|
|
mCdmaIccInfo->GetMdn(aMdn);
|
|
}
|
|
|
|
int32_t
|
|
CdmaIccInfo::PrlVersion() const
|
|
{
|
|
if (!mCdmaIccInfo) {
|
|
return 0;
|
|
}
|
|
|
|
int32_t prlVersion;
|
|
mCdmaIccInfo->GetPrlVersion(&prlVersion);
|
|
|
|
return prlVersion;
|
|
}
|