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

Unified Diff: content/browser/cache_storage/cache_storage_dispatcher_host.cc

Issue 2315253002: [CacheStorage] Sort QueryCache results by time entered into cache (Closed)
Patch Set: Address comments from PS5 Created 4 years, 3 months 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/browser/cache_storage/cache_storage_dispatcher_host.cc
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
index 895eebc05389c5367628523139285b4bb0b7d7b0..04138969b4af9321055adf4c535165e1b58b282c 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -459,7 +459,7 @@ void CacheStorageDispatcherHost::OnCacheMatchAllCallbackAdapter(
DCHECK(response);
responses->push_back(*response);
if (blob_data_handle)
- blob_data_handles->push_back(*blob_data_handle);
+ blob_data_handles->push_back(std::move(blob_data_handle));
}
OnCacheMatchAllCallback(thread_id, request_id, std::move(cache_handle), error,
std::move(responses), std::move(blob_data_handles));
@@ -478,8 +478,10 @@ void CacheStorageDispatcherHost::OnCacheMatchAllCallback(
return;
}
- for (const storage::BlobDataHandle& handle : *blob_data_handles)
- StoreBlobDataHandle(handle);
+ for (const auto& handle : *blob_data_handles) {
+ if (handle)
+ StoreBlobDataHandle(*handle);
+ }
Send(new CacheStorageMsg_CacheMatchAllSuccess(thread_id, request_id,
*responses));
@@ -497,16 +499,7 @@ void CacheStorageDispatcherHost::OnCacheKeysCallback(
return;
}
- CacheStorageCache::Requests out;
-
- for (CacheStorageCache::Requests::const_iterator it = requests->begin();
- it != requests->end(); ++it) {
- ServiceWorkerFetchRequest request(it->url, it->method, it->headers,
- it->referrer, it->is_reload);
- out.push_back(request);
- }
-
- Send(new CacheStorageMsg_CacheKeysSuccess(thread_id, request_id, out));
+ Send(new CacheStorageMsg_CacheKeysSuccess(thread_id, request_id, *requests));
}
void CacheStorageDispatcherHost::OnCacheBatchCallback(

Powered by Google App Engine
This is Rietveld 408576698