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

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

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Make changes requested by danakj, fix a few more headers 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
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/child/quota_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f8dc6a2177fea7340b87d21fa83c641bb019f7ee..487af173e45877da0d302676932642516f121ac1 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -5,6 +5,7 @@
#include "content/child/push_messaging/push_provider.h"
#include <memory>
+#include <utility>
#include "base/lazy_instance.h"
#include "base/memory/ptr_util.h"
@@ -103,11 +104,11 @@ void PushProvider::WillStopCurrentWorkerThread() {
void PushProvider::subscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
const blink::WebPushSubscriptionOptions& options,
- blink::WebPushSubscriptionCallbacks* callbacks) {
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- subscription_callbacks_.AddWithID(callbacks, request_id);
+ subscription_callbacks_.AddWithID(std::move(callbacks), request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
PushSubscriptionOptions content_options;
@@ -123,13 +124,12 @@ void PushProvider::subscribe(
void PushProvider::unsubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
- blink::WebPushUnsubscribeCallbacks* callbacks) {
+ std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- unsubscribe_callbacks_.AddWithID(callbacks, request_id);
-
+ unsubscribe_callbacks_.AddWithID(std::move(callbacks), request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_Unsubscribe(
@@ -138,11 +138,11 @@ void PushProvider::unsubscribe(
void PushProvider::getSubscription(
blink::WebServiceWorkerRegistration* service_worker_registration,
- blink::WebPushSubscriptionCallbacks* callbacks) {
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) {
DCHECK(service_worker_registration);
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
- subscription_callbacks_.AddWithID(callbacks, request_id);
+ subscription_callbacks_.AddWithID(std::move(callbacks), request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetSubscription(
@@ -152,11 +152,11 @@ void PushProvider::getSubscription(
void PushProvider::getPermissionStatus(
blink::WebServiceWorkerRegistration* service_worker_registration,
const blink::WebPushSubscriptionOptions& options,
- blink::WebPushPermissionStatusCallbacks* callbacks) {
+ std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks) {
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::move(callbacks), request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetPermissionStatus(
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/child/quota_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698