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

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/cache_storage/cache_storage_cache.h" 5 #include "content/browser/cache_storage/cache_storage_cache.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 UpdateCacheSize(); 1123 UpdateCacheSize();
1124 put_context->callback.Run(CACHE_STORAGE_OK); 1124 put_context->callback.Run(CACHE_STORAGE_OK);
1125 return; 1125 return;
1126 } 1126 }
1127 1127
1128 DCHECK(put_context->blob_data_handle); 1128 DCHECK(put_context->blob_data_handle);
1129 1129
1130 disk_cache::ScopedEntryPtr entry(std::move(put_context->cache_entry)); 1130 disk_cache::ScopedEntryPtr entry(std::move(put_context->cache_entry));
1131 put_context->cache_entry = NULL; 1131 put_context->cache_entry = NULL;
1132 1132
1133 BlobToDiskCacheIDMap::KeyType blob_to_cache_key =
1134 active_blob_to_disk_cache_writers_.Add(
1135 base::MakeUnique<CacheStorageBlobToDiskCache>());
1133 CacheStorageBlobToDiskCache* blob_to_cache = 1136 CacheStorageBlobToDiskCache* blob_to_cache =
1134 new CacheStorageBlobToDiskCache(); 1137 active_blob_to_disk_cache_writers_.Lookup(blob_to_cache_key);
danakj 2016/11/18 00:15:33 same
1135 BlobToDiskCacheIDMap::KeyType blob_to_cache_key =
1136 active_blob_to_disk_cache_writers_.Add(blob_to_cache);
1137 1138
1138 std::unique_ptr<storage::BlobDataHandle> blob_data_handle = 1139 std::unique_ptr<storage::BlobDataHandle> blob_data_handle =
1139 std::move(put_context->blob_data_handle); 1140 std::move(put_context->blob_data_handle);
1140 1141
1141 blob_to_cache->StreamBlobToCache( 1142 blob_to_cache->StreamBlobToCache(
1142 std::move(entry), INDEX_RESPONSE_BODY, request_context_getter_.get(), 1143 std::move(entry), INDEX_RESPONSE_BODY, request_context_getter_.get(),
1143 std::move(blob_data_handle), 1144 std::move(blob_data_handle),
1144 base::Bind(&CacheStorageCache::PutDidWriteBlobToCache, 1145 base::Bind(&CacheStorageCache::PutDidWriteBlobToCache,
1145 weak_ptr_factory_.GetWeakPtr(), 1146 weak_ptr_factory_.GetWeakPtr(),
1146 base::Passed(std::move(put_context)), blob_to_cache_key)); 1147 base::Passed(std::move(put_context)), blob_to_cache_key));
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA); 1443 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA);
1443 return blob_storage_context_->AddFinishedBlob(&blob_data); 1444 return blob_storage_context_->AddFinishedBlob(&blob_data);
1444 } 1445 }
1445 1446
1446 std::unique_ptr<CacheStorageCacheHandle> 1447 std::unique_ptr<CacheStorageCacheHandle>
1447 CacheStorageCache::CreateCacheHandle() { 1448 CacheStorageCache::CreateCacheHandle() {
1448 return cache_storage_->CreateCacheHandle(this); 1449 return cache_storage_->CreateCacheHandle(this);
1449 } 1450 }
1450 1451
1451 } // namespace content 1452 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698