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

Unified Diff: public/platform/modules/serviceworker/WebServiceWorkerProvider.h

Issue 1322283002: [WONT COMMIT] Revert of [ServiceWorker] Use appopriate type parameters for WebCallbacks (3/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/modules/serviceworker/WebServiceWorkerProvider.h
diff --git a/public/platform/modules/serviceworker/WebServiceWorkerProvider.h b/public/platform/modules/serviceworker/WebServiceWorkerProvider.h
index 25c507bca702a5b66e3b0cfb9b833fe7343a29d9..f10faf3a90b5bcec591880d5dd03fa55b6d06d3a 100644
--- a/public/platform/modules/serviceworker/WebServiceWorkerProvider.h
+++ b/public/platform/modules/serviceworker/WebServiceWorkerProvider.h
@@ -52,12 +52,34 @@
// events. Must be cleared before the client becomes invalid.
virtual void setClient(WebServiceWorkerProviderClient*) { }
- using WebServiceWorkerRegistrationCallbacks = WebCallbacks<WebPassOwnPtr<WebServiceWorkerRegistration>, const WebServiceWorkerError&>;
- using WebServiceWorkerGetRegistrationCallbacks = WebCallbacks<WebPassOwnPtr<WebServiceWorkerRegistration>, const WebServiceWorkerError&>;
- // Each element's ownership is transferred.
- // TODO(yhirano): Consider using vector<scoped_ptr<>>.
- using WebServiceWorkerGetRegistrationsCallbacks = WebCallbacks<WebPassOwnPtr<WebVector<WebServiceWorkerRegistration*>>, const WebServiceWorkerError&>;
- using WebServiceWorkerGetRegistrationForReadyCallbacks = WebCallbacks<WebPassOwnPtr<WebServiceWorkerRegistration>, void>;
+ class WebServiceWorkerRegistrationCallbacks : public WebCallbacks<WebPassOwnPtr<WebServiceWorkerRegistration>, const WebServiceWorkerError&> {
+ public:
+ void onSuccess(WebServiceWorkerRegistration* r) { onSuccess(adoptWebPtr(r)); }
+ void onError(WebServiceWorkerError* e)
+ {
+ onError(*e);
+ delete e;
+ }
+ virtual void onSuccess(WebPassOwnPtr<WebServiceWorkerRegistration>) = 0;
+ virtual void onError(const WebServiceWorkerError&) = 0;
+ };
+ using WebServiceWorkerGetRegistrationCallbacks = WebServiceWorkerRegistrationCallbacks;
+ class WebServiceWorkerGetRegistrationsCallbacks : public WebCallbacks<WebPassOwnPtr<WebVector<WebServiceWorkerRegistration*>>, const WebServiceWorkerError&> {
+ public:
+ void onSuccess(WebVector<WebServiceWorkerRegistration*>* r) { onSuccess(adoptWebPtr(r)); }
+ void onError(WebServiceWorkerError* e)
+ {
+ onError(*e);
+ delete e;
+ }
+ virtual void onSuccess(WebPassOwnPtr<WebVector<WebServiceWorkerRegistration*>>) = 0;
+ virtual void onError(const WebServiceWorkerError&) = 0;
+ };
+ class WebServiceWorkerGetRegistrationForReadyCallbacks : public WebCallbacks<WebPassOwnPtr<WebServiceWorkerRegistration>, void> {
+ public:
+ void onSuccess(WebServiceWorkerRegistration* r) { onSuccess(adoptWebPtr(r)); }
+ virtual void onSuccess(WebPassOwnPtr<WebServiceWorkerRegistration>) = 0;
+ };
virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scriptUrl, WebServiceWorkerRegistrationCallbacks*) { }
virtual void getRegistration(const WebURL& documentURL, WebServiceWorkerGetRegistrationCallbacks*) { }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698