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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ServiceWorkerRegistration_h
6 #define ServiceWorkerRegistration_h
7
8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h"
10 #include "public/platform/WebServiceWorkerRegistration.h"
11 #include "wtf/OwnPtr.h"
12 #include "wtf/PassOwnPtr.h"
13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefCounted.h"
15
16 namespace blink {
17
18 class ScriptPromise;
19 class ScriptPromiseResolver;
20 class ScriptState;
21 class WebServiceWorkerProvider;
22
23 class ServiceWorkerRegistration FINAL
24 : public RefCountedWillBeRefCountedGarbageCollected<ServiceWorkerRegistratio n>
25 , public ActiveDOMObject
26 , public EventTargetWithInlineData {
27 REFCOUNTED_EVENT_TARGET(ServiceWorkerRegistration);
28 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration);
29 public:
30 virtual ~ServiceWorkerRegistration() { }
31
32 // EventTarget override.
33 virtual const AtomicString& interfaceName() const OVERRIDE;
34 virtual ExecutionContext* executionContext() const OVERRIDE { return ActiveD OMObject::executionContext(); }
35
36 // For CallbackPromiseAdapter.
37 typedef WebServiceWorkerRegistration WebType;
38 static PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> from(ScriptPromiseR esolver*, WebType* registration);
39
40 String scope() const;
41
42 ScriptPromise unregister(ScriptState*);
43
44 private:
45 static PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> create(ExecutionCon text*, PassOwnPtr<WebServiceWorkerRegistration>);
46 ServiceWorkerRegistration(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegi stration>);
47
48 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration;
49 WebServiceWorkerProvider* m_provider;
50 };
51
52 } // namespace blink
53
54 #endif // ServiceWorkerRegistration_h
OLDNEW
« 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