| 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/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/V8GCRoot.h" |
| 9 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
| 10 #include "core/events/EventTarget.h" | 11 #include "core/events/EventTarget.h" |
| 11 #include "modules/serviceworkers/ServiceWorker.h" | 12 #include "modules/serviceworkers/ServiceWorker.h" |
| 12 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 13 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| 13 #include "platform/Supplementable.h" | 14 #include "platform/Supplementable.h" |
| 14 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 15 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| 15 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistrationProx
y.h" | 16 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistrationProx
y.h" |
| 16 #include "wtf/OwnPtr.h" | 17 #include "wtf/OwnPtr.h" |
| 17 #include "wtf/PassOwnPtr.h" | 18 #include "wtf/PassOwnPtr.h" |
| 18 #include "wtf/PassRefPtr.h" | 19 #include "wtf/PassRefPtr.h" |
| 19 #include "wtf/RefCounted.h" | 20 #include "wtf/RefCounted.h" |
| 20 | 21 |
| 21 namespace blink { | 22 namespace blink { |
| 22 | 23 |
| 23 class ScriptPromise; | 24 class ScriptPromise; |
| 24 class ScriptState; | 25 class ScriptState; |
| 25 class WebServiceWorkerProvider; | 26 class WebServiceWorkerProvider; |
| 26 | 27 |
| 27 // The implementation of a service worker registration object in Blink. Actual | 28 // The implementation of a service worker registration object in Blink. Actual |
| 28 // registration representation is in the embedder and this class accesses it | 29 // registration representation is in the embedder and this class accesses it |
| 29 // via WebServiceWorkerRegistration::Handle object. | 30 // via WebServiceWorkerRegistration::Handle object. |
| 30 class ServiceWorkerRegistration final | 31 class ServiceWorkerRegistration final |
| 31 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRe
gistration> | 32 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRe
gistration> |
| 32 , public ActiveDOMObject | 33 , public ActiveDOMObject |
| 33 , public WebServiceWorkerRegistrationProxy | 34 , public WebServiceWorkerRegistrationProxy |
| 34 , public HeapSupplementable<ServiceWorkerRegistration> { | 35 , public HeapSupplementable<ServiceWorkerRegistration> |
| 36 , public V8GCRoot { |
| 35 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
| 36 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); | 38 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); |
| 37 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration); | 39 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration); |
| 38 public: | 40 public: |
| 39 // EventTarget overrides. | 41 // EventTarget overrides. |
| 40 const AtomicString& interfaceName() const override; | 42 const AtomicString& interfaceName() const override; |
| 41 ExecutionContext* getExecutionContext() const override { return ActiveDOMObj
ect::getExecutionContext(); } | 43 ExecutionContext* getExecutionContext() const override { return ActiveDOMObj
ect::getExecutionContext(); } |
| 42 | 44 |
| 43 // WebServiceWorkerRegistrationProxy overrides. | 45 // WebServiceWorkerRegistrationProxy overrides. |
| 44 void dispatchUpdateFoundEvent() override; | 46 void dispatchUpdateFoundEvent() override; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 HeapVector<Member<ServiceWorkerRegistration>> registrations; | 97 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
| 96 for (auto& registration : *webServiceWorkerRegistrations) | 98 for (auto& registration : *webServiceWorkerRegistrations) |
| 97 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); | 99 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); |
| 98 return registrations; | 100 return registrations; |
| 99 } | 101 } |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } // namespace blink | 104 } // namespace blink |
| 103 | 105 |
| 104 #endif // ServiceWorkerRegistration_h | 106 #endif // ServiceWorkerRegistration_h |
| OLD | NEW |