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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.h

Issue 1227783004: Fix virtual/override/final usage in Source/modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ServiceWorkerRegistration_h 5 #ifndef ServiceWorkerRegistration_h
6 #define ServiceWorkerRegistration_h 6 #define ServiceWorkerRegistration_h
7 7
8 #include "core/dom/ActiveDOMObject.h" 8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h" 9 #include "core/events/EventTarget.h"
10 #include "modules/serviceworkers/ServiceWorker.h" 10 #include "modules/serviceworkers/ServiceWorker.h"
(...skipping 16 matching lines...) Expand all
27 class ServiceWorkerRegistration final 27 class ServiceWorkerRegistration final
28 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRe gistration> 28 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRe gistration>
29 , public ActiveDOMObject 29 , public ActiveDOMObject
30 , public WebServiceWorkerRegistrationProxy 30 , public WebServiceWorkerRegistrationProxy
31 , public HeapSupplementable<ServiceWorkerRegistration> { 31 , public HeapSupplementable<ServiceWorkerRegistration> {
32 DEFINE_WRAPPERTYPEINFO(); 32 DEFINE_WRAPPERTYPEINFO();
33 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); 33 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration);
34 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration); 34 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration);
35 public: 35 public:
36 // EventTarget overrides. 36 // EventTarget overrides.
37 virtual const AtomicString& interfaceName() const override; 37 const AtomicString& interfaceName() const override;
38 virtual ExecutionContext* executionContext() const override { return ActiveD OMObject::executionContext(); } 38 ExecutionContext* executionContext() const override { return ActiveDOMObject ::executionContext(); }
39 39
40 // WebServiceWorkerRegistrationProxy overrides. 40 // WebServiceWorkerRegistrationProxy overrides.
41 virtual void dispatchUpdateFoundEvent() override; 41 void dispatchUpdateFoundEvent() override;
42 virtual void setInstalling(WebServiceWorker*) override; 42 void setInstalling(WebServiceWorker*) override;
43 virtual void setWaiting(WebServiceWorker*) override; 43 void setWaiting(WebServiceWorker*) override;
44 virtual void setActive(WebServiceWorker*) override; 44 void setActive(WebServiceWorker*) override;
45 45
46 // For CallbackPromiseAdapter. 46 // For CallbackPromiseAdapter.
47 typedef WebServiceWorkerRegistration WebType; 47 typedef WebServiceWorkerRegistration WebType;
48 static ServiceWorkerRegistration* from(ExecutionContext*, WebType* registrat ion); 48 static ServiceWorkerRegistration* from(ExecutionContext*, WebType* registrat ion);
49 static ServiceWorkerRegistration* take(ScriptPromiseResolver*, WebType* regi stration); 49 static ServiceWorkerRegistration* take(ScriptPromiseResolver*, WebType* regi stration);
50 static void dispose(WebType* registration); 50 static void dispose(WebType* registration);
51 51
52 PassRefPtrWillBeRawPtr<ServiceWorker> installing() { return m_installing.get (); } 52 PassRefPtrWillBeRawPtr<ServiceWorker> installing() { return m_installing.get (); }
53 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); } 53 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); }
54 PassRefPtrWillBeRawPtr<ServiceWorker> active() { return m_active.get(); } 54 PassRefPtrWillBeRawPtr<ServiceWorker> active() { return m_active.get(); }
55 55
56 String scope() const; 56 String scope() const;
57 57
58 WebServiceWorkerRegistration* webRegistration() { return m_outerRegistration .get(); } 58 WebServiceWorkerRegistration* webRegistration() { return m_outerRegistration .get(); }
59 59
60 void update(ScriptState*, ExceptionState&); 60 void update(ScriptState*, ExceptionState&);
61 ScriptPromise unregister(ScriptState*); 61 ScriptPromise unregister(ScriptState*);
62 62
63 DEFINE_ATTRIBUTE_EVENT_LISTENER(updatefound); 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(updatefound);
64 64
65 virtual ~ServiceWorkerRegistration() override; 65 ~ServiceWorkerRegistration() override;
66 66
67 // Eager finalization needed to promptly release owned WebServiceWorkerRegis tration. 67 // Eager finalization needed to promptly release owned WebServiceWorkerRegis tration.
68 EAGERLY_FINALIZE(); 68 EAGERLY_FINALIZE();
69 DECLARE_VIRTUAL_TRACE(); 69 DECLARE_VIRTUAL_TRACE();
70 70
71 private: 71 private:
72 static ServiceWorkerRegistration* getOrCreate(ExecutionContext*, WebServiceW orkerRegistration*); 72 static ServiceWorkerRegistration* getOrCreate(ExecutionContext*, WebServiceW orkerRegistration*);
73 ServiceWorkerRegistration(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegi stration>); 73 ServiceWorkerRegistration(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegi stration>);
74 74
75 // ActiveDOMObject overrides. 75 // ActiveDOMObject overrides.
76 virtual bool hasPendingActivity() const override; 76 bool hasPendingActivity() const override;
77 virtual void stop() override; 77 void stop() override;
78 78
79 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration; 79 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration;
80 WebServiceWorkerProvider* m_provider; 80 WebServiceWorkerProvider* m_provider;
81 RefPtrWillBeMember<ServiceWorker> m_installing; 81 RefPtrWillBeMember<ServiceWorker> m_installing;
82 RefPtrWillBeMember<ServiceWorker> m_waiting; 82 RefPtrWillBeMember<ServiceWorker> m_waiting;
83 RefPtrWillBeMember<ServiceWorker> m_active; 83 RefPtrWillBeMember<ServiceWorker> m_active;
84 84
85 bool m_stopped; 85 bool m_stopped;
86 }; 86 };
87 87
(...skipping 15 matching lines...) Expand all
103 } 103 }
104 104
105 private: 105 private:
106 WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationArray); 106 WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationArray);
107 ServiceWorkerRegistrationArray() = delete; 107 ServiceWorkerRegistrationArray() = delete;
108 }; 108 };
109 109
110 } // namespace blink 110 } // namespace blink
111 111
112 #endif // ServiceWorkerRegistration_h 112 #endif // ServiceWorkerRegistration_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerMessageEvent.h ('k') | Source/modules/serviceworkers/ServiceWorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698