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

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

Issue 413123002: ServiceWorker: Implement ServiceWorkerRegistration [1/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix for tkent's comments Created 6 years, 5 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
Index: Source/modules/serviceworkers/ServiceWorkerRegistration.h
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.h b/Source/modules/serviceworkers/ServiceWorkerRegistration.h
new file mode 100644
index 0000000000000000000000000000000000000000..24e6abbe2e468eb5fb83c001aeb0c52a3a05860a
--- /dev/null
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.h
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ServiceWorkerRegistration_h
+#define ServiceWorkerRegistration_h
+
+#include "core/dom/ActiveDOMObject.h"
+#include "core/events/EventTarget.h"
+#include "public/platform/WebServiceWorkerRegistration.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace blink {
+
+class ScriptPromise;
+class ScriptPromiseResolver;
+class ScriptState;
+class WebServiceWorkerProvider;
+
+class ServiceWorkerRegistration FINAL
+ : public RefCountedWillBeRefCountedGarbageCollected<ServiceWorkerRegistration>
+ , public ActiveDOMObject
+ , public EventTargetWithInlineData {
+ REFCOUNTED_EVENT_TARGET(ServiceWorkerRegistration);
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration);
+public:
+ virtual ~ServiceWorkerRegistration() { }
+
+ // EventTarget override.
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+ virtual ExecutionContext* executionContext() const OVERRIDE { return ActiveDOMObject::executionContext(); }
+
+ // For CallbackPromiseAdapter.
+ typedef WebServiceWorkerRegistration WebType;
+ static PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> from(ScriptPromiseResolver*, WebType* registration);
+
+ String scope() const;
+
+ ScriptPromise unregister(ScriptState*);
+
+private:
+ static PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> create(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegistration>);
+ ServiceWorkerRegistration(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegistration>);
+
+ OwnPtr<WebServiceWorkerRegistration> m_outerRegistration;
+ WebServiceWorkerProvider* m_provider;
+};
+
+} // namespace blink
+
+#endif // ServiceWorkerRegistration_h
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerContainer.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerRegistration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698