summaryrefslogtreecommitdiffstats
path: root/base/stats_counters.h
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 21:27:45 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 21:27:45 +0000
commit778cb2f49af834951ab17e95c9143c313e5bf1a2 (patch)
tree8d3c27c95cb8dcd0fd43576fe2a5d85793c11279 /base/stats_counters.h
parenta0dde12f2e4f92f1a59885c45cfecd10dbfdfdfd (diff)
downloadchromium_src-778cb2f49af834951ab17e95c9143c313e5bf1a2.zip
chromium_src-778cb2f49af834951ab17e95c9143c313e5bf1a2.tar.gz
chromium_src-778cb2f49af834951ab17e95c9143c313e5bf1a2.tar.bz2
Rollback "Remove use of wide characters in stats table identifiers."
This reverts commit r5847. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/stats_counters.h')
-rw-r--r--base/stats_counters.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/base/stats_counters.h b/base/stats_counters.h
index 9927c19..5dc7b89c 100644
--- a/base/stats_counters.h
+++ b/base/stats_counters.h
@@ -74,10 +74,10 @@
class StatsCounter {
public:
// Create a StatsCounter object.
- explicit StatsCounter(const std::string& name)
+ explicit StatsCounter(const std::wstring& name)
: counter_id_(-1) {
// We prepend the name with 'c:' to indicate that it is a counter.
- name_ = "c:";
+ name_ = L"c:";
name_.append(name);
};
@@ -146,7 +146,7 @@ class StatsCounter {
if (counter_id_ == -1) {
counter_id_ = table->FindCounter(name_);
if (table->GetSlot() == 0) {
- if (!table->RegisterThread("")) {
+ if (!table->RegisterThread(L"")) {
// There is no room for this thread. This thread
// cannot use counters.
counter_id_ = 0;
@@ -163,7 +163,7 @@ class StatsCounter {
return NULL;
}
- std::string name_;
+ std::wstring name_;
// The counter id in the table. We initialize to -1 (an invalid value)
// and then cache it once it has been looked up. The counter_id is
// valid across all threads and processes.
@@ -177,9 +177,9 @@ class StatsCounter {
class StatsCounterTimer : protected StatsCounter {
public:
// Constructs and starts the timer.
- explicit StatsCounterTimer(const std::string& name) {
+ explicit StatsCounterTimer(const std::wstring& name) {
// we prepend the name with 't:' to indicate that it is a timer.
- name_ = "t:";
+ name_ = L"t:";
name_.append(name);
}
@@ -230,10 +230,10 @@ class StatsCounterTimer : protected StatsCounter {
class StatsRate : public StatsCounterTimer {
public:
// Constructs and starts the timer.
- explicit StatsRate(const char* name)
+ explicit StatsRate(const wchar_t* name)
: StatsCounterTimer(name),
counter_(name),
- largest_add_(std::string(" ").append(name).append("MAX").c_str()) {
+ largest_add_(std::wstring(L" ").append(name).append(L"MAX").c_str()) {
}
virtual void Add(int value) {