| Index: content/renderer/cache_storage/cache_storage_dispatcher.cc
|
| diff --git a/content/renderer/cache_storage/cache_storage_dispatcher.cc b/content/renderer/cache_storage/cache_storage_dispatcher.cc
|
| index ffa2e98d9a23a10a31bafa9ef292d1a4ecff87c6..3d2f38dcd05b5e511444aa2903bd57b44516449b 100644
|
| --- a/content/renderer/cache_storage/cache_storage_dispatcher.cc
|
| +++ b/content/renderer/cache_storage/cache_storage_dispatcher.cc
|
| @@ -7,6 +7,7 @@
|
| #include <stddef.h>
|
|
|
| #include <map>
|
| +#include <memory>
|
| #include <string>
|
| #include <utility>
|
|
|
| @@ -515,7 +516,9 @@ void CacheStorageDispatcher::dispatchHas(
|
| WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks,
|
| const url::Origin& origin,
|
| const blink::WebString& cacheName) {
|
| - int request_id = has_callbacks_.Add(callbacks);
|
| + int request_id = has_callbacks_.Add(
|
| + std::unique_ptr<WebServiceWorkerCacheStorage::CacheStorageCallbacks>(
|
| + callbacks));
|
| has_times_[request_id] = base::TimeTicks::Now();
|
| Send(new CacheStorageHostMsg_CacheStorageHas(CurrentWorkerId(), request_id,
|
| origin, cacheName));
|
| @@ -525,7 +528,10 @@ void CacheStorageDispatcher::dispatchOpen(
|
| WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks* callbacks,
|
| const url::Origin& origin,
|
| const blink::WebString& cacheName) {
|
| - int request_id = open_callbacks_.Add(callbacks);
|
| + int request_id = open_callbacks_.Add(
|
| + std::unique_ptr<
|
| + WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks>(
|
| + callbacks));
|
| open_times_[request_id] = base::TimeTicks::Now();
|
| Send(new CacheStorageHostMsg_CacheStorageOpen(CurrentWorkerId(), request_id,
|
| origin, cacheName));
|
| @@ -535,7 +541,9 @@ void CacheStorageDispatcher::dispatchDelete(
|
| WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks,
|
| const url::Origin& origin,
|
| const blink::WebString& cacheName) {
|
| - int request_id = delete_callbacks_.Add(callbacks);
|
| + int request_id = delete_callbacks_.Add(
|
| + std::unique_ptr<WebServiceWorkerCacheStorage::CacheStorageCallbacks>(
|
| + callbacks));
|
| delete_times_[request_id] = base::TimeTicks::Now();
|
| Send(new CacheStorageHostMsg_CacheStorageDelete(CurrentWorkerId(), request_id,
|
| origin, cacheName));
|
| @@ -544,7 +552,9 @@ void CacheStorageDispatcher::dispatchDelete(
|
| void CacheStorageDispatcher::dispatchKeys(
|
| WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks* callbacks,
|
| const url::Origin& origin) {
|
| - int request_id = keys_callbacks_.Add(callbacks);
|
| + int request_id = keys_callbacks_.Add(
|
| + std::unique_ptr<WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks>(
|
| + callbacks));
|
| keys_times_[request_id] = base::TimeTicks::Now();
|
| Send(new CacheStorageHostMsg_CacheStorageKeys(CurrentWorkerId(), request_id,
|
| origin));
|
| @@ -555,7 +565,9 @@ void CacheStorageDispatcher::dispatchMatch(
|
| const url::Origin& origin,
|
| const blink::WebServiceWorkerRequest& request,
|
| const blink::WebServiceWorkerCache::QueryParams& query_params) {
|
| - int request_id = match_callbacks_.Add(callbacks);
|
| + int request_id = match_callbacks_.Add(
|
| + std::unique_ptr<WebServiceWorkerCacheStorage::CacheStorageMatchCallbacks>(
|
| + callbacks));
|
| match_times_[request_id] = base::TimeTicks::Now();
|
| Send(new CacheStorageHostMsg_CacheStorageMatch(
|
| CurrentWorkerId(), request_id, origin,
|
| @@ -568,7 +580,9 @@ void CacheStorageDispatcher::dispatchMatchForCache(
|
| blink::WebServiceWorkerCache::CacheMatchCallbacks* callbacks,
|
| const blink::WebServiceWorkerRequest& request,
|
| const blink::WebServiceWorkerCache::QueryParams& query_params) {
|
| - int request_id = cache_match_callbacks_.Add(callbacks);
|
| + int request_id = cache_match_callbacks_.Add(
|
| + std::unique_ptr<blink::WebServiceWorkerCache::CacheMatchCallbacks>(
|
| + callbacks));
|
| cache_match_times_[request_id] = base::TimeTicks::Now();
|
|
|
| Send(new CacheStorageHostMsg_CacheMatch(
|
| @@ -582,7 +596,10 @@ void CacheStorageDispatcher::dispatchMatchAllForCache(
|
| blink::WebServiceWorkerCache::CacheWithResponsesCallbacks* callbacks,
|
| const blink::WebServiceWorkerRequest& request,
|
| const blink::WebServiceWorkerCache::QueryParams& query_params) {
|
| - int request_id = cache_match_all_callbacks_.Add(callbacks);
|
| + int request_id = cache_match_all_callbacks_.Add(
|
| + std::unique_ptr<
|
| + blink::WebServiceWorkerCache::CacheWithResponsesCallbacks>(
|
| + callbacks));
|
| cache_match_all_times_[request_id] = base::TimeTicks::Now();
|
|
|
| Send(new CacheStorageHostMsg_CacheMatchAll(
|
| @@ -596,7 +613,9 @@ void CacheStorageDispatcher::dispatchKeysForCache(
|
| blink::WebServiceWorkerCache::CacheWithRequestsCallbacks* callbacks,
|
| const blink::WebServiceWorkerRequest& request,
|
| const blink::WebServiceWorkerCache::QueryParams& query_params) {
|
| - int request_id = cache_keys_callbacks_.Add(callbacks);
|
| + int request_id = cache_keys_callbacks_.Add(
|
| + std::unique_ptr<blink::WebServiceWorkerCache::CacheWithRequestsCallbacks>(
|
| + callbacks));
|
| cache_keys_times_[request_id] = base::TimeTicks::Now();
|
|
|
| Send(new CacheStorageHostMsg_CacheKeys(
|
| @@ -610,7 +629,9 @@ void CacheStorageDispatcher::dispatchBatchForCache(
|
| blink::WebServiceWorkerCache::CacheBatchCallbacks* callbacks,
|
| const blink::WebVector<blink::WebServiceWorkerCache::BatchOperation>&
|
| web_operations) {
|
| - int request_id = cache_batch_callbacks_.Add(callbacks);
|
| + int request_id = cache_batch_callbacks_.Add(
|
| + std::unique_ptr<blink::WebServiceWorkerCache::CacheBatchCallbacks>(
|
| + callbacks));
|
| cache_batch_times_[request_id] = base::TimeTicks::Now();
|
|
|
| std::vector<CacheStorageBatchOperation> operations;
|
|
|