OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/common/chrome_version_info.h" | 29 #include "chrome/common/chrome_version_info.h" |
30 #include "chrome/common/crash_keys.h" | 30 #include "chrome/common/crash_keys.h" |
31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
33 #include "components/metrics/gpu/gpu_metrics_provider.h" | 33 #include "components/metrics/gpu/gpu_metrics_provider.h" |
34 #include "components/metrics/metrics_service.h" | 34 #include "components/metrics/metrics_service.h" |
35 #include "components/metrics/net/net_metrics_log_uploader.h" | 35 #include "components/metrics/net/net_metrics_log_uploader.h" |
36 #include "components/metrics/net/network_metrics_provider.h" | 36 #include "components/metrics/net/network_metrics_provider.h" |
37 #include "components/metrics/profiler/profiler_metrics_provider.h" | 37 #include "components/metrics/profiler/profiler_metrics_provider.h" |
38 #include "components/metrics/profiler/tracking_synchronizer.h" | 38 #include "components/metrics/profiler/tracking_synchronizer.h" |
| 39 #include "components/metrics/url_constants.h" |
39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/histogram_fetcher.h" | 41 #include "content/public/browser/histogram_fetcher.h" |
41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
42 #include "content/public/browser/render_process_host.h" | 43 #include "content/public/browser/render_process_host.h" |
43 | 44 |
44 #if defined(OS_ANDROID) | 45 #if defined(OS_ANDROID) |
45 #include "chrome/browser/metrics/android_metrics_provider.h" | 46 #include "chrome/browser/metrics/android_metrics_provider.h" |
46 #endif | 47 #endif |
47 | 48 |
48 #if defined(ENABLE_PRINT_PREVIEW) | 49 #if defined(ENABLE_PRINT_PREVIEW) |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // Collect WebCore cache information to put into a histogram. | 230 // Collect WebCore cache information to put into a histogram. |
230 for (content::RenderProcessHost::iterator i( | 231 for (content::RenderProcessHost::iterator i( |
231 content::RenderProcessHost::AllHostsIterator()); | 232 content::RenderProcessHost::AllHostsIterator()); |
232 !i.IsAtEnd(); i.Advance()) { | 233 !i.IsAtEnd(); i.Advance()) { |
233 i.GetCurrentValue()->Send(new ChromeViewMsg_GetCacheResourceStats()); | 234 i.GetCurrentValue()->Send(new ChromeViewMsg_GetCacheResourceStats()); |
234 } | 235 } |
235 } | 236 } |
236 | 237 |
237 scoped_ptr<metrics::MetricsLogUploader> | 238 scoped_ptr<metrics::MetricsLogUploader> |
238 ChromeMetricsServiceClient::CreateUploader( | 239 ChromeMetricsServiceClient::CreateUploader( |
239 const std::string& server_url, | |
240 const std::string& mime_type, | |
241 const base::Callback<void(int)>& on_upload_complete) { | 240 const base::Callback<void(int)>& on_upload_complete) { |
242 return scoped_ptr<metrics::MetricsLogUploader>( | 241 return scoped_ptr<metrics::MetricsLogUploader>( |
243 new metrics::NetMetricsLogUploader( | 242 new metrics::NetMetricsLogUploader( |
244 g_browser_process->system_request_context(), server_url, mime_type, | 243 g_browser_process->system_request_context(), |
| 244 metrics::kDefaultMetricsServerUrl, |
| 245 metrics::kDefaultMetricsMimeType, |
245 on_upload_complete)); | 246 on_upload_complete)); |
246 } | 247 } |
247 | 248 |
248 base::string16 ChromeMetricsServiceClient::GetRegistryBackupKey() { | 249 base::string16 ChromeMetricsServiceClient::GetRegistryBackupKey() { |
249 #if defined(OS_WIN) | 250 #if defined(OS_WIN) |
250 return L"Software\\" PRODUCT_STRING_PATH L"\\StabilityMetrics"; | 251 return L"Software\\" PRODUCT_STRING_PATH L"\\StabilityMetrics"; |
251 #else | 252 #else |
252 return base::string16(); | 253 return base::string16(); |
253 #endif | 254 #endif |
254 } | 255 } |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 // Capture the histogram samples. | 546 // Capture the histogram samples. |
546 if (dumps_with_crash != 0) | 547 if (dumps_with_crash != 0) |
547 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 548 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
548 if (dumps_with_no_crash != 0) | 549 if (dumps_with_no_crash != 0) |
549 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 550 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
550 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 551 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
551 if (total_dumps != 0) | 552 if (total_dumps != 0) |
552 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 553 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
553 } | 554 } |
554 #endif // defined(OS_WIN) | 555 #endif // defined(OS_WIN) |
OLD | NEW |