Files
palemoon27/dom/push/PushSubscriptionOptions.cpp
roytam1 8375688356 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1257418 - Remove USE_DEPENDENT_LIBS. r=gps (fbe746751a)
- Bug 1255817 part 3. Remove the now-unreachable JS_ReportPendingException call in nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject. r=bholley (dbffe901a9)
- Bug 1255817 part 4. Make XPCJSRuntime use MozCrashErrorReporter by default, now that there should be no stray JS_ReportPendingException calls. r=bholley (68d82e4b68)
- Bug 1245000 part 1 - Add a preference for enabling Element.animate; r=bz (d94ab6f1d9)
- Bug 1245000 part 2 - Don't ship Animation.ready; r=bz (129a052a16)
- Bug 1245000 part 3 - Turn on Element.animate in release channels too; r=bz (cc6743c31d)
- Bug 1245000 part 4 - Enable the Animation constructor when Element.animate is enabled; r=bz (8a65bdedcb)
- Bug 1247685 - WebIDL and DOM implementation changes for app server keys. r=mt,baku (69870bd979)
- Bug 1248565 - Introduce MOZ_LOG_* variables for mozilla logging. r=erahm (ea236d3b26)
- Bug 1258231 - Lock while iterating console messages. r=mccr8 (2b54be114d)
- bug 1252104 - make NS_ERROR_GET_CODE() and NS_ERROR_GET_MODULE() constexpr r=froydnj (f29ae0f6de)
- Bug 1221160 - fix AutoTraceLogLock deadlock on Windows; r=froydnj (11f1c2a071)
- Bug 1251895 - don't race on nsTraceRefcnt's object serial number tables; r=mccr8 (2d52aceffe)
2024-07-15 23:14:05 +08:00

49 lines
1.6 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/PushSubscriptionOptions.h"
#include "mozilla/dom/PushSubscriptionOptionsBinding.h"
namespace mozilla {
namespace dom {
PushSubscriptionOptions::PushSubscriptionOptions(nsIGlobalObject* aGlobal,
nsTArray<uint8_t>&& aAppServerKey)
: mGlobal(aGlobal)
, mAppServerKey(Move(aAppServerKey))
{
// There's only one global on a worker, so we don't need to pass a global
// object to the constructor.
MOZ_ASSERT_IF(NS_IsMainThread(), mGlobal);
}
PushSubscriptionOptions::~PushSubscriptionOptions() {}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PushSubscriptionOptions, mGlobal)
NS_IMPL_CYCLE_COLLECTING_ADDREF(PushSubscriptionOptions)
NS_IMPL_CYCLE_COLLECTING_RELEASE(PushSubscriptionOptions)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PushSubscriptionOptions)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
JSObject*
PushSubscriptionOptions::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
return PushSubscriptionOptionsBinding::Wrap(aCx, this, aGivenProto);
}
void
PushSubscriptionOptions::GetApplicationServerKey(JSContext* aCx,
JS::MutableHandle<JSObject*> aKey,
ErrorResult& aRv)
{
PushUtil::CopyArrayToArrayBuffer(aCx, mAppServerKey, aKey, aRv);
}
} // namespace dom
} // namespace mozilla