Files
palemoon27/dom/workers/ServiceWorkerContainer.h
T
roytam1 06d40aca85 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1236277 - Retry all connections not just the reused one. r=mcmanus (ed4f2e0b53)
- Bug 366023 - Allow h/1.0 chunked encodings r=bagder (46916cf57d)
- Bug 1234757 - test_protocolproxyservice does not need 2nd arg to asyncopen r=ckerschb (b5be356b2f)
- Bug 1234757 - Use channel.asyncOpen2 within netwerk/test/unit/test_protocolproxyservice.js (r=mcmanus) (ff5fed346c)
- Bug 1213953. Remove pref "layout.imagevisibility.enabled_for_browser_elements_only", it is unused and obsolete. r=seth (b3263ece72)
- Bug 1218506 - Uninitialised value use in nsHttpTransaction::OnTransportStatus. r=mcmanus. (860ebc7b21)
- Bug 1211168 - Fix resource timing domainLookupStart by setting the timestamp only once. r=mcmanus (d29ce1c707)
- Bug 1242172. Invalidate intrinsic ISizes that depend on viewport BSize when the viewport is resized. r=dbaron (9f01b86d3d)
- Bug 1154277: Part 1 - allow to swap docShells on remote browsers that are not a child of a BrowserDOMWindow. r=smaug (ec889b29de)
- Bug 1230918 - remove useless null-pointer check on aChild that only caused a Coverity - Dereference before null check. r=dbaron (73e4595582)
- Bug 1149260 - Guard against trying to draw a drag image with zero length. r=enndeakin (212553ba76)
- Bug 1209780. Check DrawResult return value in nsBaseDragService. r=seth (8ed14eae88)
- Bug 1242690 - Make sure that synthetic mouse events have a reasonable guid so that the callback transform can get unapplied properly. r=botond (b612388818)
- Bug 1251140 - Baldr: Implement CtzI. r=jandem (ef6c59485b)
- Bug 1250198: Workaround unaligned memory accesses by masking the low bits; r=sunfish (5e8857f269)
- Bug 1246116: Translate AsmJS loops into wasm opcodes and implement Wasm loops; r=luke (45297bf96e)
- Bug 1251995 part 5 - Unify units of dirty rect used for painting text frame. r=jfkthame (4952922181)
- Bug 1227148 - Add SameObject and NewObject annotations to some ServiceWorkerContainer members; r=bzbarsky (53720dde2f)
- Bug 1238206 - Make ServiceWorkerContainer.getRegistration() return Promise<any>; r=baku (94425218b2)
- Bug 1218139 - Remove ServiceWorkerContainer.onreloadpage; r=bzbarsky (3fe7677476)
- Bug 1251519 Part 1 - Remove nsTextFrameBase as an nsFrame alias. r=mats (956adccf62)
- Bug 1253094, part 6 - Stop using DebugOnly for class/struct members in netwerk/. r=mayhemer (b517f06795)
- reinstantiate accidentally removed w (32fa5b8337)
- Bug 1246775 - fix Canvas2D drawWindow to reacquire its DT after rendering. r=bas (24131c73f7)
- Bug 1256515 - bail out in CanvasRenderingContext2D::DrawWindow if snapshotting draw target fails. r=bas.schouten (75b4d52542)
- Bug 1255172. Fix unsafe reference gc hazards people snuck into DOM code. r=bkelly (6cb8348aa5)
- Bug 1235677 - Wait for helper threads before resetting OOM simulation r=terrence (680b607812)
- Bug 1256672 - Make OOM alloc counters 64 bit. r=terrence (1e4dbbe201)
- Bug 1238207 - make ServiceWorkerGlobalScope.skipWaiting() return Promise<void>; r=baku (6577777f97)
- Bug 1251875 - Part 1: Remove the dom.serviceWorkers.interception.enabled pref; r=bkelly (6bae86b488)
- Bug 1251875 - Part 2: Remove the dom.serviceWorkers.interception.opaque.enabled pref; r=bkelly (9b2946325a)
- Bug 1253094, part 7 - Stop using DebugOnly for class/struct members in storage/. r=mak (9422188881)
2024-02-08 12:08:19 +08:00

88 lines
2.2 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_serviceworkercontainer_h__
#define mozilla_dom_serviceworkercontainer_h__
#include "mozilla/DOMEventTargetHelper.h"
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class Promise;
struct RegistrationOptions;
namespace workers {
class ServiceWorker;
} // namespace workers
// Lightweight serviceWorker APIs collection.
class ServiceWorkerContainer final : public DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
IMPL_EVENT_HANDLER(controllerchange)
IMPL_EVENT_HANDLER(error)
IMPL_EVENT_HANDLER(message)
static bool IsEnabled(JSContext* aCx, JSObject* aGlobal);
explicit ServiceWorkerContainer(nsPIDOMWindow* aWindow);
virtual JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
already_AddRefed<Promise>
Register(const nsAString& aScriptURL,
const RegistrationOptions& aOptions,
ErrorResult& aRv);
already_AddRefed<workers::ServiceWorker>
GetController();
already_AddRefed<Promise>
GetRegistration(const nsAString& aDocumentURL,
ErrorResult& aRv);
already_AddRefed<Promise>
GetRegistrations(ErrorResult& aRv);
Promise*
GetReady(ErrorResult& aRv);
// Testing only.
void
GetScopeForUrl(const nsAString& aUrl, nsString& aScope, ErrorResult& aRv);
// DOMEventTargetHelper
void DisconnectFromOwner() override;
// Invalidates |mControllerWorker| and dispatches a "controllerchange"
// event.
void
ControllerChanged(ErrorResult& aRv);
private:
~ServiceWorkerContainer();
void RemoveReadyPromise();
// This only changes when a worker hijacks everything in its scope by calling
// claim.
RefPtr<workers::ServiceWorker> mControllerWorker;
RefPtr<Promise> mReadyPromise;
};
} // namespace dom
} // namespace mozilla
#endif /* mozilla_dom_workers_serviceworkercontainer_h__ */