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

Unified Diff: net/disk_cache/entry_impl.cc

Issue 42682: Disk Cache: Second pass (and final) to allow multiple instances... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « net/disk_cache/backend_impl.cc ('k') | net/disk_cache/eviction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/entry_impl.cc
===================================================================
--- net/disk_cache/entry_impl.cc (revision 12629)
+++ net/disk_cache/entry_impl.cc (working copy)
@@ -11,6 +11,7 @@
#include "net/base/net_errors.h"
#include "net/disk_cache/backend_impl.h"
#include "net/disk_cache/cache_util.h"
+#include "net/disk_cache/histogram_macros.h"
using base::Time;
using base::TimeDelta;
@@ -208,7 +209,8 @@
// Complete the operation locally.
DCHECK(kMaxBlockSize >= offset + buf_len);
memcpy(buf->data() , user_buffers_[index].get() + offset, buf_len);
- stats.AddTime(Time::Now() - start);
+ if (backend_->cache_type() == net::DISK_CACHE)
+ stats.AddTime(Time::Now() - start);
return buf_len;
}
@@ -240,7 +242,8 @@
if (io_callback && completed)
io_callback->Discard();
- stats.AddTime(Time::Now() - start);
+ if (backend_->cache_type() == net::DISK_CACHE)
+ stats.AddTime(Time::Now() - start);
return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING;
}
@@ -309,7 +312,8 @@
DCHECK(kMaxBlockSize >= offset + buf_len);
memcpy(user_buffers_[index].get() + offset, buf->data(), buf_len);
- stats.AddTime(Time::Now() - start);
+ if (backend_->cache_type() == net::DISK_CACHE)
+ stats.AddTime(Time::Now() - start);
return buf_len;
}
@@ -345,7 +349,8 @@
if (io_callback && completed)
io_callback->Discard();
- stats.AddTime(Time::Now() - start);
+ if (backend_->cache_type() == net::DISK_CACHE)
+ stats.AddTime(Time::Now() - start);
return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING;
}
@@ -458,9 +463,9 @@
DCHECK(doomed_ || !everything);
if (GetDataSize(0))
- UMA_HISTOGRAM_COUNTS("DiskCache.DeleteHeader", GetDataSize(0));
+ CACHE_UMA(COUNTS, "DeleteHeader", 0, GetDataSize(0));
if (GetDataSize(1))
- UMA_HISTOGRAM_COUNTS("DiskCache.DeleteData", GetDataSize(1));
+ CACHE_UMA(COUNTS, "DeleteData", 0, GetDataSize(1));
for (int index = 0; index < NUM_STREAMS; index++) {
Addr address(entry_.Data()->data_addr[index]);
if (address.is_initialized()) {
@@ -617,7 +622,7 @@
files_[index] = NULL; // Releases the object.
if (!DeleteCacheFile(backend_->GetFileName(address))) {
- UMA_HISTOGRAM_COUNTS("DiskCache.DeleteFailed", 1);
+ CACHE_UMA(COUNTS, "DeleteFailed", 0, 1);
LOG(ERROR) << "Failed to delete " << backend_->GetFileName(address) <<
" from the cache.";
}
« no previous file with comments | « net/disk_cache/backend_impl.cc ('k') | net/disk_cache/eviction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698