| 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 WebServiceWorkerRegistrationProxy_h | 5 #ifndef WebServiceWorkerRegistrationProxy_h |
| 6 #define WebServiceWorkerRegistrationProxy_h | 6 #define WebServiceWorkerRegistrationProxy_h |
| 7 | 7 |
| 8 #if INSIDE_BLINK | |
| 9 #include "platform/heap/Handle.h" | |
| 10 #endif | |
| 11 #include "public/platform/WebCommon.h" | |
| 12 | |
| 13 namespace blink { | 8 namespace blink { |
| 14 | 9 |
| 15 class ServiceWorkerRegistration; | |
| 16 class WebServiceWorker; | 10 class WebServiceWorker; |
| 17 | 11 |
| 18 // A proxy interface, passed via WebServiceWorkerRegistration.setProxy() from | 12 // A proxy interface, passed via WebServiceWorkerRegistration.setProxy() from |
| 19 // blink to the embedder, to talk to the ServiceWorkerRegistration object from | 13 // blink to the embedder, to talk to the ServiceWorkerRegistration object from |
| 20 // embedder. | 14 // embedder. |
| 21 class WebServiceWorkerRegistrationProxy { | 15 class WebServiceWorkerRegistrationProxy { |
| 22 public: | 16 public: |
| 23 WebServiceWorkerRegistrationProxy() : m_private(0) { } | |
| 24 virtual ~WebServiceWorkerRegistrationProxy() { } | |
| 25 | |
| 26 // Notifies that the registration entered the installation process. | 17 // Notifies that the registration entered the installation process. |
| 27 // The installing worker should be accessible via | 18 // The installing worker should be accessible via |
| 28 // WebServiceWorkerRegistration.installing. | 19 // WebServiceWorkerRegistration.installing. |
| 29 virtual void dispatchUpdateFoundEvent() = 0; | 20 virtual void dispatchUpdateFoundEvent() = 0; |
| 30 | 21 |
| 31 virtual void setInstalling(WebServiceWorker*) = 0; | 22 virtual void setInstalling(WebServiceWorker*) = 0; |
| 32 virtual void setWaiting(WebServiceWorker*) = 0; | 23 virtual void setWaiting(WebServiceWorker*) = 0; |
| 33 virtual void setActive(WebServiceWorker*) = 0; | 24 virtual void setActive(WebServiceWorker*) = 0; |
| 34 | 25 |
| 35 #if INSIDE_BLINK | |
| 36 BLINK_PLATFORM_EXPORT WebServiceWorkerRegistrationProxy(ServiceWorkerRegistr
ation*); | |
| 37 BLINK_PLATFORM_EXPORT operator ServiceWorkerRegistration*() const; | |
| 38 #endif | |
| 39 | |
| 40 protected: | 26 protected: |
| 41 #if INSIDE_BLINK | 27 virtual ~WebServiceWorkerRegistrationProxy() { } |
| 42 // This is a back pointer to |this| object. | |
| 43 // The ServiceWorkerRegistration inherits from this WebServiceWorkerRegistra
tionProxy. | |
| 44 GC_PLUGIN_IGNORE("crbug.com/410257") | |
| 45 #endif | |
| 46 ServiceWorkerRegistration* m_private; | |
| 47 }; | 28 }; |
| 48 | 29 |
| 49 } // namespace blink | 30 } // namespace blink |
| 50 | 31 |
| 51 #endif // WebServiceWorkerRegistrationProxy_h | 32 #endif // WebServiceWorkerRegistrationProxy_h |
| OLD | NEW |