| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 NavigationPreloadCallbacks_h | 5 #ifndef NavigationPreloadCallbacks_h |
| 6 #define NavigationPreloadCallbacks_h | 6 #define NavigationPreloadCallbacks_h |
| 7 | 7 |
| 8 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 8 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class ScriptPromiseResolver; | 12 class ScriptPromiseResolver; |
| 13 struct WebNavigationPreloadState; |
| 13 struct WebServiceWorkerError; | 14 struct WebServiceWorkerError; |
| 14 | 15 |
| 15 class EnableNavigationPreloadCallbacks final | 16 class EnableNavigationPreloadCallbacks final |
| 16 : public WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks { | 17 : public WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks { |
| 17 public: | 18 public: |
| 18 EnableNavigationPreloadCallbacks(ScriptPromiseResolver*); | 19 EnableNavigationPreloadCallbacks(ScriptPromiseResolver*); |
| 19 ~EnableNavigationPreloadCallbacks() override; | 20 ~EnableNavigationPreloadCallbacks() override; |
| 20 | 21 |
| 21 // WebEnableNavigationPreloadCallbacks interface. | 22 // WebEnableNavigationPreloadCallbacks interface. |
| 22 void onSuccess() override; | 23 void onSuccess() override; |
| 23 void onError(const WebServiceWorkerError&) override; | 24 void onError(const WebServiceWorkerError&) override; |
| 24 | 25 |
| 25 private: | 26 private: |
| 26 Persistent<ScriptPromiseResolver> m_resolver; | 27 Persistent<ScriptPromiseResolver> m_resolver; |
| 27 WTF_MAKE_NONCOPYABLE(EnableNavigationPreloadCallbacks); | 28 WTF_MAKE_NONCOPYABLE(EnableNavigationPreloadCallbacks); |
| 28 }; | 29 }; |
| 29 | 30 |
| 31 class GetNavigationPreloadStateCallbacks final |
| 32 : public WebServiceWorkerRegistration:: |
| 33 WebGetNavigationPreloadStateCallbacks { |
| 34 public: |
| 35 GetNavigationPreloadStateCallbacks(ScriptPromiseResolver*); |
| 36 ~GetNavigationPreloadStateCallbacks() override; |
| 37 |
| 38 // WebGetNavigationPreloadStateCallbacks interface. |
| 39 void onSuccess(const WebNavigationPreloadState&) override; |
| 40 void onError(const WebServiceWorkerError&) override; |
| 41 |
| 42 private: |
| 43 Persistent<ScriptPromiseResolver> m_resolver; |
| 44 WTF_MAKE_NONCOPYABLE(GetNavigationPreloadStateCallbacks); |
| 45 }; |
| 46 |
| 30 } // namespace blink | 47 } // namespace blink |
| 31 | 48 |
| 32 #endif // NavigationPreloadCallbacks_h | 49 #endif // NavigationPreloadCallbacks_h |
| OLD | NEW |