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 <memory> |
| 9 |
8 #include "public/platform/WebCallbacks.h" | 10 #include "public/platform/WebCallbacks.h" |
9 #include "public/platform/WebURL.h" | 11 #include "public/platform/WebURL.h" |
10 #include "public/platform/modules/serviceworker/WebServiceWorkerError.h" | 12 #include "public/platform/modules/serviceworker/WebServiceWorkerError.h" |
11 #include <memory> | 13 #include "public/platform/modules/serviceworker/WebServiceWorkerUpdateViaCache.h
" |
12 | 14 |
13 namespace blink { | 15 namespace blink { |
14 | 16 |
15 class WebServiceWorkerProvider; | 17 class WebServiceWorkerProvider; |
16 class WebServiceWorkerRegistrationProxy; | 18 class WebServiceWorkerRegistrationProxy; |
17 struct WebNavigationPreloadState; | 19 struct WebNavigationPreloadState; |
18 | 20 |
19 // The interface of the registration representation in the embedder. The | 21 // The interface of the registration representation in the embedder. The |
20 // embedder implements this interface and passes its handle | 22 // embedder implements this interface and passes its handle |
21 // (WebServiceWorkerRegistration::Handle) to Blink. Blink accesses the | 23 // (WebServiceWorkerRegistration::Handle) to Blink. Blink accesses the |
(...skipping 22 matching lines...) Expand all Loading... |
44 public: | 46 public: |
45 virtual ~Handle() {} | 47 virtual ~Handle() {} |
46 virtual WebServiceWorkerRegistration* Registration() { return nullptr; } | 48 virtual WebServiceWorkerRegistration* Registration() { return nullptr; } |
47 }; | 49 }; |
48 | 50 |
49 virtual void SetProxy(WebServiceWorkerRegistrationProxy*) {} | 51 virtual void SetProxy(WebServiceWorkerRegistrationProxy*) {} |
50 virtual WebServiceWorkerRegistrationProxy* Proxy() { return nullptr; } | 52 virtual WebServiceWorkerRegistrationProxy* Proxy() { return nullptr; } |
51 virtual void ProxyStopped() {} | 53 virtual void ProxyStopped() {} |
52 | 54 |
53 virtual WebURL Scope() const { return WebURL(); } | 55 virtual WebURL Scope() const { return WebURL(); } |
| 56 virtual WebServiceWorkerUpdateViaCache UpdateViaCache() const { |
| 57 return WebServiceWorkerUpdateViaCache::kImports; |
| 58 } |
54 virtual int64_t RegistrationId() const = 0; | 59 virtual int64_t RegistrationId() const = 0; |
55 virtual void Update(WebServiceWorkerProvider*, | 60 virtual void Update(WebServiceWorkerProvider*, |
56 std::unique_ptr<WebServiceWorkerUpdateCallbacks>) {} | 61 std::unique_ptr<WebServiceWorkerUpdateCallbacks>) {} |
57 virtual void Unregister( | 62 virtual void Unregister( |
58 WebServiceWorkerProvider*, | 63 WebServiceWorkerProvider*, |
59 std::unique_ptr<WebServiceWorkerUnregistrationCallbacks>) {} | 64 std::unique_ptr<WebServiceWorkerUnregistrationCallbacks>) {} |
60 | 65 |
61 virtual void EnableNavigationPreload( | 66 virtual void EnableNavigationPreload( |
62 bool enable, | 67 bool enable, |
63 WebServiceWorkerProvider*, | 68 WebServiceWorkerProvider*, |
64 std::unique_ptr<WebEnableNavigationPreloadCallbacks>) {} | 69 std::unique_ptr<WebEnableNavigationPreloadCallbacks>) {} |
65 virtual void GetNavigationPreloadState( | 70 virtual void GetNavigationPreloadState( |
66 WebServiceWorkerProvider*, | 71 WebServiceWorkerProvider*, |
67 std::unique_ptr<WebGetNavigationPreloadStateCallbacks>) {} | 72 std::unique_ptr<WebGetNavigationPreloadStateCallbacks>) {} |
68 virtual void SetNavigationPreloadHeader( | 73 virtual void SetNavigationPreloadHeader( |
69 const WebString& value, | 74 const WebString& value, |
70 WebServiceWorkerProvider*, | 75 WebServiceWorkerProvider*, |
71 std::unique_ptr<WebSetNavigationPreloadHeaderCallbacks>) {} | 76 std::unique_ptr<WebSetNavigationPreloadHeaderCallbacks>) {} |
72 }; | 77 }; |
73 | 78 |
74 } // namespace blink | 79 } // namespace blink |
75 | 80 |
76 #endif // WebServiceWorkerRegistration_h | 81 #endif // WebServiceWorkerRegistration_h |
OLD | NEW |