OLD | NEW |
(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 |
OLD | NEW |