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 WebServiceWorkerProxy_h | 5 #ifndef WebServiceWorkerProxy_h |
6 #define WebServiceWorkerProxy_h | 6 #define WebServiceWorkerProxy_h |
7 | 7 |
| 8 #include "WebCommon.h" |
| 9 |
| 10 namespace WebCore { class ServiceWorker; } |
| 11 |
8 namespace blink { | 12 namespace blink { |
9 | 13 |
10 // A proxy interface, passed via WebServiceWorker.setProxy() from blink to | 14 // A proxy interface, passed via WebServiceWorker.setProxy() from blink to |
11 // the embedder, to talk to the ServiceWorker object from embedder. | 15 // the embedder, to talk to the ServiceWorker object from embedder. |
12 class WebServiceWorkerProxy { | 16 class WebServiceWorkerProxy { |
13 public: | 17 public: |
| 18 WebServiceWorkerProxy() : m_private(0) { } |
| 19 virtual ~WebServiceWorkerProxy() { } |
| 20 |
14 // Returns true if the proxy is ready to be notified of service worker state | 21 // Returns true if the proxy is ready to be notified of service worker state |
15 // changes. It may not be if it's waiting for the registration promise to | 22 // changes. It may not be if it's waiting for the registration promise to |
16 // resolve, while the browser side has registered and is proceeding to | 23 // resolve, while the browser side has registered and is proceeding to |
17 // install and activate the worker. | 24 // install and activate the worker. |
18 virtual bool isReady() = 0; | 25 virtual bool isReady() = 0; |
19 | 26 |
20 // Notifies the proxy that the service worker state changed. The new state | 27 // Notifies the proxy that the service worker state changed. The new state |
21 // should be accessible via WebServiceWorker.state(). | 28 // should be accessible via WebServiceWorker.state(). |
22 virtual void dispatchStateChangeEvent() = 0; | 29 virtual void dispatchStateChangeEvent() = 0; |
| 30 |
| 31 #if INSIDE_BLINK |
| 32 BLINK_PLATFORM_EXPORT WebServiceWorkerProxy(WebCore::ServiceWorker*); |
| 33 BLINK_PLATFORM_EXPORT WebCore::ServiceWorker* unwrap() const; |
| 34 #endif |
| 35 |
| 36 protected: |
| 37 WebCore::ServiceWorker* m_private; |
23 }; | 38 }; |
24 | 39 |
25 } // namespace blink | 40 } // namespace blink |
26 | 41 |
27 #endif // WebServiceWorkerProxy_h | 42 #endif // WebServiceWorkerProxy_h |
OLD | NEW |