From 778cb2f49af834951ab17e95c9143c313e5bf1a2 Mon Sep 17 00:00:00 2001 From: "evanm@google.com" Date: Fri, 21 Nov 2008 21:27:45 +0000 Subject: 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 --- base/stats_counters.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'base/stats_counters.h') 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) { -- cgit v1.1