Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: Source/modules/serviceworkers/ServiceWorkerContainer.h

Issue 723923002: ServiceWorker: Add support for .skipWaiting and controllerchange event(1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update property tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/ServiceWorkerContainer.h
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.h b/Source/modules/serviceworkers/ServiceWorkerContainer.h
index 7490808ed173553212f8069f6469d1fe9e1c4d41..66cd0dd07e0aa0a0d37f7c2e345d9c7c36c042c6 100644
--- a/Source/modules/serviceworkers/ServiceWorkerContainer.h
+++ b/Source/modules/serviceworkers/ServiceWorkerContainer.h
@@ -35,6 +35,7 @@
#include "bindings/core/v8/ScriptPromiseProperty.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
#include "modules/serviceworkers/RegistrationOptions.h"
#include "modules/serviceworkers/ServiceWorker.h"
#include "modules/serviceworkers/ServiceWorkerRegistration.h"
@@ -52,11 +53,13 @@ class WebServiceWorkerProvider;
class WebServiceWorkerRegistration;
class ServiceWorkerContainer final
- : public GarbageCollectedFinalized<ServiceWorkerContainer>
- , public ScriptWrappable
+ : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<ServiceWorkerContainer>
+ , public EventTargetWithInlineData
, public ContextLifecycleObserver
, public WebServiceWorkerProviderClient {
DEFINE_WRAPPERTYPEINFO();
+ DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<ServiceWorkerContainer>);
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer);
public:
static ServiceWorkerContainer* create(ExecutionContext*);
~ServiceWorkerContainer();
@@ -73,10 +76,16 @@ public:
ScriptPromise getRegistration(ScriptState*, const String& documentURL);
// WebServiceWorkerProviderClient overrides.
- virtual void setController(WebServiceWorker*) override;
+ virtual void setController(WebServiceWorker*, bool shouldNotifyControllerChange) override;
virtual void setReadyRegistration(WebServiceWorkerRegistration*) override;
virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) override;
+ // EventTarget overrides.
+ virtual ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); }
+ virtual const AtomicString& interfaceName() const override;
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange);
+
private:
explicit ServiceWorkerContainer(ExecutionContext*);
« no previous file with comments | « Source/modules/EventTargetModulesFactory.in ('k') | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698