OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ServiceWorkerContainer_h | 31 #ifndef ServiceWorkerContainer_h |
32 #define ServiceWorkerContainer_h | 32 #define ServiceWorkerContainer_h |
33 | 33 |
34 #include "bindings/v8/ScriptPromise.h" | 34 #include "bindings/v8/ScriptPromise.h" |
35 #include "bindings/v8/ScriptWrappable.h" | 35 #include "bindings/v8/ScriptWrappable.h" |
36 #include "core/dom/ContextLifecycleObserver.h" | 36 #include "core/dom/ContextLifecycleObserver.h" |
| 37 #include "modules/serviceworkers/ServiceWorker.h" |
37 #include "public/platform/WebServiceWorkerProviderClient.h" | 38 #include "public/platform/WebServiceWorkerProviderClient.h" |
38 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 class WebServiceWorkerProvider; | 44 class WebServiceWorkerProvider; |
44 class WebServiceWorker; | 45 class WebServiceWorker; |
45 } | 46 } |
46 | 47 |
(...skipping 10 matching lines...) Expand all Loading... |
57 public blink::WebServiceWorkerProviderClient { | 58 public blink::WebServiceWorkerProviderClient { |
58 public: | 59 public: |
59 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); | 60 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); |
60 ~ServiceWorkerContainer(); | 61 ~ServiceWorkerContainer(); |
61 | 62 |
62 void detachClient(); | 63 void detachClient(); |
63 | 64 |
64 ScriptPromise registerServiceWorker(ExecutionContext*, const String& pattern
, const Dictionary&); | 65 ScriptPromise registerServiceWorker(ExecutionContext*, const String& pattern
, const Dictionary&); |
65 ScriptPromise unregisterServiceWorker(ExecutionContext*, const String& scope
= String()); | 66 ScriptPromise unregisterServiceWorker(ExecutionContext*, const String& scope
= String()); |
66 | 67 |
| 68 PassRefPtr<ServiceWorker> current() { return m_current; } |
| 69 |
67 // WebServiceWorkerProviderClient overrides. | 70 // WebServiceWorkerProviderClient overrides. |
68 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; | 71 virtual void setCurrentServiceWorker(blink::WebServiceWorker*) OVERRIDE; |
69 | 72 |
70 private: | 73 private: |
71 explicit ServiceWorkerContainer(ExecutionContext*); | 74 explicit ServiceWorkerContainer(ExecutionContext*); |
72 | 75 |
73 blink::WebServiceWorkerProvider* m_provider; | 76 blink::WebServiceWorkerProvider* m_provider; |
74 RefPtr<ServiceWorker> m_current; | 77 RefPtr<ServiceWorker> m_current; |
75 }; | 78 }; |
76 | 79 |
77 } // namespace WebCore | 80 } // namespace WebCore |
78 | 81 |
79 #endif // ServiceWorkerContainer_h | 82 #endif // ServiceWorkerContainer_h |
OLD | NEW |