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

Unified Diff: content/renderer/push_messaging/push_messaging_dispatcher.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/renderer/push_messaging/push_messaging_dispatcher.cc
diff --git a/content/renderer/push_messaging/push_messaging_dispatcher.cc b/content/renderer/push_messaging/push_messaging_dispatcher.cc
index c1b6b381e2f447721c3f1a859277bc550dbe9e1e..cbb7d2308878f37a27fe5d6ae35241a7cc180de6 100644
--- a/content/renderer/push_messaging/push_messaging_dispatcher.cc
+++ b/content/renderer/push_messaging/push_messaging_dispatcher.cc
@@ -4,6 +4,8 @@
#include "content/renderer/push_messaging/push_messaging_dispatcher.h"
+#include <memory>
+
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/child/push_messaging/push_provider.h"
@@ -78,7 +80,8 @@ void PushMessagingDispatcher::DidGetManifest(
// Get the sender_info from the manifest since it wasn't provided by
// the caller.
if (manifest.IsEmpty()) {
- int request_id = subscription_callbacks_.Add(callbacks);
+ int request_id = subscription_callbacks_.Add(
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks>(callbacks));
OnSubscribeFromDocumentError(
request_id, PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING);
return;
@@ -98,7 +101,8 @@ void PushMessagingDispatcher::DoSubscribe(
blink::WebServiceWorkerRegistration* service_worker_registration,
const PushSubscriptionOptions& options,
blink::WebPushSubscriptionCallbacks* callbacks) {
- int request_id = subscription_callbacks_.Add(callbacks);
+ int request_id = subscription_callbacks_.Add(
+ std::unique_ptr<blink::WebPushSubscriptionCallbacks>(callbacks));
int64_t service_worker_registration_id =
static_cast<WebServiceWorkerRegistrationImpl*>(
service_worker_registration)

Powered by Google App Engine
This is Rietveld 408576698