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

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

Issue 28046: Use string for Histogram names since these are all ASCII anyway wide-characte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/rankings.cc ('k') | net/disk_cache/stats_histogram.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/stats.h" 5 #include "net/disk_cache/stats.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/disk_cache/backend_impl.h" 9 #include "net/disk_cache/backend_impl.h"
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (!CreateStats(backend, &address, &stats)) 116 if (!CreateStats(backend, &address, &stats))
117 return false; 117 return false;
118 *storage_addr = address.value(); 118 *storage_addr = address.value();
119 } 119 }
120 120
121 storage_addr_ = address.value(); 121 storage_addr_ = address.value();
122 backend_ = backend; 122 backend_ = backend;
123 if (!size_histogram_.get()) { 123 if (!size_histogram_.get()) {
124 // Stats may be reused when the cache is re-created, but we want only one 124 // Stats may be reused when the cache is re-created, but we want only one
125 // histogram at any given time. 125 // histogram at any given time.
126 size_histogram_.reset(new StatsHistogram(L"DiskCache.SizeStats")); 126 size_histogram_.reset(new StatsHistogram("DiskCache.SizeStats"));
127 size_histogram_->Init(this); 127 size_histogram_->Init(this);
128 } 128 }
129 129
130 memcpy(data_sizes_, stats.data_sizes, sizeof(data_sizes_)); 130 memcpy(data_sizes_, stats.data_sizes, sizeof(data_sizes_));
131 memcpy(counters_, stats.counters, sizeof(counters_)); 131 memcpy(counters_, stats.counters, sizeof(counters_));
132 132
133 return true; 133 return true;
134 } 134 }
135 135
136 Stats::~Stats() { 136 Stats::~Stats() {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 260 }
261 261
262 for (int i = MIN_COUNTER + 1; i < MAX_COUNTER; i++) { 262 for (int i = MIN_COUNTER + 1; i < MAX_COUNTER; i++) {
263 item.first = kCounterNames[i]; 263 item.first = kCounterNames[i];
264 item.second = StringPrintf("0x%I64x", counters_[i]); 264 item.second = StringPrintf("0x%I64x", counters_[i]);
265 items->push_back(item); 265 items->push_back(item);
266 } 266 }
267 } 267 }
268 268
269 } // namespace disk_cache 269 } // namespace disk_cache
270
OLDNEW
« no previous file with comments | « net/disk_cache/rankings.cc ('k') | net/disk_cache/stats_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698