OLD | NEW |
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 "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
38 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); | 38 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); |
39 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration); | 39 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration); |
40 public: | 40 public: |
41 // EventTarget overrides. | 41 // EventTarget overrides. |
42 const AtomicString& interfaceName() const override; | 42 const AtomicString& interfaceName() const override; |
43 ExecutionContext* getExecutionContext() const override { return ActiveDOMObj
ect::getExecutionContext(); } | 43 ExecutionContext* getExecutionContext() const override { return ActiveDOMObj
ect::getExecutionContext(); } |
44 | 44 |
45 // WebServiceWorkerRegistrationProxy overrides. | 45 // WebServiceWorkerRegistrationProxy overrides. |
46 void dispatchUpdateFoundEvent() override; | 46 void dispatchUpdateFoundEvent() override; |
47 void setInstalling(WebPassOwnPtr<WebServiceWorker::Handle>) override; | 47 void setInstalling(std::unique_ptr<WebServiceWorker::Handle>) override; |
48 void setWaiting(WebPassOwnPtr<WebServiceWorker::Handle>) override; | 48 void setWaiting(std::unique_ptr<WebServiceWorker::Handle>) override; |
49 void setActive(WebPassOwnPtr<WebServiceWorker::Handle>) override; | 49 void setActive(std::unique_ptr<WebServiceWorker::Handle>) override; |
50 | 50 |
51 // Returns an existing registration object for the handle if it exists. | 51 // Returns an existing registration object for the handle if it exists. |
52 // Otherwise, returns a new registration object. | 52 // Otherwise, returns a new registration object. |
53 static ServiceWorkerRegistration* getOrCreate(ExecutionContext*, PassOwnPtr<
WebServiceWorkerRegistration::Handle>); | 53 static ServiceWorkerRegistration* getOrCreate(ExecutionContext*, PassOwnPtr<
WebServiceWorkerRegistration::Handle>); |
54 | 54 |
55 ServiceWorker* installing() { return m_installing; } | 55 ServiceWorker* installing() { return m_installing; } |
56 ServiceWorker* waiting() { return m_waiting; } | 56 ServiceWorker* waiting() { return m_waiting; } |
57 ServiceWorker* active() { return m_active; } | 57 ServiceWorker* active() { return m_active; } |
58 | 58 |
59 String scope() const; | 59 String scope() const; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 HeapVector<Member<ServiceWorkerRegistration>> registrations; | 99 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
100 for (auto& registration : *webServiceWorkerRegistrations) | 100 for (auto& registration : *webServiceWorkerRegistrations) |
101 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); | 101 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); |
102 return registrations; | 102 return registrations; |
103 } | 103 } |
104 }; | 104 }; |
105 | 105 |
106 } // namespace blink | 106 } // namespace blink |
107 | 107 |
108 #endif // ServiceWorkerRegistration_h | 108 #endif // ServiceWorkerRegistration_h |
OLD | NEW |