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

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

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Fix typo breaking a bunch of trybot builds, oops Created 4 years, 1 month 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.cc
diff --git a/content/child/push_messaging/push_provider.cc b/content/child/push_messaging/push_provider.cc
index 0a92c28296023fea558a33872130d4065af5a36c..309053a77eeec0c333e18f144a705403dcec7ed3 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -107,7 +107,9 @@ void PushProvider::subscribe(
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- subscription_callbacks_.AddWithID(callbacks, request_id);
+ subscription_callbacks_.AddWithID(
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks>(callbacks),
+ request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
PushSubscriptionOptions content_options;
@@ -128,7 +130,9 @@ void PushProvider::unsubscribe(
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- unsubscribe_callbacks_.AddWithID(callbacks, request_id);
+ unsubscribe_callbacks_.AddWithID(
+ std::unique_ptr<blink::WebPushUnsubscribeCallbacks>(callbacks),
+ request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
@@ -142,7 +146,9 @@ void PushProvider::getSubscription(
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- subscription_callbacks_.AddWithID(callbacks, request_id);
+ subscription_callbacks_.AddWithID(
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks>(callbacks),
+ request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetSubscription(
@@ -156,7 +162,9 @@ void PushProvider::getPermissionStatus(
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- permission_status_callbacks_.AddWithID(callbacks, request_id);
+ permission_status_callbacks_.AddWithID(
+ std::unique_ptr<blink::WebPushPermissionStatusCallbacks>(callbacks),
+ request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetPermissionStatus(

Powered by Google App Engine
This is Rietveld 408576698