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

Unified Diff: public/platform/modules/push_messaging/WebPushProvider.h

Issue 1302833004: [PushMessaging] Use appopriate type parameters for WebCallbacks (3/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/push_messaging/WebPushProvider.h
diff --git a/public/platform/modules/push_messaging/WebPushProvider.h b/public/platform/modules/push_messaging/WebPushProvider.h
index 1e9494ef07b55fd5e5b170c60518d452427ea995..5de2f8aaae5c625d40bb2b64b7f3d030c86fa0cc 100644
--- a/public/platform/modules/push_messaging/WebPushProvider.h
+++ b/public/platform/modules/push_messaging/WebPushProvider.h
@@ -7,43 +7,17 @@
#include "public/platform/WebCallbacks.h"
#include "public/platform/WebPassOwnPtr.h"
-#include "public/platform/modules/push_messaging/WebPushError.h"
#include "public/platform/modules/push_messaging/WebPushPermissionStatus.h"
#include "public/platform/modules/push_messaging/WebPushSubscription.h"
namespace blink {
class WebServiceWorkerRegistration;
+struct WebPushError;
struct WebPushSubscriptionOptions;
-class WebPushSubscriptionCallbacks : public WebCallbacks<WebPassOwnPtr<WebPushSubscription>, const WebPushError&> {
-public:
- void onSuccess(WebPushSubscription* r)
- {
- onSuccess(adoptWebPtr(r));
- }
- void onError(WebPushError* e)
- {
- onError(*e);
- delete e;
- }
- void onSuccess(WebPassOwnPtr<WebPushSubscription>) override {}
- void onError(const WebPushError&) override {}
-};
-class WebPushPermissionStatusCallbacks : public WebCallbacks<WebPushPermissionStatus, const WebPushError&> {
-public:
- void onSuccess(WebPushPermissionStatus* r)
- {
- onSuccess(*r);
- }
- void onError(WebPushError* e)
- {
- onError(*e);
- delete e;
- }
- void onSuccess(WebPushPermissionStatus) override {}
- void onError(const WebPushError&) override {}
-};
+using WebPushSubscriptionCallbacks = WebCallbacks<WebPassOwnPtr<WebPushSubscription>, const WebPushError&>;
+using WebPushPermissionStatusCallbacks = WebCallbacks<WebPushPermissionStatus, const WebPushError&>;
using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>;
class WebPushProvider {
« 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