Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/NavigationPreloadCallbacks.h

Issue 2413063003: service worker: Add promise boilerplate for NavigationPreload enable/disable (Closed)
Patch Set: more boilerplate Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NavigationPreloadCallbacks_h
6 #define NavigationPreloadCallbacks_h
7
8 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
9
10 namespace blink {
11
12 class ScriptPromiseResolver;
13 struct WebServiceWorkerError;
14
15 class EnableNavigationPreloadCallbacks final
nhiroki 2016/10/13 11:29:13 Why don't you use PromiseCallbackAdapter<void, Ser
falken 2016/10/14 04:08:50 Yea I considered using PromiseCallbackAdapter but
16 : public WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks {
17 public:
18 EnableNavigationPreloadCallbacks(ScriptPromiseResolver*);
19 ~EnableNavigationPreloadCallbacks() override;
20
21 // WebEnableNavigationPreloadCallbacks interface.
22 void onSuccess() override;
23 void onError(const WebServiceWorkerError&) override;
24
25 private:
26 Persistent<ScriptPromiseResolver> m_resolver;
27 WTF_MAKE_NONCOPYABLE(EnableNavigationPreloadCallbacks);
28 };
29
30 class DisableNavigationPreloadCallbacks final
nhiroki 2016/10/13 11:29:13 ditto.
31 : public WebServiceWorkerRegistration::
32 WebDisableNavigationPreloadCallbacks {
33 public:
34 DisableNavigationPreloadCallbacks(ScriptPromiseResolver*);
35 ~DisableNavigationPreloadCallbacks() override;
36
37 // WebDisableNavigationPreloadCallbacks interface.
38 void onSuccess() override;
39 void onError(const WebServiceWorkerError&) override;
40
41 private:
42 Persistent<ScriptPromiseResolver> m_resolver;
43 WTF_MAKE_NONCOPYABLE(DisableNavigationPreloadCallbacks);
44 };
45
46 } // namespace blink
47
48 #endif // NavigationPreloadCallbacks_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698