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

Side by Side Diff: net/disk_cache/blockfile/backend_impl.cc

Issue 2661333002: Track SimpleCache memory usage in net/ MemoryDumpProvider (Closed)
Patch Set: address comments Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/disk_cache/blockfile/backend_impl.h" 5 #include "net/disk_cache/blockfile/backend_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 item.second = "Blockfile Cache"; 1326 item.second = "Blockfile Cache";
1327 stats->push_back(item); 1327 stats->push_back(item);
1328 1328
1329 stats_.GetItems(stats); 1329 stats_.GetItems(stats);
1330 } 1330 }
1331 1331
1332 void BackendImpl::OnExternalCacheHit(const std::string& key) { 1332 void BackendImpl::OnExternalCacheHit(const std::string& key) {
1333 background_queue_.OnExternalCacheHit(key); 1333 background_queue_.OnExternalCacheHit(key);
1334 } 1334 }
1335 1335
1336 size_t BackendImpl::EstimateMemoryUsage() const {
1337 // TODO(xunjieli): Implement this. crbug.com/669108.
1338 return 0;
1339 }
1340
1336 // ------------------------------------------------------------------------ 1341 // ------------------------------------------------------------------------
1337 1342
1338 // We just created a new file so we're going to write the header and set the 1343 // We just created a new file so we're going to write the header and set the
1339 // file length to include the hash table (zero filled). 1344 // file length to include the hash table (zero filled).
1340 bool BackendImpl::CreateBackingStore(disk_cache::File* file) { 1345 bool BackendImpl::CreateBackingStore(disk_cache::File* file) {
1341 AdjustMaxCacheSize(0); 1346 AdjustMaxCacheSize(0);
1342 1347
1343 IndexHeader header; 1348 IndexHeader header;
1344 header.table_len = DesiredIndexTableLen(max_size_); 1349 header.table_len = DesiredIndexTableLen(max_size_);
1345 1350
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2114 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2110 total_memory = kMaxBuffersSize; 2115 total_memory = kMaxBuffersSize;
2111 2116
2112 done = true; 2117 done = true;
2113 } 2118 }
2114 2119
2115 return static_cast<int>(total_memory); 2120 return static_cast<int>(total_memory);
2116 } 2121 }
2117 2122
2118 } // namespace disk_cache 2123 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698