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

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: 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
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..bc44c2c849badb5718fef915caa95dbb01df48c6 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 getPermissionStatus(blink::WebServiceWorkerRegistration*,
+ blink::WebPushPermissionStatusCallbacks*);
+ virtual void unregister(blink::WebServiceWorkerRegistration*,
+ blink::WebPushUnregisterCallbacks*);
// Called by the PushDispatcher.
bool OnMessageReceived(const IPC::Message& message);
@@ -54,6 +57,10 @@ class PushProvider : public blink::WebPushProvider,
void OnGetPermissionStatusSuccess(int request_id,
blink::WebPushPermissionStatus status);
void OnGetPermissionStatusError(int request_id);
+ void OnUnregisterSuccess(int request_id, bool did_unregister);
+ void OnUnregisterError(int request_id,
+ blink::WebPushError::ErrorType error_type,
+ const std::string& error_message);
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
scoped_refptr<PushDispatcher> push_dispatcher_;
@@ -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);
};

Powered by Google App Engine
This is Rietveld 408576698