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

Side by Side Diff: third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerProvider.h

Issue 2564363002: ServiceWorker: Replace RegistrationCallback and GetRegistrationsCallback with CallbackPromiseAdapter (Closed)
Patch Set: base::MakeUnique Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // events. Must be cleared before the client becomes invalid. 52 // events. Must be cleared before the client becomes invalid.
53 virtual void setClient(WebServiceWorkerProviderClient*) {} 53 virtual void setClient(WebServiceWorkerProviderClient*) {}
54 54
55 using WebServiceWorkerRegistrationCallbacks = 55 using WebServiceWorkerRegistrationCallbacks =
56 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>, 56 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>,
57 const WebServiceWorkerError&>; 57 const WebServiceWorkerError&>;
58 using WebServiceWorkerGetRegistrationCallbacks = 58 using WebServiceWorkerGetRegistrationCallbacks =
59 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>, 59 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>,
60 const WebServiceWorkerError&>; 60 const WebServiceWorkerError&>;
61 61
62 // Each element's ownership is transferred. 62 using WebServiceWorkerRegistrationHandles =
63 using WebServiceWorkerGetRegistrationsCallbacks = WebCallbacks< 63 WebVector<std::unique_ptr<WebServiceWorkerRegistration::Handle>>;
64 std::unique_ptr<WebVector<WebServiceWorkerRegistration::Handle*>>, 64 using WebServiceWorkerGetRegistrationsCallbacks =
65 const WebServiceWorkerError&>; 65 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistrationHandles>,
66 const WebServiceWorkerError&>;
66 using WebServiceWorkerGetRegistrationForReadyCallbacks = 67 using WebServiceWorkerGetRegistrationForReadyCallbacks =
67 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>, void>; 68 WebCallbacks<std::unique_ptr<WebServiceWorkerRegistration::Handle>, void>;
68 69
69 virtual void registerServiceWorker( 70 virtual void registerServiceWorker(
70 const WebURL& pattern, 71 const WebURL& pattern,
71 const WebURL& scriptUrl, 72 const WebURL& scriptUrl,
72 std::unique_ptr<WebServiceWorkerRegistrationCallbacks>) {} 73 std::unique_ptr<WebServiceWorkerRegistrationCallbacks>) {}
73 virtual void getRegistration( 74 virtual void getRegistration(
74 const WebURL& documentURL, 75 const WebURL& documentURL,
75 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks>) {} 76 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks>) {}
76 virtual void getRegistrations( 77 virtual void getRegistrations(
77 std::unique_ptr<WebServiceWorkerGetRegistrationsCallbacks>) {} 78 std::unique_ptr<WebServiceWorkerGetRegistrationsCallbacks>) {}
78 virtual void getRegistrationForReady( 79 virtual void getRegistrationForReady(
79 std::unique_ptr<WebServiceWorkerGetRegistrationForReadyCallbacks>) {} 80 std::unique_ptr<WebServiceWorkerGetRegistrationForReadyCallbacks>) {}
80 virtual bool validateScopeAndScriptURL(const WebURL& scope, 81 virtual bool validateScopeAndScriptURL(const WebURL& scope,
81 const WebURL& scriptURL, 82 const WebURL& scriptURL,
82 WebString* errorMessage) { 83 WebString* errorMessage) {
83 return false; 84 return false;
84 } 85 }
85 86
86 virtual ~WebServiceWorkerProvider() {} 87 virtual ~WebServiceWorkerProvider() {}
87 }; 88 };
88 89
89 } // namespace blink 90 } // namespace blink
90 91
91 #endif 92 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698