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

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

Issue 239973002: Add blink interface (and code) for setting navigator.serviceWorker.current (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months 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
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorkerContainer.h
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.h b/Source/modules/serviceworkers/ServiceWorkerContainer.h
index a27b7ab6f189831a908740b89c1044b8a3e12b88..f1dd4419884f3221d505f072730b48bded1beeae 100644
--- a/Source/modules/serviceworkers/ServiceWorkerContainer.h
+++ b/Source/modules/serviceworkers/ServiceWorkerContainer.h
@@ -33,6 +33,7 @@
#include "bindings/v8/ScriptPromise.h"
#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/ContextLifecycleObserver.h"
#include "public/platform/WebServiceWorkerProviderClient.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
@@ -40,16 +41,19 @@
namespace blink {
class WebServiceWorkerProvider;
+class WebServiceWorker;
}
namespace WebCore {
class Dictionary;
class ExecutionContext;
+class ServiceWorker;
class ServiceWorkerContainer FINAL :
public RefCounted<ServiceWorkerContainer>,
public ScriptWrappable,
+ public ContextLifecycleObserver,
public blink::WebServiceWorkerProviderClient {
public:
static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*);
@@ -60,10 +64,14 @@ public:
ScriptPromise registerServiceWorker(ExecutionContext*, const String& pattern, const Dictionary&);
ScriptPromise unregisterServiceWorker(ExecutionContext*, const String& scope = String());
+ // WebServiceWorkerProviderClient overrides.
+ virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE;
+
private:
- ServiceWorkerContainer(ExecutionContext*);
+ explicit ServiceWorkerContainer(ExecutionContext*);
blink::WebServiceWorkerProvider* m_provider;
+ RefPtr<ServiceWorker> m_current;
};
} // namespace WebCore
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698