mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
cd31585bba
--HG-- extra : rebase_source : ac9bc321c679cbf7045c9d32d1001c5d87d68c69
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
/* 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 "ServiceWorker.h"
|
|
|
|
#include "nsPIDOMWindow.h"
|
|
#include "SharedWorker.h"
|
|
#include "WorkerPrivate.h"
|
|
|
|
#include "mozilla/dom/Promise.h"
|
|
|
|
using namespace mozilla::dom;
|
|
USING_WORKERS_NAMESPACE
|
|
|
|
ServiceWorker::ServiceWorker(nsPIDOMWindow* aWindow,
|
|
SharedWorker* aSharedWorker)
|
|
: DOMEventTargetHelper(aWindow),
|
|
mSharedWorker(aSharedWorker)
|
|
{
|
|
AssertIsOnMainThread();
|
|
MOZ_ASSERT(mSharedWorker);
|
|
}
|
|
|
|
ServiceWorker::~ServiceWorker()
|
|
{
|
|
AssertIsOnMainThread();
|
|
}
|
|
|
|
NS_IMPL_ADDREF_INHERITED(ServiceWorker, DOMEventTargetHelper)
|
|
NS_IMPL_RELEASE_INHERITED(ServiceWorker, DOMEventTargetHelper)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorker)
|
|
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorker, DOMEventTargetHelper,
|
|
mSharedWorker)
|
|
|
|
JSObject*
|
|
ServiceWorker::WrapObject(JSContext* aCx)
|
|
{
|
|
AssertIsOnMainThread();
|
|
|
|
return ServiceWorkerBinding::Wrap(aCx, this);
|
|
}
|