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

Unified Diff: content/child/push_messaging/push_provider.h

Issue 793403002: Implement WebPushProvider.unregister() in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mvan_2
Patch Set: jochen review comments Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/push_messaging/push_dispatcher.cc ('k') | content/child/push_messaging/push_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/push_messaging/push_provider.h
diff --git a/content/child/push_messaging/push_provider.h b/content/child/push_messaging/push_provider.h
index 0c81d60a47608071e59c8d6d67a4edc81e61d058..e1c8ca586fa62ba793ae65d8fef688d4db4b9924 100644
--- a/content/child/push_messaging/push_provider.h
+++ b/content/child/push_messaging/push_provider.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "content/child/push_messaging/push_dispatcher.h"
#include "content/child/worker_task_runner.h"
+#include "third_party/WebKit/public/platform/WebPushError.h"
#include "third_party/WebKit/public/platform/WebPushProvider.h"
class GURL;
@@ -34,10 +35,12 @@ class PushProvider : public blink::WebPushProvider,
void OnWorkerRunLoopStopped() override;
// blink::WebPushProvider implementation.
- void registerPushMessaging(blink::WebServiceWorkerRegistration*,
- blink::WebPushRegistrationCallbacks*) override;
- void getPermissionStatus(blink::WebServiceWorkerRegistration*,
- blink::WebPushPermissionStatusCallbacks*) override;
+ virtual void registerPushMessaging(blink::WebServiceWorkerRegistration*,
+ blink::WebPushRegistrationCallbacks*);
+ virtual void unregister(blink::WebServiceWorkerRegistration*,
+ blink::WebPushUnregisterCallbacks*);
+ virtual void getPermissionStatus(blink::WebServiceWorkerRegistration*,
+ blink::WebPushPermissionStatusCallbacks*);
// Called by the PushDispatcher.
bool OnMessageReceived(const IPC::Message& message);
@@ -51,6 +54,10 @@ class PushProvider : public blink::WebPushProvider,
const GURL& endpoint,
const std::string& registration_id);
void OnRegisterFromWorkerError(int request_id, PushRegistrationStatus status);
+ void OnUnregisterSuccess(int request_id, bool did_unregister);
+ void OnUnregisterError(int request_id,
+ blink::WebPushError::ErrorType error_type,
+ const std::string& error_message);
void OnGetPermissionStatusSuccess(int request_id,
blink::WebPushPermissionStatus status);
void OnGetPermissionStatusError(int request_id);
@@ -68,6 +75,11 @@ class PushProvider : public blink::WebPushProvider,
IDMap<blink::WebPushPermissionStatusCallbacks, IDMapOwnPointer>
permission_status_callbacks_;
+ // Stores the unregistration callbacks with their request ids. This class owns
+ // the callbacks.
+ IDMap<blink::WebPushUnregisterCallbacks, IDMapOwnPointer>
+ unregister_callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(PushProvider);
};
« no previous file with comments | « content/child/push_messaging/push_dispatcher.cc ('k') | content/child/push_messaging/push_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698