diff options
48 files changed, 217 insertions, 235 deletions
diff --git a/base/histogram.cc b/base/histogram.cc index 173cf40..79e9497 100644 --- a/base/histogram.cc +++ b/base/histogram.cc @@ -23,10 +23,10 @@ typedef Histogram::Count Count; // static const int Histogram::kHexRangePrintingFlag = 0x8000; -Histogram::Histogram(const wchar_t* name, Sample minimum, +Histogram::Histogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count) - : StatsRate(WideToASCII(name).c_str()), - histogram_name_(WideToASCII(name)), + : StatsRate(name), + histogram_name_(name), declared_min_(minimum), declared_max_(maximum), bucket_count_(bucket_count), @@ -37,10 +37,10 @@ Histogram::Histogram(const wchar_t* name, Sample minimum, Initialize(); } -Histogram::Histogram(const wchar_t* name, TimeDelta minimum, +Histogram::Histogram(const char* name, TimeDelta minimum, TimeDelta maximum, size_t bucket_count) - : StatsRate(WideToASCII(name).c_str()), - histogram_name_(WideToASCII(name)), + : StatsRate(name), + histogram_name_(name), declared_min_(static_cast<int> (minimum.InMilliseconds())), declared_max_(static_cast<int> (maximum.InMilliseconds())), bucket_count_(bucket_count), @@ -415,14 +415,14 @@ void Histogram::SampleSet::Subtract(const SampleSet& other) { // buckets. //------------------------------------------------------------------------------ -LinearHistogram::LinearHistogram(const wchar_t* name, +LinearHistogram::LinearHistogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count) : Histogram(name, minimum >= 1 ? minimum : 1, maximum, bucket_count) { InitializeBucketRange(); DCHECK(ValidateBucketRanges()); } -LinearHistogram::LinearHistogram(const wchar_t* name, +LinearHistogram::LinearHistogram(const char* name, TimeDelta minimum, TimeDelta maximum, size_t bucket_count) : Histogram(name, minimum >= TimeDelta::FromMilliseconds(1) ? minimum : TimeDelta::FromMilliseconds(1), @@ -487,7 +487,7 @@ double LinearHistogram::GetBucketSize(Count current, size_t i) const { // This section provides implementation for ThreadSafeHistogram. //------------------------------------------------------------------------------ -ThreadSafeHistogram::ThreadSafeHistogram(const wchar_t* name, Sample minimum, +ThreadSafeHistogram::ThreadSafeHistogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count) : Histogram(name, minimum, maximum, bucket_count), lock_() { @@ -650,4 +650,3 @@ StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; Lock* StatisticsRecorder::lock_ = NULL; // static bool StatisticsRecorder::dump_on_exit_ = false; - diff --git a/base/histogram.h b/base/histogram.h index 624f80a..cf80c09 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -218,9 +218,9 @@ class Histogram : public StatsRate { }; //---------------------------------------------------------------------------- - Histogram(const wchar_t* name, Sample minimum, + Histogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count); - Histogram(const wchar_t* name, base::TimeDelta minimum, + Histogram(const char* name, base::TimeDelta minimum, base::TimeDelta maximum, size_t bucket_count); virtual ~Histogram(); @@ -357,9 +357,9 @@ class LinearHistogram : public Histogram { Sample sample; const char* description; // Null means end of a list of pairs. }; - LinearHistogram(const wchar_t* name, Sample minimum, + LinearHistogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count); - LinearHistogram(const wchar_t* name, base::TimeDelta minimum, + LinearHistogram(const char* name, base::TimeDelta minimum, base::TimeDelta maximum, size_t bucket_count); ~LinearHistogram() {} @@ -397,7 +397,7 @@ class LinearHistogram : public Histogram { // BooleanHistogram is a histogram for booleans. class BooleanHistogram : public LinearHistogram { public: - explicit BooleanHistogram(const wchar_t* name) + explicit BooleanHistogram(const char* name) : LinearHistogram(name, 0, 2, 3) { } @@ -413,7 +413,7 @@ class BooleanHistogram : public LinearHistogram { class ThreadSafeHistogram : public Histogram { public: - ThreadSafeHistogram(const wchar_t* name, Sample minimum, + ThreadSafeHistogram(const char* name, Sample minimum, Sample maximum, size_t bucket_count); // Provide the analog to Add() @@ -485,4 +485,3 @@ class StatisticsRecorder { }; #endif // BASE_HISTOGRAM_H__ - diff --git a/base/histogram_unittest.cc b/base/histogram_unittest.cc index 7085f97..b54ad7f 100644 --- a/base/histogram_unittest.cc +++ b/base/histogram_unittest.cc @@ -20,20 +20,20 @@ class HistogramTest : public testing::Test { // Check for basic syntax and use. TEST(HistogramTest, StartupShutdownTest) { // Try basic construction - Histogram histogram(L"TestHistogram", 1, 1000, 10); - Histogram histogram1(L"Test1Histogram", 1, 1000, 10); + Histogram histogram("TestHistogram", 1, 1000, 10); + Histogram histogram1("Test1Histogram", 1, 1000, 10); - LinearHistogram linear_histogram(L"TestLinearHistogram", 1, 1000, 10); - LinearHistogram linear_histogram1(L"Test1LinearHistogram", 1, 1000, 10); + LinearHistogram linear_histogram("TestLinearHistogram", 1, 1000, 10); + LinearHistogram linear_histogram1("Test1LinearHistogram", 1, 1000, 10); // Use standard macros (but with fixed samples) - HISTOGRAM_TIMES(L"Test2Histogram", TimeDelta::FromDays(1)); - HISTOGRAM_COUNTS(L"Test3Histogram", 30); + HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1)); + HISTOGRAM_COUNTS("Test3Histogram", 30); - DHISTOGRAM_TIMES(L"Test4Histogram", TimeDelta::FromDays(1)); - DHISTOGRAM_COUNTS(L"Test5Histogram", 30); + DHISTOGRAM_TIMES("Test4Histogram", TimeDelta::FromDays(1)); + DHISTOGRAM_COUNTS("Test5Histogram", 30); - ASSET_HISTOGRAM_COUNTS(L"Test6Histogram", 129); + ASSET_HISTOGRAM_COUNTS("Test6Histogram", 129); // Try to construct samples. Histogram::SampleSet sample1; @@ -58,35 +58,35 @@ TEST(HistogramTest, RecordedStartupTest) { EXPECT_EQ(0U, histograms.size()); // Try basic construction - Histogram histogram(L"TestHistogram", 1, 1000, 10); + Histogram histogram("TestHistogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists EXPECT_EQ(1U, histograms.size()); - Histogram histogram1(L"Test1Histogram", 1, 1000, 10); + Histogram histogram1("Test1Histogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists EXPECT_EQ(2U, histograms.size()); - LinearHistogram linear_histogram(L"TestLinearHistogram", 1, 1000, 10); - LinearHistogram linear_histogram1(L"Test1LinearHistogram", 1, 1000, 10); + LinearHistogram linear_histogram("TestLinearHistogram", 1, 1000, 10); + LinearHistogram linear_histogram1("Test1LinearHistogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists EXPECT_EQ(4U, histograms.size()); // Use standard macros (but with fixed samples) - HISTOGRAM_TIMES(L"Test2Histogram", TimeDelta::FromDays(1)); - HISTOGRAM_COUNTS(L"Test3Histogram", 30); + HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1)); + HISTOGRAM_COUNTS("Test3Histogram", 30); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists EXPECT_EQ(6U, histograms.size()); - ASSET_HISTOGRAM_COUNTS(L"TestAssetHistogram", 1000); + ASSET_HISTOGRAM_COUNTS("TestAssetHistogram", 1000); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists EXPECT_EQ(7U, histograms.size()); - DHISTOGRAM_TIMES(L"Test4Histogram", TimeDelta::FromDays(1)); - DHISTOGRAM_COUNTS(L"Test5Histogram", 30); + DHISTOGRAM_TIMES("Test4Histogram", TimeDelta::FromDays(1)); + DHISTOGRAM_COUNTS("Test5Histogram", 30); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists #ifndef NDEBUG @@ -103,7 +103,7 @@ TEST(HistogramTest, RangeTest) { recorder.GetHistograms(&histograms); EXPECT_EQ(0U, histograms.size()); - Histogram histogram(L"Histogram", 1, 64, 8); // As mentioned in header file. + Histogram histogram("Histogram", 1, 64, 8); // As mentioned in header file. // Check that we got a nice exponential when there was enough rooom. EXPECT_EQ(0, histogram.ranges(0)); int power_of_2 = 1; @@ -113,26 +113,26 @@ TEST(HistogramTest, RangeTest) { } EXPECT_EQ(INT_MAX, histogram.ranges(8)); - Histogram short_histogram(L"Histogram Shortened", 1, 7, 8); + Histogram short_histogram("Histogram Shortened", 1, 7, 8); // Check that when the number of buckets is short, we get a linear histogram // for lack of space to do otherwise. for (int i = 0; i < 8; i++) EXPECT_EQ(i, short_histogram.ranges(i)); EXPECT_EQ(INT_MAX, short_histogram.ranges(8)); - LinearHistogram linear_histogram(L"Linear", 1, 7, 8); + LinearHistogram linear_histogram("Linear", 1, 7, 8); // We also get a nice linear set of bucket ranges when we ask for it for (int i = 0; i < 8; i++) EXPECT_EQ(i, linear_histogram.ranges(i)); EXPECT_EQ(INT_MAX, linear_histogram.ranges(8)); - LinearHistogram linear_broad_histogram(L"Linear widened", 2, 14, 8); + LinearHistogram linear_broad_histogram("Linear widened", 2, 14, 8); // ...but when the list has more space, then the ranges naturally spread out. for (int i = 0; i < 8; i++) EXPECT_EQ(2 * i, linear_broad_histogram.ranges(i)); EXPECT_EQ(INT_MAX, linear_broad_histogram.ranges(8)); - ThreadSafeHistogram threadsafe_histogram(L"ThreadSafe", 1, 32, 15); + ThreadSafeHistogram threadsafe_histogram("ThreadSafe", 1, 32, 15); // When space is a little tight, we transition from linear to exponential. // This is what happens in both the basic histogram, and the threadsafe // variant (which is derived). @@ -160,7 +160,7 @@ TEST(HistogramTest, RangeTest) { // Make sure histogram handles out-of-bounds data gracefully. TEST(HistogramTest, BoundsTest) { const size_t kBucketCount = 50; - Histogram histogram(L"Bounded", 10, 100, kBucketCount); + Histogram histogram("Bounded", 10, 100, kBucketCount); // Put two samples "out of bounds" above and below. histogram.Add(5); @@ -182,7 +182,7 @@ TEST(HistogramTest, BoundsTest) { // Check to be sure samples land as expected is "correct" buckets. TEST(HistogramTest, BucketPlacementTest) { - Histogram histogram(L"Histogram", 1, 64, 8); // As mentioned in header file. + Histogram histogram("Histogram", 1, 64, 8); // As mentioned in header file. // Check that we got a nice exponential since there was enough rooom. EXPECT_EQ(0, histogram.ranges(0)); @@ -211,8 +211,8 @@ TEST(HistogramTest, BucketPlacementTest) { EXPECT_EQ(i + 1, sample.counts(i)); } -static const wchar_t* kAssetTestHistogramName = L"AssetCountTest"; -static const wchar_t* kAssetTestDebugHistogramName = L"DAssetCountTest"; +static const char kAssetTestHistogramName[] = "AssetCountTest"; +static const char kAssetTestDebugHistogramName[] = "DAssetCountTest"; void AssetCountFunction(int sample) { ASSET_HISTOGRAM_COUNTS(kAssetTestHistogramName, sample); DASSET_HISTOGRAM_COUNTS(kAssetTestDebugHistogramName, sample); @@ -229,16 +229,14 @@ TEST(HistogramTest, AssetCountTest) { StatisticsRecorder::Histograms histogram_list; StatisticsRecorder::GetHistograms(&histogram_list); ASSERT_NE(0U, histogram_list.size()); - std::string ascii_name = WideToASCII(kAssetTestHistogramName); - std::string debug_ascii_name = WideToASCII(kAssetTestDebugHistogramName); const Histogram* our_histogram = NULL; const Histogram* our_debug_histogram = NULL; for (StatisticsRecorder::Histograms::iterator it = histogram_list.begin(); it != histogram_list.end(); ++it) { - if (!(*it)->histogram_name().compare(ascii_name)) + if (!(*it)->histogram_name().compare(kAssetTestHistogramName)) our_histogram = *it; - else if (!(*it)->histogram_name().compare(debug_ascii_name)) { + else if (!(*it)->histogram_name().compare(kAssetTestDebugHistogramName)) { our_debug_histogram = *it; } } @@ -294,4 +292,3 @@ TEST(HistogramTest, AssetCountTest) { } } // namespace - diff --git a/base/message_loop.cc b/base/message_loop.cc index 12ad3fa..a57946b 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -504,11 +504,11 @@ void MessageLoop::StartHistogrammer() { if (enable_histogrammer_ && !message_histogram_.get() && StatisticsRecorder::WasStarted()) { DCHECK(!thread_name_.empty()); - message_histogram_.reset(new LinearHistogram( - ASCIIToWide("MsgLoop:" + thread_name_).c_str(), - kLeastNonZeroMessageId, - kMaxMessageId, - kNumberOfDistinctMessagesDisplayed)); + message_histogram_.reset( + new LinearHistogram(("MsgLoop:" + thread_name_).c_str(), + kLeastNonZeroMessageId, + kMaxMessageId, + kNumberOfDistinctMessagesDisplayed)); message_histogram_->SetFlags(message_histogram_->kHexRangePrintingFlag); message_histogram_->SetRangeDescriptions(event_descriptions_); } diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc index ca5baa8..e415623 100644 --- a/base/message_pump_win.cc +++ b/base/message_pump_win.cc @@ -158,7 +158,7 @@ void MessagePumpForUI::PumpOutPendingPaintMessages() { break; } // Histogram what was really being used, to help to adjust kMaxPeekCount. - DHISTOGRAM_COUNTS(L"Loop.PumpOutPendingPaintMessages Peeks", peek_count); + DHISTOGRAM_COUNTS("Loop.PumpOutPendingPaintMessages Peeks", peek_count); } //----------------------------------------------------------------------------- diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 2edf5ec..34ec599 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -216,14 +216,14 @@ bool DidProcessCrash(ProcessHandle handle) { const int kLeastValue = 0; const int kMaxValue = 0xFFF; const int kBucketCount = kMaxValue - kLeastValue + 1; - static LinearHistogram least_significant_histogram(L"ExitCodes.LSNibbles", + static LinearHistogram least_significant_histogram("ExitCodes.LSNibbles", kLeastValue + 1, kMaxValue, kBucketCount); least_significant_histogram.SetFlags(kUmaTargetedHistogramFlag | LinearHistogram::kHexRangePrintingFlag); least_significant_histogram.Add(exitcode & 0xFFF); // Histogram the high order 3 nibbles - static LinearHistogram most_significant_histogram(L"ExitCodes.MSNibbles", + static LinearHistogram most_significant_histogram("ExitCodes.MSNibbles", kLeastValue + 1, kMaxValue, kBucketCount); most_significant_histogram.SetFlags(kUmaTargetedHistogramFlag | LinearHistogram::kHexRangePrintingFlag); @@ -231,7 +231,7 @@ bool DidProcessCrash(ProcessHandle handle) { most_significant_histogram.Add((exitcode >> 20) & 0xFFF); // Histogram the middle order 2 nibbles - static LinearHistogram mid_significant_histogram(L"ExitCodes.MidNibbles", + static LinearHistogram mid_significant_histogram("ExitCodes.MidNibbles", 1, 0xFF, 0x100); mid_significant_histogram.SetFlags(kUmaTargetedHistogramFlag | LinearHistogram::kHexRangePrintingFlag); diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc index a2397af..ccd8d39 100644 --- a/chrome/browser/autocomplete/history_contents_provider.cc +++ b/chrome/browser/autocomplete/history_contents_provider.cc @@ -278,7 +278,7 @@ void HistoryContentsProvider::QueryBookmarks(const AutocompleteInput& input) { kMaxMatchCount, &matches); for (size_t i = 0; i < matches.size(); ++i) AddBookmarkTitleMatchToResults(matches[i]); - UMA_HISTOGRAM_TIMES(L"Omnibox.QueryBookmarksTime", + UMA_HISTOGRAM_TIMES("Omnibox.QueryBookmarksTime", TimeTicks::Now() - start_time); } diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index 3cb0a84..309aa31 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -117,7 +117,7 @@ void HistoryURLProvider::ExecuteWithDB(history::HistoryBackend* backend, DoAutocomplete(backend, db, params); - HISTOGRAM_TIMES(L"Autocomplete.HistoryAsyncQueryTime", + HISTOGRAM_TIMES("Autocomplete.HistoryAsyncQueryTime", TimeTicks::Now() - beginning_time); } @@ -827,4 +827,3 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( return match; } - diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index c690ad8..2f46668 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -179,7 +179,7 @@ LaunchMode GetLaunchSortcutKind() { // LaunchMode enum for the actual values of the buckets. void RecordLaunchModeHistogram(LaunchMode mode) { int bucket = (mode == LM_TO_BE_DECIDED) ? GetLaunchSortcutKind() : mode; - UMA_HISTOGRAM_COUNTS_100(L"Launch.Modes", bucket); + UMA_HISTOGRAM_COUNTS_100("Launch.Modes", bucket); } } // namespace diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 933a1ea..40e470f 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -190,19 +190,19 @@ void ReadLastShutdownInfo() { prefs->SetInteger(prefs::kShutdownNumProcessesSlow, 0); if (type > NOT_VALID && shutdown_ms > 0 && num_procs > 0) { - const wchar_t *time_fmt = L"Shutdown.%ls.time"; - const wchar_t *time_per_fmt = L"Shutdown.%ls.time_per_process"; - std::wstring time; - std::wstring time_per; + const char *time_fmt = "Shutdown.%s.time"; + const char *time_per_fmt = "Shutdown.%s.time_per_process"; + std::string time; + std::string time_per; if (type == WINDOW_CLOSE) { - time = StringPrintf(time_fmt, L"window_close"); - time_per = StringPrintf(time_per_fmt, L"window_close"); + time = StringPrintf(time_fmt, "window_close"); + time_per = StringPrintf(time_per_fmt, "window_close"); } else if (type == BROWSER_EXIT) { - time = StringPrintf(time_fmt, L"browser_exit"); - time_per = StringPrintf(time_per_fmt, L"browser_exit"); + time = StringPrintf(time_fmt, "browser_exit"); + time_per = StringPrintf(time_per_fmt, "browser_exit"); } else if (type == END_SESSION) { - time = StringPrintf(time_fmt, L"end_session"); - time_per = StringPrintf(time_per_fmt, L"end_session"); + time = StringPrintf(time_fmt, "end_session"); + time_per = StringPrintf(time_per_fmt, "end_session"); } else { NOTREACHED(); } @@ -212,8 +212,8 @@ void ReadLastShutdownInfo() { TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_TIMES(time_per.c_str(), TimeDelta::FromMilliseconds(shutdown_ms / num_procs)); - UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.total", num_procs); - UMA_HISTOGRAM_COUNTS_100(L"Shutdown.renderers.slow", num_procs_slow); + UMA_HISTOGRAM_COUNTS_100("Shutdown.renderers.total", num_procs); + UMA_HISTOGRAM_COUNTS_100("Shutdown.renderers.slow", num_procs_slow); } } } diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 50b793e..761be8e 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -124,11 +124,11 @@ class PluginRequestInterceptor } void LogInterceptHitTime(const TimeDelta& time) { - UMA_HISTOGRAM_TIMES(L"Gears.InterceptHit", time); + UMA_HISTOGRAM_TIMES("Gears.InterceptHit", time); } void LogInterceptMissTime(const TimeDelta& time) { - UMA_HISTOGRAM_TIMES(L"Gears.InterceptMiss", time); + UMA_HISTOGRAM_TIMES("Gears.InterceptMiss", time); } typedef std::set<std::string> HandledProtocolList; diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 506d525..e0cfd44 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -90,7 +90,7 @@ class PaintTimer : public RenderWidgetHost::PaintObserver { NotificationType::INITIAL_NEW_TAB_UI_LOAD, NotificationService::AllSources(), Details<int>(&load_time_ms)); - UMA_HISTOGRAM_TIMES(L"NewTabUI load", load_time); + UMA_HISTOGRAM_TIMES("NewTabUI load", load_time); } else { // Not enough quiet time has elapsed. // Some more paints must've occurred since we set the timeout. @@ -480,7 +480,7 @@ void TemplateURLHandler::OnTemplateURLModelChanged() { urls_value.Append(entry_value); } - UMA_HISTOGRAM_COUNTS(L"NewTabPage.SearchURLs.Total", urls_value.GetSize()); + UMA_HISTOGRAM_COUNTS("NewTabPage.SearchURLs.Total", urls_value.GetSize()); dom_ui_host_->CallJavascriptFunction(L"searchURLs", urls_value); } diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 6bed37a..015f442 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -567,7 +567,7 @@ void HistoryBackend::InitImpl() { // Start expiring old stuff. expirer_.StartArchivingOldStuff(TimeDelta::FromDays(kArchiveDaysThreshold)); - HISTOGRAM_TIMES(L"History.InitTime", + HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); } @@ -997,7 +997,7 @@ void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, request->ForwardResult(QueryHistoryRequest::TupleType(request->handle(), &request->value)); - HISTOGRAM_TIMES(L"History.QueryHistory", + HISTOGRAM_TIMES("History.QueryHistory", TimeTicks::Now() - beginning_time); } @@ -1231,7 +1231,7 @@ void HistoryBackend::GetPageThumbnailDirectly( if (!success) *data = NULL; // This will tell the callback there was an error. - HISTOGRAM_TIMES(L"History.GetPageThumbnail", + HISTOGRAM_TIMES("History.GetPageThumbnail", TimeTicks::Now() - beginning_time); } } @@ -1397,7 +1397,7 @@ void HistoryBackend::GetFavIconForURL( TimeDelta::FromDays(kFavIconRefetchDays); } - HISTOGRAM_TIMES(L"History.GetFavIconForURL", + HISTOGRAM_TIMES("History.GetFavIconForURL", TimeTicks::Now() - beginning_time); } @@ -1831,4 +1831,3 @@ BookmarkService* HistoryBackend::GetBookmarkService() { } } // namespace history - diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index 12ba716..d133d22 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -309,7 +309,7 @@ bool TextDatabaseManager::AddPageData(const GURL& url, ConvertStringForIndexer(title), ConvertStringForIndexer(body)); - HISTOGRAM_TIMES(L"History.AddFTSData", + HISTOGRAM_TIMES("History.AddFTSData", TimeTicks::Now() - beginning_time); if (history_publisher_) @@ -546,4 +546,3 @@ void TextDatabaseManager::FlushOldChangesForTime(TimeTicks now) { } } // namespace history - diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index e1b3016..c7bb0a5 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -85,10 +85,10 @@ class JankObserver : public base::RefCountedThreadSafe<JankObserver>, : MaxMessageDelay_(excessive_duration), slow_processing_counter_(std::string("Chrome.SlowMsg") + thread_name), queueing_delay_counter_(std::string("Chrome.DelayMsg") + thread_name), - process_times_((std::wstring(L"Chrome.ProcMsgL ") - + ASCIIToWide(thread_name)).c_str(), 1, 3600000, 50), - total_times_((std::wstring(L"Chrome.TotalMsgL ") - + ASCIIToWide(thread_name)).c_str(), 1, 3600000, 50), + process_times_((std::string("Chrome.ProcMsgL ") + + thread_name).c_str(), 1, 3600000, 50), + total_times_((std::string("Chrome.TotalMsgL ") + + thread_name).c_str(), 1, 3600000, 50), total_time_watchdog_(excessive_duration, thread_name, watchdog_enable) { process_times_.SetFlags(kUmaTargetedHistogramFlag); total_times_.SetFlags(kUmaTargetedHistogramFlag); @@ -227,4 +227,3 @@ void UninstallJankometer() { io_observer = NULL; } } - diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index 6b692bf..79c6a07 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -251,27 +251,27 @@ void MemoryDetails::UpdateHistograms() { aggregate_memory += sample; switch (browser.processes[index].type) { case ChildProcessInfo::BROWSER_PROCESS: - UMA_HISTOGRAM_MEMORY_KB(L"Memory.Browser", sample); + UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample); break; case ChildProcessInfo::RENDER_PROCESS: - UMA_HISTOGRAM_MEMORY_KB(L"Memory.Renderer", sample); + UMA_HISTOGRAM_MEMORY_KB("Memory.Renderer", sample); break; case ChildProcessInfo::PLUGIN_PROCESS: - UMA_HISTOGRAM_MEMORY_KB(L"Memory.Plugin", sample); + UMA_HISTOGRAM_MEMORY_KB("Memory.Plugin", sample); plugin_count++; break; case ChildProcessInfo::WORKER_PROCESS: - UMA_HISTOGRAM_MEMORY_KB(L"Memory.Worker", sample); + UMA_HISTOGRAM_MEMORY_KB("Memory.Worker", sample); worker_count++; break; } } - UMA_HISTOGRAM_COUNTS_100(L"Memory.ProcessCount", + UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount", static_cast<int>(browser.processes.size())); - UMA_HISTOGRAM_COUNTS_100(L"Memory.PluginProcessCount", plugin_count); - UMA_HISTOGRAM_COUNTS_100(L"Memory.WorkerProcessCount", worker_count); + UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); + UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); int total_sample = static_cast<int>(aggregate_memory / 1000); - UMA_HISTOGRAM_MEMORY_MB(L"Memory.Total", total_sample); + UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); } diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 42fae63..5c9cfda 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -736,7 +736,7 @@ void MetricsService::StopRecording(MetricsLog** log) { // TODO(jar): Integrate bounds on log recording more consistently, so that we // can stop recording logs that are too big much sooner. if (current_log_->num_events() > log_event_limit_) { - UMA_HISTOGRAM_COUNTS(L"UMA.Discarded Log Events", + UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events", current_log_->num_events()); current_log_->CloseLog(); delete current_log_; @@ -833,7 +833,7 @@ void MetricsService::PushPendingLogTextToUnsentOngoingLogs() { if (pending_log_text_.length() > static_cast<size_t>(kUploadLogAvoidRetransmitSize)) { - UMA_HISTOGRAM_COUNTS(L"UMA.Large Accumulated Log Not Persisted", + UMA_HISTOGRAM_COUNTS("UMA.Large Accumulated Log Not Persisted", static_cast<int>(pending_log_text_.length())); return; } @@ -1226,12 +1226,12 @@ void MetricsService::OnURLFetchComplete(const URLFetcher* source, if (response_code != 200 && pending_log_text_.length() > static_cast<size_t>(kUploadLogAvoidRetransmitSize)) { - UMA_HISTOGRAM_COUNTS(L"UMA.Large Rejected Log was Discarded", + UMA_HISTOGRAM_COUNTS("UMA.Large Rejected Log was Discarded", static_cast<int>(pending_log_text_.length())); discard_log = true; } else if (response_code == 400) { // Bad syntax. Retransmission won't work. - UMA_HISTOGRAM_COUNTS(L"UMA.Unacceptable_Log_Discarded", state_); + UMA_HISTOGRAM_COUNTS("UMA.Unacceptable_Log_Discarded", state_); discard_log = true; } @@ -1542,7 +1542,7 @@ void MetricsService::LogLoadComplete(NotificationType type, // TODO(jar): There is a bug causing this to be called too many times, and // the log overflows. For now, we won't record these events. - UMA_HISTOGRAM_COUNTS(L"UMA.LogLoadComplete called", 1); + UMA_HISTOGRAM_COUNTS("UMA.LogLoadComplete called", 1); return; const Details<LoadNotificationDetails> load_details(details); diff --git a/chrome/browser/net/dns_host_info.cc b/chrome/browser/net/dns_host_info.cc index 744fee0..1b509d1 100644 --- a/chrome/browser/net/dns_host_info.cc +++ b/chrome/browser/net/dns_host_info.cc @@ -89,7 +89,7 @@ void DnsHostInfo::SetAssignedState() { state_ = ASSIGNED; queue_duration_ = GetDuration(); DLogResultsStats("DNS Prefetch assigned"); - UMA_HISTOGRAM_TIMES(L"DNS.PrefetchQueue", queue_duration_); + UMA_HISTOGRAM_TIMES("DNS.PrefetchQueue", queue_duration_); } void DnsHostInfo::SetPendingDeleteState() { @@ -102,7 +102,7 @@ void DnsHostInfo::SetFoundState() { state_ = FOUND; resolve_duration_ = GetDuration(); if (kMaxNonNetworkDnsLookupDuration <= resolve_duration_) { - UMA_HISTOGRAM_LONG_TIMES(L"DNS.PrefetchFoundNameL", resolve_duration_); + UMA_HISTOGRAM_LONG_TIMES("DNS.PrefetchFoundNameL", resolve_duration_); // Record potential beneficial time, and maybe we'll get a cache hit. // We keep the maximum, as the warming we did earlier may still be // helping with a cache upstream in DNS resolution. @@ -117,7 +117,7 @@ void DnsHostInfo::SetNoSuchNameState() { state_ = NO_SUCH_NAME; resolve_duration_ = GetDuration(); if (kMaxNonNetworkDnsLookupDuration <= resolve_duration_) { - DHISTOGRAM_TIMES(L"DNS.PrefetchNotFoundName", resolve_duration_); + DHISTOGRAM_TIMES("DNS.PrefetchNotFoundName", resolve_duration_); // Record potential beneficial time, and maybe we'll get a cache hit. benefits_remaining_ = std::max(resolve_duration_, benefits_remaining_); } @@ -176,10 +176,10 @@ DnsBenefit DnsHostInfo::AccruePrefetchBenefits(DnsHostInfo* navigation_info) { if ((0 == benefits_remaining_.InMilliseconds()) || (FOUND != state_ && NO_SUCH_NAME != state_)) { if (FINISHED == navigation_info->state_) - UMA_HISTOGRAM_LONG_TIMES(L"DNS.IndependentNavigation", + UMA_HISTOGRAM_LONG_TIMES("DNS.IndependentNavigation", navigation_info->resolve_duration_); else - UMA_HISTOGRAM_LONG_TIMES(L"DNS.IndependentFailedNavigation", + UMA_HISTOGRAM_LONG_TIMES("DNS.IndependentFailedNavigation", navigation_info->resolve_duration_); return PREFETCH_NO_BENEFIT; } @@ -195,13 +195,13 @@ DnsBenefit DnsHostInfo::AccruePrefetchBenefits(DnsHostInfo* navigation_info) { if (navigation_info->resolve_duration_ > kMaxNonNetworkDnsLookupDuration) { // Our precache effort didn't help since HTTP stack hit the network. - UMA_HISTOGRAM_LONG_TIMES(L"DNS.PrefetchCacheEvictionL", resolve_duration_); + UMA_HISTOGRAM_LONG_TIMES("DNS.PrefetchCacheEvictionL", resolve_duration_); DLogResultsStats("DNS PrefetchCacheEviction"); return PREFETCH_CACHE_EVICTION; } if (NO_SUCH_NAME == state_) { - UMA_HISTOGRAM_LONG_TIMES(L"DNS.PrefetchNegativeHitL", benefit); + UMA_HISTOGRAM_LONG_TIMES("DNS.PrefetchNegativeHitL", benefit); DLogResultsStats("DNS PrefetchNegativeHit"); return PREFETCH_NAME_NONEXISTANT; } @@ -209,10 +209,10 @@ DnsBenefit DnsHostInfo::AccruePrefetchBenefits(DnsHostInfo* navigation_info) { DCHECK_EQ(FOUND, state_); if (LEARNED_REFERAL_MOTIVATED == motivation_ || STATIC_REFERAL_MOTIVATED == motivation_) { - UMA_HISTOGRAM_TIMES(L"DNS.PrefetchReferredPositiveHit", benefit); + UMA_HISTOGRAM_TIMES("DNS.PrefetchReferredPositiveHit", benefit); DLogResultsStats("DNS PrefetchReferredPositiveHit"); } else { - UMA_HISTOGRAM_LONG_TIMES(L"DNS.PrefetchPositiveHitL", benefit); + UMA_HISTOGRAM_LONG_TIMES("DNS.PrefetchPositiveHitL", benefit); DLogResultsStats("DNS PrefetchPositiveHit"); } return PREFETCH_NAME_FOUND; @@ -408,4 +408,3 @@ std::string DnsHostInfo::GetAsciiMotivation() const { } } // namespace chrome_browser_net - diff --git a/chrome/browser/net/dns_master.cc b/chrome/browser/net/dns_master.cc index f2a584e..dd8aae0 100644 --- a/chrome/browser/net/dns_master.cc +++ b/chrome/browser/net/dns_master.cc @@ -104,7 +104,7 @@ bool DnsMaster::AccruePrefetchBenefits(const GURL& referrer, if (it == results_.end()) { // Remain under lock to assure static HISTOGRAM constructor is safely run. // Use UMA histogram to quantify potential future gains here. - UMA_HISTOGRAM_LONG_TIMES(L"DNS.UnexpectedResolutionL", + UMA_HISTOGRAM_LONG_TIMES("DNS.UnexpectedResolutionL", navigation_info->resolve_duration()); navigation_info->DLogResultsStats("DNS UnexpectedResolution"); diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index 515b497..0f4f3d7 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -20,16 +20,16 @@ const int kMaxBytesToSniff = 512; void RecordSnifferMetrics(bool sniffing_blocked, bool we_would_like_to_sniff, const std::string& mime_type) { - static BooleanHistogram nosniff_usage(L"nosniff.usage"); + static BooleanHistogram nosniff_usage("nosniff.usage"); nosniff_usage.SetFlags(kUmaTargetedHistogramFlag); nosniff_usage.AddBoolean(sniffing_blocked); if (sniffing_blocked) { - static BooleanHistogram nosniff_otherwise(L"nosniff.otherwise"); + static BooleanHistogram nosniff_otherwise("nosniff.otherwise"); nosniff_otherwise.SetFlags(kUmaTargetedHistogramFlag); nosniff_otherwise.AddBoolean(we_would_like_to_sniff); - static BooleanHistogram nosniff_empty_mime_type(L"nosniff.empty_mime_type"); + static BooleanHistogram nosniff_empty_mime_type("nosniff.empty_mime_type"); nosniff_empty_mime_type.SetFlags(kUmaTargetedHistogramFlag); nosniff_empty_mime_type.AddBoolean(mime_type.empty()); } diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 1bd81cd..1f0ab85 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -418,7 +418,7 @@ void RenderWidgetHost::OnMsgPaintRect( if (is_repaint_ack) { repaint_ack_pending_ = false; TimeDelta delta = TimeTicks::Now() - repaint_start_time_; - UMA_HISTOGRAM_TIMES(L"MPArch.RWH_RepaintDelta", delta); + UMA_HISTOGRAM_TIMES("MPArch.RWH_RepaintDelta", delta); } DCHECK(!params.bitmap_rect.IsEmpty()); @@ -475,7 +475,7 @@ void RenderWidgetHost::OnMsgPaintRect( // Log the time delta for processing a paint message. TimeDelta delta = TimeTicks::Now() - paint_start; - UMA_HISTOGRAM_TIMES(L"MPArch.RWH_OnMsgPaintRect", delta); + UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgPaintRect", delta); } void RenderWidgetHost::OnMsgScrollRect( @@ -521,13 +521,13 @@ void RenderWidgetHost::OnMsgScrollRect( // Log the time delta for processing a scroll message. TimeDelta delta = TimeTicks::Now() - scroll_start; - UMA_HISTOGRAM_TIMES(L"MPArch.RWH_OnMsgScrollRect", delta); + UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgScrollRect", delta); } void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) { // Log the time delta for processing an input event. TimeDelta delta = TimeTicks::Now() - input_event_start_time_; - UMA_HISTOGRAM_TIMES(L"MPArch.RWH_InputEventDelta", delta); + UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); // Cancel pending hung renderer checks since the renderer is responsive. StopHangMonitorTimeout(); diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index fd782e7..afc0f25 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -311,13 +311,13 @@ void RenderWidgetHostViewMac::ShutdownHost() { FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial)); if (trial.get()) { if (trial->boolean_value()) - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_high_memory", + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration_trial_high_memory", whiteout_duration); else - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_med_memory", + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration_trial_med_memory", whiteout_duration); } else { - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration", whiteout_duration); + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); } // Reset the start time to 0 so that we start recording again the next diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 867a44d..871be4a 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -524,13 +524,13 @@ void RenderWidgetHostViewWin::OnPaint(HDC dc) { FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial)); if (trial.get()) { if (trial->boolean_value()) - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_high_memory", + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration_trial_high_memory", whiteout_duration); else - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_med_memory", + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration_trial_med_memory", whiteout_duration); } else { - UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration", whiteout_duration); + UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); } // Reset the start time to 0 so that we start recording again the next diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index e19c00b..e4ca158 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -430,7 +430,7 @@ void ResourceMessageFilter::OnLoadFont(LOGFONT font) { static HDC hdcs[kFontCacheSize] = {0}; static size_t font_index = 0; - UMA_HISTOGRAM_COUNTS_100(L"Memory.CachedFontAndDC", + UMA_HISTOGRAM_COUNTS_100("Memory.CachedFontAndDC", fonts[kFontCacheSize-1] ? kFontCacheSize : static_cast<int>(font_index)); HDC hdc = GetDC(NULL); @@ -626,15 +626,15 @@ void ResourceMessageFilter::OnDuplicateSection( void ResourceMessageFilter::OnResourceTypeStats( const CacheManager::ResourceTypeStats& stats) { - HISTOGRAM_COUNTS(L"WebCoreCache.ImagesSizeKB", + HISTOGRAM_COUNTS("WebCoreCache.ImagesSizeKB", static_cast<int>(stats.images.size / 1024)); - HISTOGRAM_COUNTS(L"WebCoreCache.CSSStylesheetsSizeKB", + HISTOGRAM_COUNTS("WebCoreCache.CSSStylesheetsSizeKB", static_cast<int>(stats.css_stylesheets.size / 1024)); - HISTOGRAM_COUNTS(L"WebCoreCache.ScriptsSizeKB", + HISTOGRAM_COUNTS("WebCoreCache.ScriptsSizeKB", static_cast<int>(stats.scripts.size / 1024)); - HISTOGRAM_COUNTS(L"WebCoreCache.XSLStylesheetsSizeKB", + HISTOGRAM_COUNTS("WebCoreCache.XSLStylesheetsSizeKB", static_cast<int>(stats.xsl_stylesheets.size / 1024)); - HISTOGRAM_COUNTS(L"WebCoreCache.FontsSizeKB", + HISTOGRAM_COUNTS("WebCoreCache.FontsSizeKB", static_cast<int>(stats.fonts.size / 1024)); } diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index eb556c0..f800ce1 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -329,7 +329,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url, // New chunks to download. if (!chunk_urls.empty()) { - UMA_HISTOGRAM_COUNTS(L"SB2.UpdateUrls", chunk_urls.size()); + UMA_HISTOGRAM_COUNTS("SB2.UpdateUrls", chunk_urls.size()); for (size_t i = 0; i < chunk_urls.size(); ++i) chunk_request_urls_.push_back(chunk_urls[i]); } @@ -352,13 +352,13 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url, } case CHUNK_REQUEST: { if (sb_service_->new_safe_browsing()) - UMA_HISTOGRAM_TIMES(L"SB2.ChunkRequest", + UMA_HISTOGRAM_TIMES("SB2.ChunkRequest", base::Time::Now() - chunk_request_start_); const ChunkUrl chunk_url = chunk_request_urls_.front(); bool re_key = false; std::deque<SBChunk>* chunks = new std::deque<SBChunk>; - UMA_HISTOGRAM_COUNTS(L"SB2.ChunkSize", length); + UMA_HISTOGRAM_COUNTS("SB2.ChunkSize", length); update_size_ += length; if (!parser.ParseChunk(data, length, client_key_, chunk_url.mac, @@ -565,9 +565,9 @@ void SafeBrowsingProtocolManager::OnChunkInserted() { if (chunk_request_urls_.empty()) { // Don't pollute old implementation histograms with new implemetation data. if (sb_service_->new_safe_browsing()) - UMA_HISTOGRAM_LONG_TIMES(L"SB2.Update", Time::Now() - last_update_); + UMA_HISTOGRAM_LONG_TIMES("SB2.Update", Time::Now() - last_update_); else - UMA_HISTOGRAM_LONG_TIMES(L"SB.Update", Time::Now() - last_update_); + UMA_HISTOGRAM_LONG_TIMES("SB.Update", Time::Now() - last_update_); UpdateFinished(true); } else { IssueChunkRequest(); @@ -627,7 +627,7 @@ void SafeBrowsingProtocolManager::HandleGetHashError() { } void SafeBrowsingProtocolManager::UpdateFinished(bool success) { - UMA_HISTOGRAM_COUNTS(L"SB2.UpdateSize", update_size_); + UMA_HISTOGRAM_COUNTS("SB2.UpdateSize", update_size_); update_size_ = 0; sb_service_->UpdateFinished(success); } diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc index 996cb52..e69ae04 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc @@ -91,7 +91,7 @@ void SafeBrowsingDatabaseBloom::LoadBloomFilter() { if (!file_util::GetFileSize(bloom_filter_filename_, &size_64) || size_64 == 0) { - UMA_HISTOGRAM_COUNTS(L"SB2.FilterMissing", 1); + UMA_HISTOGRAM_COUNTS("SB2.FilterMissing", 1); return; } @@ -403,7 +403,7 @@ void SafeBrowsingDatabaseBloom::InsertChunks(const std::string& list_name, chunks->pop_front(); } - UMA_HISTOGRAM_TIMES(L"SB2.ChunkInsert", base::Time::Now() - insert_start); + UMA_HISTOGRAM_TIMES("SB2.ChunkInsert", base::Time::Now() - insert_start); delete chunks; @@ -1316,7 +1316,7 @@ void SafeBrowsingDatabaseBloom::BuildBloomFilter() { int rv = insert_transaction_->Commit(); if (rv != SQLITE_OK) { NOTREACHED() << "SafeBrowsing update transaction failed to commit."; - UMA_HISTOGRAM_COUNTS(L"SB2.FailedUpdate", 1); + UMA_HISTOGRAM_COUNTS("SB2.FailedUpdate", 1); return; } @@ -1337,28 +1337,28 @@ void SafeBrowsingDatabaseBloom::BuildBloomFilter() { // Gather statistics. #if defined(OS_WIN) metric->GetIOCounters(&io_after); - UMA_HISTOGRAM_COUNTS(L"SB2.BuildReadBytes", + UMA_HISTOGRAM_COUNTS("SB2.BuildReadBytes", static_cast<int>(io_after.ReadTransferCount - io_before.ReadTransferCount)); - UMA_HISTOGRAM_COUNTS(L"SB2.BuildWriteBytes", + UMA_HISTOGRAM_COUNTS("SB2.BuildWriteBytes", static_cast<int>(io_after.WriteTransferCount - io_before.WriteTransferCount)); - UMA_HISTOGRAM_COUNTS(L"SB2.BuildReadOperations", + UMA_HISTOGRAM_COUNTS("SB2.BuildReadOperations", static_cast<int>(io_after.ReadOperationCount - io_before.ReadOperationCount)); - UMA_HISTOGRAM_COUNTS(L"SB2.BuildWriteOperations", + UMA_HISTOGRAM_COUNTS("SB2.BuildWriteOperations", static_cast<int>(io_after.WriteOperationCount - io_before.WriteOperationCount)); #endif SB_DLOG(INFO) << "SafeBrowsingDatabaseImpl built bloom filter in " << bloom_gen.InMilliseconds() << " ms total. prefix count: "<< add_count_; - UMA_HISTOGRAM_LONG_TIMES(L"SB2.BuildFilter", bloom_gen); - UMA_HISTOGRAM_COUNTS(L"SB2.AddPrefixes", add_count_); - UMA_HISTOGRAM_COUNTS(L"SB2.SubPrefixes", subs); + UMA_HISTOGRAM_LONG_TIMES("SB2.BuildFilter", bloom_gen); + UMA_HISTOGRAM_COUNTS("SB2.AddPrefixes", add_count_); + UMA_HISTOGRAM_COUNTS("SB2.SubPrefixes", subs); int64 size_64; if (file_util::GetFileSize(filename_, &size_64)) - UMA_HISTOGRAM_COUNTS(L"SB2.DatabaseBytes", static_cast<int>(size_64)); + UMA_HISTOGRAM_COUNTS("SB2.DatabaseBytes", static_cast<int>(size_64)); } void SafeBrowsingDatabaseBloom::GetCachedFullHashes( diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index f79c238..04e55a7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -184,7 +184,7 @@ bool SafeBrowsingService::CheckUrl(const GURL& url, Client* client) { if (!resetting_) { Time start_time = Time::Now(); bool need_check = database_->NeedToCheckUrl(url); - UMA_HISTOGRAM_TIMES(L"SB.BloomFilter", Time::Now() - start_time); + UMA_HISTOGRAM_TIMES("SB.BloomFilter", Time::Now() - start_time); if (!need_check) return true; // The url is definitely safe. } @@ -223,7 +223,7 @@ bool SafeBrowsingService::CheckUrlNew(const GURL& url, Client* client) { &full_hits, protocol_manager_->last_update()); - UMA_HISTOGRAM_TIMES(L"SB2.FilterCheck", base::Time::Now() - check_start); + UMA_HISTOGRAM_TIMES("SB2.FilterCheck", base::Time::Now() - check_start); if (!prefix_match) return true; // URL is okay. @@ -383,7 +383,7 @@ void SafeBrowsingService::OnCheckDone(SafeBrowsingCheck* check) { if (!enabled_ || checks_.find(check) == checks_.end()) return; - UMA_HISTOGRAM_TIMES(L"SB.Database", Time::Now() - check->start); + UMA_HISTOGRAM_TIMES("SB.Database", Time::Now() - check->start); if (check->client && check->need_get_hash) { // We have a partial match so we need to query Google for the full hash. // Clean up will happen in HandleGetHashResults. @@ -464,9 +464,9 @@ void SafeBrowsingService::HandleGetHashResults( DCHECK(enabled_); if (new_safe_browsing_) - UMA_HISTOGRAM_LONG_TIMES(L"SB2.Network", Time::Now() - check->start); + UMA_HISTOGRAM_LONG_TIMES("SB2.Network", Time::Now() - check->start); else - UMA_HISTOGRAM_LONG_TIMES(L"SB.Network", Time::Now() - check->start); + UMA_HISTOGRAM_LONG_TIMES("SB.Network", Time::Now() - check->start); std::vector<SBPrefix> prefixes = check->prefix_hits; OnHandleGetHashResults(check, full_hashes); // 'check' is deleted here. @@ -711,9 +711,9 @@ SafeBrowsingService::UrlCheckResult SafeBrowsingService::GetResultFromListname( void SafeBrowsingService::LogPauseDelay(TimeDelta time) { if (new_safe_browsing_) - UMA_HISTOGRAM_LONG_TIMES(L"SB2.Delay", time); + UMA_HISTOGRAM_LONG_TIMES("SB2.Delay", time); else - UMA_HISTOGRAM_LONG_TIMES(L"SB.Delay", time); + UMA_HISTOGRAM_LONG_TIMES("SB.Delay", time); } void SafeBrowsingService::CacheHashResults( @@ -748,10 +748,10 @@ void SafeBrowsingService::HandleResume() { void SafeBrowsingService::RunQueuedClients() { DCHECK(MessageLoop::current() == io_loop_); - HISTOGRAM_COUNTS(L"SB.QueueDepth", queued_checks_.size()); + HISTOGRAM_COUNTS("SB.QueueDepth", queued_checks_.size()); while (!queued_checks_.empty()) { QueuedCheck check = queued_checks_.front(); - HISTOGRAM_TIMES(L"SB.QueueDelay", Time::Now() - check.start); + HISTOGRAM_TIMES("SB.QueueDelay", Time::Now() - check.start); CheckUrl(check.url, check.client); queued_checks_.pop_front(); } diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc index 2fbbe40..ebadc31 100644 --- a/chrome/browser/sessions/session_backend.cc +++ b/chrome/browser/sessions/session_backend.cc @@ -97,10 +97,10 @@ bool SessionFileReader::Read(BaseSessionService::SessionType type, if (!errored_) read_commands->swap(*commands); if (type == BaseSessionService::TAB_RESTORE) { - UMA_HISTOGRAM_TIMES(L"TabRestore.read_session_file_time", + UMA_HISTOGRAM_TIMES("TabRestore.read_session_file_time", TimeTicks::Now() - start_time); } else { - UMA_HISTOGRAM_TIMES(L"SessionRestore.read_session_file_time", + UMA_HISTOGRAM_TIMES("SessionRestore.read_session_file_time", TimeTicks::Now() - start_time); } return !errored_; @@ -259,10 +259,10 @@ void SessionBackend::MoveCurrentSessionToLastSession() { int64 file_size; if (file_util::GetFileSize(current_session_path, &file_size)) { if (type_ == BaseSessionService::TAB_RESTORE) { - UMA_HISTOGRAM_COUNTS(L"TabRestore.last_session_file_size", + UMA_HISTOGRAM_COUNTS("TabRestore.last_session_file_size", static_cast<int>(file_size / 1024)); } else { - UMA_HISTOGRAM_COUNTS(L"SessionRestore.last_session_file_size", + UMA_HISTOGRAM_COUNTS("SessionRestore.last_session_file_size", static_cast<int>(file_size / 1024)); } } @@ -285,9 +285,9 @@ bool SessionBackend::AppendCommandsToFile(net::FileStream* file, const size_type content_size = static_cast<size_type>((*i)->size()); const size_type total_size = content_size + sizeof(id_type); if (type_ == BaseSessionService::TAB_RESTORE) - UMA_HISTOGRAM_COUNTS(L"TabRestore.command_size", total_size); + UMA_HISTOGRAM_COUNTS("TabRestore.command_size", total_size); else - UMA_HISTOGRAM_COUNTS(L"SessionRestore.command_size", total_size); + UMA_HISTOGRAM_COUNTS("SessionRestore.command_size", total_size); wrote = file->Write(reinterpret_cast<const char*>(&total_size), sizeof(total_size), NULL); if (wrote != sizeof(total_size)) { diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc index cb6f874..4d0cee5 100644 --- a/chrome/browser/spellchecker.cc +++ b/chrome/browser/spellchecker.cc @@ -475,7 +475,7 @@ bool SpellChecker::Initialize() { hunspell_.reset(new Hunspell(bdict_file_->data(), bdict_file_->length())); AddCustomWordsToHunspell(); } - DHISTOGRAM_TIMES(L"Spellcheck.InitTime", TimeTicks::Now() - begin_time); + DHISTOGRAM_TIMES("Spellcheck.InitTime", TimeTicks::Now() - begin_time); tried_to_init_ = true; return false; @@ -561,7 +561,7 @@ bool SpellChecker::SpellCheckWord( { TimeTicks begin_time = TimeTicks::Now(); bool word_ok = !!hunspell_->spell(encoded_word.c_str()); - DHISTOGRAM_TIMES(L"Spellcheck.CheckTime", TimeTicks::Now() - begin_time); + DHISTOGRAM_TIMES("Spellcheck.CheckTime", TimeTicks::Now() - begin_time); if (word_ok) continue; } @@ -580,7 +580,7 @@ bool SpellChecker::SpellCheckWord( TimeTicks begin_time = TimeTicks::Now(); int number_of_suggestions = hunspell_->suggest(&suggestions, encoded_word.c_str()); - DHISTOGRAM_TIMES(L"Spellcheck.SuggestTime", + DHISTOGRAM_TIMES("Spellcheck.SuggestTime", TimeTicks::Now() - begin_time); // Populate the vector of WideStrings. diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index 804a076..7fbca70 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -131,7 +131,7 @@ void ChromePluginLib::RegisterPluginsWithNPAPI() { } static void LogPluginLoadTime(const TimeDelta &time) { - UMA_HISTOGRAM_TIMES(L"Gears.LoadTime", time); + UMA_HISTOGRAM_TIMES("Gears.LoadTime", time); } // static diff --git a/chrome/common/ipc_channel_win.cc b/chrome/common/ipc_channel_win.cc index dfccc33..54818b5 100644 --- a/chrome/common/ipc_channel_win.cc +++ b/chrome/common/ipc_channel_win.cc @@ -71,7 +71,7 @@ void Channel::ChannelImpl::Close() { } if (waited) { // We want to see if we block the message loop for too long. - UMA_HISTOGRAM_TIMES(L"AsyncIO.IPCChannelClose", base::Time::Now() - start); + UMA_HISTOGRAM_TIMES("AsyncIO.IPCChannelClose", base::Time::Now() - start); } while (!output_queue_.empty()) { diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc index bb4f54d..cd3951a 100644 --- a/chrome/renderer/user_script_slave.cc +++ b/chrome/renderer/user_script_slave.cc @@ -112,11 +112,11 @@ bool UserScriptSlave::InjectScripts(WebFrame* frame, } if (location == UserScript::DOCUMENT_START) { - HISTOGRAM_COUNTS_100(L"UserScripts:DocStart:Count", num_matched); - HISTOGRAM_TIMES(L"UserScripts:DocStart:Time", timer.Elapsed()); + HISTOGRAM_COUNTS_100("UserScripts:DocStart:Count", num_matched); + HISTOGRAM_TIMES("UserScripts:DocStart:Time", timer.Elapsed()); } else { - HISTOGRAM_COUNTS_100(L"UserScripts:DocEnd:Count", num_matched); - HISTOGRAM_TIMES(L"UserScripts:DocEnd:Time", timer.Elapsed()); + HISTOGRAM_COUNTS_100("UserScripts:DocEnd:Count", num_matched); + HISTOGRAM_TIMES("UserScripts:DocEnd:Time", timer.Elapsed()); } return true; diff --git a/chrome/views/focus_manager.cc b/chrome/views/focus_manager.cc index 923d3d1..f18cc2c 100644 --- a/chrome/views/focus_manager.cc +++ b/chrome/views/focus_manager.cc @@ -230,7 +230,7 @@ void FocusManager::InstallFocusSubclass(HWND window, View* view) { !win_util::IsSubclassed(window, &FocusWindowCallback)) { NOTREACHED() << "window sub-classed by someone other than the FocusManager"; // Track in UMA so we know if this case happens. - UMA_HISTOGRAM_COUNTS(L"FocusManager.MultipleSubclass", 1); + UMA_HISTOGRAM_COUNTS("FocusManager.MultipleSubclass", 1); } else { win_util::Subclass(window, &FocusWindowCallback); SetProp(window, kFocusSubclassInstalled, reinterpret_cast<HANDLE>(true)); @@ -842,4 +842,3 @@ void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) { } } // namespace views - diff --git a/net/base/connection_type_histograms.cc b/net/base/connection_type_histograms.cc index a5c6610..6e4a929 100644 --- a/net/base/connection_type_histograms.cc +++ b/net/base/connection_type_histograms.cc @@ -22,10 +22,10 @@ namespace net { // expansion. void UpdateConnectionTypeHistograms(ConnectionType type) { static bool had_connection_type[NUM_OF_CONNECTION_TYPES]; - static LinearHistogram counter1(L"Net.HadConnectionType", + static LinearHistogram counter1("Net.HadConnectionType", 1, NUM_OF_CONNECTION_TYPES, NUM_OF_CONNECTION_TYPES + 1); - static LinearHistogram counter2(L"Net.ConnectionTypeCount", + static LinearHistogram counter2("Net.ConnectionTypeCount", 1, NUM_OF_CONNECTION_TYPES, NUM_OF_CONNECTION_TYPES + 1); diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc index 1ab71df..0a6c201 100644 --- a/net/base/file_stream_win.cc +++ b/net/base/file_stream_win.cc @@ -78,7 +78,7 @@ FileStream::AsyncContext::~AsyncContext() { } if (waited) { // We want to see if we block the message loop for too long. - UMA_HISTOGRAM_TIMES(L"AsyncIO.FileStreamClose", base::Time::Now() - start); + UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose", base::Time::Now() - start); } } @@ -288,4 +288,3 @@ int FileStream::Write( } } // namespace net - diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc index da117e2..d982f85 100644 --- a/net/base/mime_sniffer.cc +++ b/net/base/mime_sniffer.cc @@ -103,7 +103,7 @@ namespace { class SnifferHistogram : public LinearHistogram { public: - SnifferHistogram(const wchar_t* name, int array_size) + SnifferHistogram(const char* name, int array_size) : LinearHistogram(name, 0, array_size - 1, array_size) { SetFlags(kUmaTargetedHistogramFlag); } @@ -273,7 +273,7 @@ static bool SniffForHTML(const char* content, size_t size, if (!IsAsciiWhitespace(*pos)) break; } - static SnifferHistogram counter(L"mime_sniffer.kSniffableTags2", + static SnifferHistogram counter("mime_sniffer.kSniffableTags2", arraysize(kSniffableTags)); // |pos| now points to first non-whitespace character (or at end). return CheckForMagicNumbers(pos, end - pos, @@ -284,7 +284,7 @@ static bool SniffForHTML(const char* content, size_t size, static bool SniffForMagicNumbers(const char* content, size_t size, std::string* result) { // Check our big table of Magic Numbers - static SnifferHistogram counter(L"mime_sniffer.kMagicNumbers2", + static SnifferHistogram counter("mime_sniffer.kMagicNumbers2", arraysize(kMagicNumbers)); return CheckForMagicNumbers(content, size, kMagicNumbers, arraysize(kMagicNumbers), @@ -320,7 +320,7 @@ static bool SniffXML(const char* content, size_t size, std::string* result) { // We want to skip XML processing instructions (of the form "<?xml ...") // and stop at the first "plain" tag, then make a decision on the mime-type // based on the name (or possibly attributes) of that tag. - static SnifferHistogram counter(L"mime_sniffer.kMagicXML2", + static SnifferHistogram counter("mime_sniffer.kMagicXML2", arraysize(kMagicXML)); const int kMaxTagIterations = 5; for (int i = 0; i < kMaxTagIterations && pos < end; ++i) { @@ -387,7 +387,7 @@ static char kByteLooksBinary[] = { static bool LooksBinary(const char* content, size_t size) { // First, we look for a BOM. - static SnifferHistogram counter(L"mime_sniffer.kByteOrderMark2", + static SnifferHistogram counter("mime_sniffer.kByteOrderMark2", arraysize(kByteOrderMark)); std::string unused; if (CheckForMagicNumbers(content, size, @@ -421,7 +421,7 @@ static bool IsUnknownMimeType(const std::string& mime_type) { // Firefox rejects a mime type if it is exactly */* "*/*", }; - static SnifferHistogram counter(L"mime_sniffer.kUnknownMimeTypes2", + static SnifferHistogram counter("mime_sniffer.kUnknownMimeTypes2", arraysize(kUnknownMimeTypes) + 1); for (size_t i = 0; i < arraysize(kUnknownMimeTypes); ++i) { if (mime_type == kUnknownMimeTypes[i]) { @@ -439,7 +439,7 @@ static bool IsUnknownMimeType(const std::string& mime_type) { bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) { static SnifferHistogram should_sniff_counter( - L"mime_sniffer.ShouldSniffMimeType2", 3); + "mime_sniffer.ShouldSniffMimeType2", 3); // We are willing to sniff the mime type for HTTP, HTTPS, and FTP bool sniffable_scheme = url.is_empty() || url.SchemeIs("http") || @@ -463,7 +463,7 @@ bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) { "text/xml", "application/xml", }; - static SnifferHistogram counter(L"mime_sniffer.kSniffableTypes2", + static SnifferHistogram counter("mime_sniffer.kSniffableTypes2", arraysize(kSniffableTypes) + 1); for (size_t i = 0; i < arraysize(kSniffableTypes); ++i) { if (mime_type == kSniffableTypes[i]) { @@ -555,4 +555,3 @@ bool SniffMimeType(const char* content, size_t content_size, } } // namespace net - diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc index 37d5871..9309de6 100644 --- a/net/base/sdch_filter.cc +++ b/net/base/sdch_filter.cc @@ -31,7 +31,7 @@ SdchFilter::~SdchFilter() { static int filter_use_count = 0; ++filter_use_count; if (META_REFRESH_RECOVERY == decoding_status_) { - UMA_HISTOGRAM_COUNTS(L"Sdch.FilterUseBeforeDisabling", filter_use_count); + UMA_HISTOGRAM_COUNTS("Sdch.FilterUseBeforeDisabling", filter_use_count); } if (vcdiff_streaming_decoder_.get()) { @@ -53,46 +53,46 @@ SdchFilter::~SdchFilter() { // considered (per suggestion from Jake Brutlag). if (10 >= duration.InMinutes()) { if (DECODING_IN_PROGRESS == decoding_status_) { - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_Latency_F", duration, + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Decode_Latency_F", duration, base::TimeDelta::FromMilliseconds(20), base::TimeDelta::FromMinutes(10), 100); - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_1st_To_Last", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Decode_1st_To_Last", read_times_.back() - read_times_[0], base::TimeDelta::FromMilliseconds(20), base::TimeDelta::FromMinutes(10), 100); if (read_times_.size() > 3) { - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_3rd_To_4th", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Decode_3rd_To_4th", read_times_[3] - read_times_[2], base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromSeconds(3), 100); - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_2nd_To_3rd", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Decode_2nd_To_3rd", read_times_[2] - read_times_[1], base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromSeconds(3), 100); } - UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Decode_Reads", + UMA_HISTOGRAM_COUNTS_100("Sdch.Network_Decode_Reads", read_times_.size()); - UMA_HISTOGRAM_COUNTS(L"Sdch.Network_Decode_Bytes_Read", output_bytes_); + UMA_HISTOGRAM_COUNTS("Sdch.Network_Decode_Bytes_Read", output_bytes_); } else if (PASS_THROUGH == decoding_status_) { - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_Latency_F", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Pass-through_Latency_F", duration, base::TimeDelta::FromMilliseconds(20), base::TimeDelta::FromMinutes(10), 100); - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_1st_To_Last", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Pass-through_1st_To_Last", read_times_.back() - read_times_[0], base::TimeDelta::FromMilliseconds(20), base::TimeDelta::FromMinutes(10), 100); if (read_times_.size() > 3) { - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_3rd_To_4th", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Pass-through_3rd_To_4th", read_times_[3] - read_times_[2], base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromSeconds(3), 100); - UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_2nd_To_3rd", + UMA_HISTOGRAM_CLIPPED_TIMES("Sdch.Network_Pass-through_2nd_To_3rd", read_times_[2] - read_times_[1], base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromSeconds(3), 100); } - UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Pass-through_Reads", + UMA_HISTOGRAM_COUNTS_100("Sdch.Network_Pass-through_Reads", read_times_.size()); } } diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index 1f1ff0a..de17905 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -32,7 +32,7 @@ SdchManager* SdchManager::Global() { // static void SdchManager::SdchErrorRecovery(ProblemCodes problem) { - static LinearHistogram histogram(L"Sdch.ProblemCodes_2", MIN_PROBLEM_CODE, + static LinearHistogram histogram("Sdch.ProblemCodes_2", MIN_PROBLEM_CODE, MAX_PROBLEM_CODE - 1, MAX_PROBLEM_CODE); histogram.SetFlags(kUmaTargetedHistogramFlag); histogram.Add(problem); @@ -263,7 +263,7 @@ bool SdchManager::AddSdchDictionary(const std::string& dictionary_text, return false; } - UMA_HISTOGRAM_COUNTS(L"Sdch.Dictionary size loaded", dictionary_text.size()); + UMA_HISTOGRAM_COUNTS("Sdch.Dictionary size loaded", dictionary_text.size()); DLOG(INFO) << "Loaded dictionary with client hash " << client_hash << " and server hash " << server_hash; Dictionary* dictionary = @@ -304,7 +304,7 @@ void SdchManager::GetAvailDictionaryList(const GURL& target_url, } // Watch to see if we have corrupt or numerous dictionaries. if (count > 0) - UMA_HISTOGRAM_COUNTS(L"Sdch.Advertisement_Count", count); + UMA_HISTOGRAM_COUNTS("Sdch.Advertisement_Count", count); } SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc index 4a7a9e4..3565567 100644 --- a/net/base/x509_certificate.cc +++ b/net/base/x509_certificate.cc @@ -139,7 +139,7 @@ X509Certificate* X509Certificate::CreateFromHandle(OSCertHandle cert_handle, // We've found a certificate with the same fingerprint in our cache. We // own the |cert_handle|, which makes it our job to free it. FreeOSCertHandle(cert_handle); - DHISTOGRAM_COUNTS(L"X509CertificateReuseCount", 1); + DHISTOGRAM_COUNTS("X509CertificateReuseCount", 1); return cached_cert; } // Kick out the old certificate from our cache. The new one is better. @@ -193,4 +193,3 @@ bool X509Certificate::IsEV(int status) const { #endif } // namespace net - diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index a078bc4..52d8f65 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -276,7 +276,7 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) { DCHECK(entry); *entry = cache_entry; - UMA_HISTOGRAM_TIMES(L"DiskCache.OpenTime", Time::Now() - start); + UMA_HISTOGRAM_TIMES("DiskCache.OpenTime", Time::Now() - start); stats_.OnEvent(Stats::OPEN_HIT); return true; } @@ -349,7 +349,7 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) { *entry = NULL; cache_entry.swap(reinterpret_cast<EntryImpl**>(entry)); - UMA_HISTOGRAM_TIMES(L"DiskCache.CreateTime", Time::Now() - start); + UMA_HISTOGRAM_TIMES("DiskCache.CreateTime", Time::Now() - start); stats_.OnEvent(Stats::CREATE_HIT); Trace("create entry hit "); return true; @@ -651,7 +651,7 @@ void BackendImpl::CriticalError(int error) { } void BackendImpl::ReportError(int error) { - static LinearHistogram counter(L"DiskCache.Error", 0, 49, 50); + static LinearHistogram counter("DiskCache.Error", 0, 49, 50); counter.SetFlags(kUmaTargetedHistogramFlag); // We transmit positive numbers, instead of direct error codes. @@ -679,9 +679,9 @@ void BackendImpl::OnStatsTimer() { if (first_time) { first_time = false; int experiment = data_->header.experiment; - std::wstring entries(StringPrintf(L"DiskCache.Entries_%d", experiment)); - std::wstring size(StringPrintf(L"DiskCache.Size_%d", experiment)); - std::wstring max_size(StringPrintf(L"DiskCache.MaxSize_%d", experiment)); + std::string entries(StringPrintf("DiskCache.Entries_%d", experiment)); + std::string size(StringPrintf("DiskCache.Size_%d", experiment)); + std::string max_size(StringPrintf("DiskCache.MaxSize_%d", experiment)); UMA_HISTOGRAM_COUNTS(entries.c_str(), data_->header.num_entries); UMA_HISTOGRAM_COUNTS(size.c_str(), data_->header.num_bytes / (1024 * 1024)); UMA_HISTOGRAM_COUNTS(max_size.c_str(), max_size_ / (1024 * 1024)); diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index 84c03b9..63a7c2e 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -66,7 +66,7 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header, if (target != size) { header->empty[target - size - 1]++; } - HISTOGRAM_TIMES(L"DiskCache.CreateBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.CreateBlock", Time::Now() - start); return true; } } @@ -114,7 +114,7 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) { } header->num_entries--; DCHECK(header->num_entries >= 0); - HISTOGRAM_TIMES(L"DiskCache.DeleteBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.DeleteBlock", Time::Now() - start); } // Restores the "empty counters" and allocation hints. @@ -323,7 +323,7 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) { return NULL; break; } - HISTOGRAM_TIMES(L"DiskCache.GetFileForNewBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", Time::Now() - start); return file; } diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc index a8f9ad1..b64073a 100644 --- a/net/disk_cache/entry_impl.cc +++ b/net/disk_cache/entry_impl.cc @@ -90,8 +90,8 @@ EntryImpl::EntryImpl(BackendImpl* backend, Addr address) // written before). EntryImpl::~EntryImpl() { if (doomed_) { - UMA_HISTOGRAM_COUNTS(L"DiskCache.DeleteHeader", GetDataSize(0)); - UMA_HISTOGRAM_COUNTS(L"DiskCache.DeleteData", GetDataSize(1)); + UMA_HISTOGRAM_COUNTS("DiskCache.DeleteHeader", GetDataSize(0)); + UMA_HISTOGRAM_COUNTS("DiskCache.DeleteData", GetDataSize(1)); for (int index = 0; index < NUM_STREAMS; index++) { Addr address(entry_.Data()->data_addr[index]); if (address.is_initialized()) { @@ -211,7 +211,7 @@ int EntryImpl::ReadData(int index, int offset, net::IOBuffer* buf, int buf_len, return net::ERR_INVALID_ARGUMENT; Time start = Time::Now(); - static Histogram stats(L"DiskCache.ReadTime", TimeDelta::FromMilliseconds(1), + static Histogram stats("DiskCache.ReadTime", TimeDelta::FromMilliseconds(1), TimeDelta::FromSeconds(10), 50); stats.SetFlags(kUmaTargetedHistogramFlag); @@ -285,7 +285,7 @@ int EntryImpl::WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, } Time start = Time::Now(); - static Histogram stats(L"DiskCache.WriteTime", TimeDelta::FromMilliseconds(1), + static Histogram stats("DiskCache.WriteTime", TimeDelta::FromMilliseconds(1), TimeDelta::FromSeconds(10), 50); stats.SetFlags(kUmaTargetedHistogramFlag); @@ -557,7 +557,7 @@ void EntryImpl::DeleteData(Addr address, int index) { files_[index] = NULL; // Releases the object. if (!DeleteCacheFile(backend_->GetFileName(address))) { - UMA_HISTOGRAM_COUNTS(L"DiskCache.DeleteFailed", 1); + UMA_HISTOGRAM_COUNTS("DiskCache.DeleteFailed", 1); LOG(ERROR) << "Failed to delete " << backend_->GetFileName(address) << " from the cache."; } @@ -785,4 +785,3 @@ void EntryImpl::Log(const char* msg) { } } // namespace disk_cache - diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index 11ff969..11bce72 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -80,7 +80,7 @@ void Eviction::TrimCache(bool empty) { } } - UMA_HISTOGRAM_TIMES(L"DiskCache.TotalTrimTime", Time::Now() - start); + UMA_HISTOGRAM_TIMES("DiskCache.TotalTrimTime", Time::Now() - start); Trace("*** Trim Cache end ***"); return; } @@ -107,8 +107,8 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) { static bool first_time = true; if (first_time) { first_time = false; - std::wstring name(StringPrintf(L"DiskCache.TrimAge_%d", - header_->experiment)); + std::string name(StringPrintf("DiskCache.TrimAge_%d", + header_->experiment)); static Histogram counter(name.c_str(), 1, 10000, 50); counter.SetFlags(kUmaTargetedHistogramFlag); counter.Add((Time::Now() - entry->GetLastUsed()).InHours()); diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc index d786077..01a7222 100644 --- a/net/disk_cache/rankings.cc +++ b/net/disk_cache/rankings.cc @@ -234,7 +234,7 @@ bool Rankings::GetRanking(CacheRankingsBlock* rankings) { EntryImpl* cache_entry = reinterpret_cast<EntryImpl*>(rankings->Data()->pointer); rankings->SetData(cache_entry->rankings()->Data()); - UMA_HISTOGRAM_TIMES(L"DiskCache.GetRankings", Time::Now() - start); + UMA_HISTOGRAM_TIMES("DiskCache.GetRankings", Time::Now() - start); return true; } @@ -389,7 +389,7 @@ void Rankings::UpdateRank(CacheRankingsBlock* node, bool modified, List list) { Time start = Time::Now(); Remove(node, list); Insert(node, modified, list); - UMA_HISTOGRAM_TIMES(L"DiskCache.UpdateRank", Time::Now() - start); + UMA_HISTOGRAM_TIMES("DiskCache.UpdateRank", Time::Now() - start); } void Rankings::CompleteTransaction() { diff --git a/net/disk_cache/stats.cc b/net/disk_cache/stats.cc index 7c49e5c..a6733cb 100644 --- a/net/disk_cache/stats.cc +++ b/net/disk_cache/stats.cc @@ -123,7 +123,7 @@ bool Stats::Init(BackendImpl* backend, uint32* storage_addr) { if (!size_histogram_.get()) { // Stats may be reused when the cache is re-created, but we want only one // histogram at any given time. - size_histogram_.reset(new StatsHistogram(L"DiskCache.SizeStats")); + size_histogram_.reset(new StatsHistogram("DiskCache.SizeStats")); size_histogram_->Init(this); } @@ -267,4 +267,3 @@ void Stats::GetItems(StatsItems* items) { } } // namespace disk_cache - diff --git a/net/disk_cache/stats_histogram.h b/net/disk_cache/stats_histogram.h index 4dd76cc..8db3bb3 100644 --- a/net/disk_cache/stats_histogram.h +++ b/net/disk_cache/stats_histogram.h @@ -23,7 +23,7 @@ class StatsHistogram : public Histogram { } }; - explicit StatsHistogram(const wchar_t* name) + explicit StatsHistogram(const char* name) : Histogram(name, 1, 1, 2), init_(false) {} ~StatsHistogram(); @@ -43,4 +43,3 @@ class StatsHistogram : public Histogram { } // namespace disk_cache #endif // NET_DISK_CACHE_STATS_HISTOGRAM_H_ - diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index eecb2f4..0e4f5b7 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -893,10 +893,10 @@ void HttpNetworkTransaction::LogTransactionMetrics() const { base::TimeDelta duration = base::Time::Now() - response_.request_time; if (60 < duration.InMinutes()) return; - UMA_HISTOGRAM_LONG_TIMES(L"Net.Transaction_Latency", duration); + UMA_HISTOGRAM_LONG_TIMES("Net.Transaction_Latency", duration); if (!duration.InMilliseconds()) return; - UMA_HISTOGRAM_COUNTS(L"Net.Transaction_Bandwidth", + UMA_HISTOGRAM_COUNTS("Net.Transaction_Bandwidth", static_cast<int> (content_read_ / duration.InMilliseconds())); } diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index aa7ab83..6065846 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc @@ -27,9 +27,9 @@ static BOOL CallWinHttpGetProxyForUrl(HINTERNET session, LPCWSTR url, // Record separately success and failure times since they will have very // different characteristics. if (rv) { - UMA_HISTOGRAM_LONG_TIMES(L"Net.GetProxyForUrl_OK", time_delta); + UMA_HISTOGRAM_LONG_TIMES("Net.GetProxyForUrl_OK", time_delta); } else { - UMA_HISTOGRAM_LONG_TIMES(L"Net.GetProxyForUrl_FAIL", time_delta); + UMA_HISTOGRAM_LONG_TIMES("Net.GetProxyForUrl_FAIL", time_delta); } return rv; } @@ -159,4 +159,3 @@ void ProxyResolverWinHttp::CloseWinHttpSession() { } } // namespace net - |