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

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: Make changes requested by danakj, fix a few more headers Created 4 years 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 UpdateCacheSize(); 1124 UpdateCacheSize();
1125 put_context->callback.Run(CACHE_STORAGE_OK); 1125 put_context->callback.Run(CACHE_STORAGE_OK);
1126 return; 1126 return;
1127 } 1127 }
1128 1128
1129 DCHECK(put_context->blob_data_handle); 1129 DCHECK(put_context->blob_data_handle);
1130 1130
1131 disk_cache::ScopedEntryPtr entry(std::move(put_context->cache_entry)); 1131 disk_cache::ScopedEntryPtr entry(std::move(put_context->cache_entry));
1132 put_context->cache_entry = NULL; 1132 put_context->cache_entry = NULL;
1133 1133
1134 CacheStorageBlobToDiskCache* blob_to_cache = 1134 auto blob_to_cache = base::MakeUnique<CacheStorageBlobToDiskCache>();
1135 new CacheStorageBlobToDiskCache(); 1135 CacheStorageBlobToDiskCache* blob_to_cache_raw = blob_to_cache.get();
1136 BlobToDiskCacheIDMap::KeyType blob_to_cache_key = 1136 BlobToDiskCacheIDMap::KeyType blob_to_cache_key =
1137 active_blob_to_disk_cache_writers_.Add(blob_to_cache); 1137 active_blob_to_disk_cache_writers_.Add(std::move(blob_to_cache));
1138 1138
1139 std::unique_ptr<storage::BlobDataHandle> blob_data_handle = 1139 std::unique_ptr<storage::BlobDataHandle> blob_data_handle =
1140 std::move(put_context->blob_data_handle); 1140 std::move(put_context->blob_data_handle);
1141 1141
1142 blob_to_cache->StreamBlobToCache( 1142 blob_to_cache_raw->StreamBlobToCache(
1143 std::move(entry), INDEX_RESPONSE_BODY, request_context_getter_.get(), 1143 std::move(entry), INDEX_RESPONSE_BODY, request_context_getter_.get(),
1144 std::move(blob_data_handle), 1144 std::move(blob_data_handle),
1145 base::Bind(&CacheStorageCache::PutDidWriteBlobToCache, 1145 base::Bind(&CacheStorageCache::PutDidWriteBlobToCache,
1146 weak_ptr_factory_.GetWeakPtr(), 1146 weak_ptr_factory_.GetWeakPtr(),
1147 base::Passed(std::move(put_context)), blob_to_cache_key)); 1147 base::Passed(std::move(put_context)), blob_to_cache_key));
1148 } 1148 }
1149 1149
1150 void CacheStorageCache::PutDidWriteBlobToCache( 1150 void CacheStorageCache::PutDidWriteBlobToCache(
1151 std::unique_ptr<PutContext> put_context, 1151 std::unique_ptr<PutContext> put_context,
1152 BlobToDiskCacheIDMap::KeyType blob_to_cache_key, 1152 BlobToDiskCacheIDMap::KeyType blob_to_cache_key,
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA); 1443 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA);
1444 return blob_storage_context_->AddFinishedBlob(&blob_data); 1444 return blob_storage_context_->AddFinishedBlob(&blob_data);
1445 } 1445 }
1446 1446
1447 std::unique_ptr<CacheStorageCacheHandle> 1447 std::unique_ptr<CacheStorageCacheHandle>
1448 CacheStorageCache::CreateCacheHandle() { 1448 CacheStorageCache::CreateCacheHandle() {
1449 return cache_storage_->CreateCacheHandle(this); 1449 return cache_storage_->CreateCacheHandle(this);
1450 } 1450 }
1451 1451
1452 } // namespace content 1452 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/mock_screen_orientation_client.cc ('k') | content/browser/manifest/manifest_manager_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698