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

Unified Diff: content/child/quota_dispatcher.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/quota_dispatcher.h ('k') | content/child/service_worker/service_worker_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/quota_dispatcher.cc
diff --git a/content/child/quota_dispatcher.cc b/content/child/quota_dispatcher.cc
index f61aa027fa3fd980cdd302d95a3483643f8010f4..730fb8a348b4d8dc6111c7ccb5e0a68cc141ff8d 100644
--- a/content/child/quota_dispatcher.cc
+++ b/content/child/quota_dispatcher.cc
@@ -4,8 +4,12 @@
#include "content/child/quota_dispatcher.h"
+#include <memory>
+#include <utility>
+
#include "base/lazy_instance.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/threading/thread_local.h"
#include "content/child/quota_message_filter.h"
#include "content/child/thread_safe_sender.h"
@@ -108,10 +112,10 @@ void QuotaDispatcher::OnMessageReceived(const IPC::Message& msg) {
void QuotaDispatcher::QueryStorageUsageAndQuota(
const GURL& origin_url,
StorageType type,
- Callback* callback) {
+ std::unique_ptr<Callback> callback) {
DCHECK(callback);
int request_id = quota_message_filter_->GenerateRequestID(CurrentWorkerId());
- pending_quota_callbacks_.AddWithID(callback, request_id);
+ pending_quota_callbacks_.AddWithID(std::move(callback), request_id);
thread_safe_sender_->Send(new QuotaHostMsg_QueryStorageUsageAndQuota(
request_id, origin_url, type));
}
@@ -120,11 +124,11 @@ void QuotaDispatcher::RequestStorageQuota(int render_view_id,
const GURL& origin_url,
StorageType type,
uint64_t requested_size,
- Callback* callback) {
+ std::unique_ptr<Callback> callback) {
DCHECK(callback);
DCHECK(CurrentWorkerId() == 0);
int request_id = quota_message_filter_->GenerateRequestID(CurrentWorkerId());
- pending_quota_callbacks_.AddWithID(callback, request_id);
+ pending_quota_callbacks_.AddWithID(std::move(callback), request_id);
StorageQuotaParams params;
params.render_view_id = render_view_id;
@@ -138,10 +142,10 @@ void QuotaDispatcher::RequestStorageQuota(int render_view_id,
}
// static
-QuotaDispatcher::Callback*
+std::unique_ptr<QuotaDispatcher::Callback>
QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(
blink::WebStorageQuotaCallbacks callbacks) {
- return new WebStorageQuotaDispatcherCallback(callbacks);
+ return base::MakeUnique<WebStorageQuotaDispatcherCallback>(callbacks);
}
void QuotaDispatcher::DidGrantStorageQuota(int request_id,
« no previous file with comments | « content/child/quota_dispatcher.h ('k') | content/child/service_worker/service_worker_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698