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

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: browsertests and override fix 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 313a304a5cbdb1dd661ab40684b0b715afb1ba2a..996258e384a85a4bce680a85fd35e082b57cd758 100644
--- a/content/child/push_messaging/push_provider.h
+++ b/content/child/push_messaging/push_provider.h
@@ -33,10 +33,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);
@@ -53,6 +55,7 @@ class PushProvider : public blink::WebPushProvider,
void OnGetPermissionStatusSuccess(int request_id,
blink::WebPushPermissionStatus status);
void OnGetPermissionStatusError(int request_id);
+ void OnUnregisterResponse(int request_id, bool response);
Michael van Ouwerkerk 2014/12/12 13:55:41 nit: consider renaming |response| to something mor
mlamouri (slow - plz ping) 2014/12/15 11:29:37 Done.
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
scoped_refptr<PushDispatcher> push_dispatcher_;
@@ -66,6 +69,10 @@ class PushProvider : public blink::WebPushProvider,
std::map<int, blink::WebPushPermissionStatusCallbacks*>
permission_status_callbacks_;
+ // Stores the unregistration callbacks with their request ids. This class owns
+ // the callbacks.
+ std::map<int, blink::WebPushUnregisterCallbacks*> unregister_callbacks_;
Michael van Ouwerkerk 2014/12/12 13:55:41 Aha, leaking a whole map of raw pointers, just lik
mlamouri (slow - plz ping) 2014/12/15 11:29:37 Yeah. Right. I usually use IDMap<> and have it own
+
DISALLOW_COPY_AND_ASSIGN(PushProvider);
};

Powered by Google App Engine
This is Rietveld 408576698