| 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,
|
|
|