diff options
author | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 19:08:23 +0000 |
---|---|---|
committer | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 19:08:23 +0000 |
commit | 553dba6dd707ee02e609910462d2b7977f284af2 (patch) | |
tree | c38ea1fbfb3a1d387134541faa9bdfc0720234cf /chrome/browser | |
parent | 0e7fe5cab991f8751ecaa6cd43ff7e51d9647dde (diff) | |
download | chromium_src-553dba6dd707ee02e609910462d2b7977f284af2.zip chromium_src-553dba6dd707ee02e609910462d2b7977f284af2.tar.gz chromium_src-553dba6dd707ee02e609910462d2b7977f284af2.tar.bz2 |
Use string for Histogram names since these are all ASCII anyway.
Wide-character literals cause problems between platforms.
Review URL: http://codereview.chromium.org/28046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
23 files changed, 105 insertions, 110 deletions
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. |