| 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 WebServiceWorkerRegistration_h | 5 #ifndef WebServiceWorkerRegistration_h |
| 6 #define WebServiceWorkerRegistration_h | 6 #define WebServiceWorkerRegistration_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebURL.h" | 9 #include "public/platform/WebURL.h" |
| 10 #include "public/platform/modules/serviceworker/WebServiceWorkerError.h" | 10 #include "public/platform/modules/serviceworker/WebServiceWorkerError.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 using WebServiceWorkerUpdateCallbacks = | 26 using WebServiceWorkerUpdateCallbacks = |
| 27 WebCallbacks<void, const WebServiceWorkerError&>; | 27 WebCallbacks<void, const WebServiceWorkerError&>; |
| 28 using WebServiceWorkerUnregistrationCallbacks = | 28 using WebServiceWorkerUnregistrationCallbacks = |
| 29 WebCallbacks<bool, const WebServiceWorkerError&>; | 29 WebCallbacks<bool, const WebServiceWorkerError&>; |
| 30 using WebEnableNavigationPreloadCallbacks = | 30 using WebEnableNavigationPreloadCallbacks = |
| 31 WebCallbacks<void, const WebServiceWorkerError&>; | 31 WebCallbacks<void, const WebServiceWorkerError&>; |
| 32 using WebGetNavigationPreloadStateCallbacks = | 32 using WebGetNavigationPreloadStateCallbacks = |
| 33 WebCallbacks<const WebNavigationPreloadState&, | 33 WebCallbacks<const WebNavigationPreloadState&, |
| 34 const WebServiceWorkerError&>; | 34 const WebServiceWorkerError&>; |
| 35 using WebSetNavigationPreloadHeaderCallbacks = |
| 36 WebCallbacks<void, const WebServiceWorkerError&>; |
| 35 | 37 |
| 36 // The handle interface that retains a reference to the implementation of | 38 // The handle interface that retains a reference to the implementation of |
| 37 // WebServiceWorkerRegistration in the embedder and is owned by | 39 // WebServiceWorkerRegistration in the embedder and is owned by |
| 38 // ServiceWorkerRegistration object in Blink. The embedder must keep the | 40 // ServiceWorkerRegistration object in Blink. The embedder must keep the |
| 39 // registration representation while Blink is owning this handle. | 41 // registration representation while Blink is owning this handle. |
| 40 class Handle { | 42 class Handle { |
| 41 public: | 43 public: |
| 42 virtual ~Handle() {} | 44 virtual ~Handle() {} |
| 43 virtual WebServiceWorkerRegistration* registration() { return nullptr; } | 45 virtual WebServiceWorkerRegistration* registration() { return nullptr; } |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 virtual void setProxy(WebServiceWorkerRegistrationProxy*) {} | 48 virtual void setProxy(WebServiceWorkerRegistrationProxy*) {} |
| 47 virtual WebServiceWorkerRegistrationProxy* proxy() { return nullptr; } | 49 virtual WebServiceWorkerRegistrationProxy* proxy() { return nullptr; } |
| 48 virtual void proxyStopped() {} | 50 virtual void proxyStopped() {} |
| 49 | 51 |
| 50 virtual WebURL scope() const { return WebURL(); } | 52 virtual WebURL scope() const { return WebURL(); } |
| 51 virtual void update(WebServiceWorkerProvider*, | 53 virtual void update(WebServiceWorkerProvider*, |
| 52 WebServiceWorkerUpdateCallbacks*) {} | 54 WebServiceWorkerUpdateCallbacks*) {} |
| 53 virtual void unregister(WebServiceWorkerProvider*, | 55 virtual void unregister(WebServiceWorkerProvider*, |
| 54 WebServiceWorkerUnregistrationCallbacks*) {} | 56 WebServiceWorkerUnregistrationCallbacks*) {} |
| 55 | 57 |
| 56 virtual void enableNavigationPreload( | 58 virtual void enableNavigationPreload( |
| 57 bool enable, | 59 bool enable, |
| 58 WebServiceWorkerProvider*, | 60 WebServiceWorkerProvider*, |
| 59 std::unique_ptr<WebEnableNavigationPreloadCallbacks>) {} | 61 std::unique_ptr<WebEnableNavigationPreloadCallbacks>) {} |
| 60 virtual void getNavigationPreloadState( | 62 virtual void getNavigationPreloadState( |
| 61 WebServiceWorkerProvider*, | 63 WebServiceWorkerProvider*, |
| 62 std::unique_ptr<WebGetNavigationPreloadStateCallbacks>) {} | 64 std::unique_ptr<WebGetNavigationPreloadStateCallbacks>) {} |
| 65 virtual void setNavigationPreloadHeader( |
| 66 const WebString& value, |
| 67 WebServiceWorkerProvider*, |
| 68 std::unique_ptr<WebSetNavigationPreloadHeaderCallbacks>) {} |
| 63 }; | 69 }; |
| 64 | 70 |
| 65 } // namespace blink | 71 } // namespace blink |
| 66 | 72 |
| 67 #endif // WebServiceWorkerRegistration_h | 73 #endif // WebServiceWorkerRegistration_h |
| OLD | NEW |