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

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

Issue 10808047: Add HttpCache histograms focussed on blocking and transaction type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename parameter Created 8 years, 4 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 | Annotate | Revision Log
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/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 return CheckAllEntries(); 1316 return CheckAllEntries();
1317 } 1317 }
1318 1318
1319 void BackendImpl::FlushIndex() { 1319 void BackendImpl::FlushIndex() {
1320 if (index_ && !disabled_) 1320 if (index_ && !disabled_)
1321 index_->Flush(); 1321 index_->Flush();
1322 } 1322 }
1323 1323
1324 // ------------------------------------------------------------------------ 1324 // ------------------------------------------------------------------------
1325 1325
1326 net::CacheType BackendImpl::GetCacheType() const {
1327 return cache_type_;
1328 }
1329
1326 int32 BackendImpl::GetEntryCount() const { 1330 int32 BackendImpl::GetEntryCount() const {
1327 if (!index_ || disabled_) 1331 if (!index_ || disabled_)
1328 return 0; 1332 return 0;
1329 // num_entries includes entries already evicted. 1333 // num_entries includes entries already evicted.
1330 int32 not_deleted = data_->header.num_entries - 1334 int32 not_deleted = data_->header.num_entries -
1331 data_->header.lru.sizes[Rankings::DELETED]; 1335 data_->header.lru.sizes[Rankings::DELETED];
1332 1336
1333 if (not_deleted < 0) { 1337 if (not_deleted < 0) {
1334 NOTREACHED(); 1338 NOTREACHED();
1335 not_deleted = 0; 1339 not_deleted = 0;
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2202 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2199 total_memory = kMaxBuffersSize; 2203 total_memory = kMaxBuffersSize;
2200 2204
2201 done = true; 2205 done = true;
2202 } 2206 }
2203 2207
2204 return static_cast<int>(total_memory); 2208 return static_cast<int>(total_memory);
2205 } 2209 }
2206 2210
2207 } // namespace disk_cache 2211 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698