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

Unified Diff: net/disk_cache/block_files.cc

Issue 650068: Disk cache: Use TimeTicks instead of Time for some of the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 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/entry_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/block_files.cc
===================================================================
--- net/disk_cache/block_files.cc (revision 39154)
+++ net/disk_cache/block_files.cc (working copy)
@@ -12,6 +12,7 @@
#include "net/disk_cache/file_lock.h"
using base::Time;
+using base::TimeTicks;
namespace {
@@ -41,7 +42,7 @@
return false;
}
- Time start = Time::Now();
+ TimeTicks start = TimeTicks::Now();
// We are going to process the map on 32-block chunks (32 bits), and on every
// chunk, iterate through the 8 nibbles where the new block can be located.
int current = header->hints[target - 1];
@@ -67,7 +68,7 @@
if (target != size) {
header->empty[target - size - 1]++;
}
- HISTOGRAM_TIMES("DiskCache.CreateBlock", Time::Now() - start);
+ HISTOGRAM_TIMES("DiskCache.CreateBlock", TimeTicks::Now() - start);
return true;
}
}
@@ -86,7 +87,7 @@
NOTREACHED();
return;
}
- Time start = Time::Now();
+ TimeTicks start = TimeTicks::Now();
int byte_index = index / 8;
uint8* byte_map = reinterpret_cast<uint8*>(header->allocation_map);
uint8 map_block = byte_map[byte_index];
@@ -115,7 +116,7 @@
}
header->num_entries--;
DCHECK(header->num_entries >= 0);
- HISTOGRAM_TIMES("DiskCache.DeleteBlock", Time::Now() - start);
+ HISTOGRAM_TIMES("DiskCache.DeleteBlock", TimeTicks::Now() - start);
}
// Restores the "empty counters" and allocation hints.
@@ -314,7 +315,7 @@
MappedFile* file = block_files_[block_type - 1];
BlockFileHeader* header = reinterpret_cast<BlockFileHeader*>(file->buffer());
- Time start = Time::Now();
+ TimeTicks start = TimeTicks::Now();
while (NeedToGrowBlockFile(header, block_count)) {
if (kMaxBlocks == header->max_entries) {
file = NextFile(file);
@@ -328,7 +329,7 @@
return NULL;
break;
}
- HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", Time::Now() - start);
+ HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", TimeTicks::Now() - start);
return file;
}
« no previous file with comments | « net/disk_cache/backend_impl.cc ('k') | net/disk_cache/entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698