| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It is | 10 // A MetricsService instance is typically created at application startup. It is |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 #include "chrome/browser/net/network_stats.h" | 200 #include "chrome/browser/net/network_stats.h" |
| 201 #include "chrome/browser/omnibox/omnibox_log.h" | 201 #include "chrome/browser/omnibox/omnibox_log.h" |
| 202 #include "chrome/browser/ui/browser_list.h" | 202 #include "chrome/browser/ui/browser_list.h" |
| 203 #include "chrome/browser/ui/browser_otr_state.h" | 203 #include "chrome/browser/ui/browser_otr_state.h" |
| 204 #include "chrome/browser/ui/search/search_tab_helper.h" | 204 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 205 #include "chrome/common/chrome_constants.h" | 205 #include "chrome/common/chrome_constants.h" |
| 206 #include "chrome/common/chrome_result_codes.h" | 206 #include "chrome/common/chrome_result_codes.h" |
| 207 #include "chrome/common/chrome_switches.h" | 207 #include "chrome/common/chrome_switches.h" |
| 208 #include "chrome/common/crash_keys.h" | 208 #include "chrome/common/crash_keys.h" |
| 209 #include "chrome/common/metrics/caching_permuted_entropy_provider.h" | 209 #include "chrome/common/metrics/caching_permuted_entropy_provider.h" |
| 210 #include "chrome/common/metrics/metrics_log_manager.h" | |
| 211 #include "chrome/common/net/test_server_locations.h" | 210 #include "chrome/common/net/test_server_locations.h" |
| 212 #include "chrome/common/pref_names.h" | 211 #include "chrome/common/pref_names.h" |
| 213 #include "chrome/common/render_messages.h" | 212 #include "chrome/common/render_messages.h" |
| 213 #include "components/metrics/metrics_log_manager.h" |
| 214 #include "components/variations/entropy_provider.h" | 214 #include "components/variations/entropy_provider.h" |
| 215 #include "components/variations/metrics_util.h" | 215 #include "components/variations/metrics_util.h" |
| 216 #include "content/public/browser/child_process_data.h" | 216 #include "content/public/browser/child_process_data.h" |
| 217 #include "content/public/browser/histogram_fetcher.h" | 217 #include "content/public/browser/histogram_fetcher.h" |
| 218 #include "content/public/browser/load_notification_details.h" | 218 #include "content/public/browser/load_notification_details.h" |
| 219 #include "content/public/browser/notification_service.h" | 219 #include "content/public/browser/notification_service.h" |
| 220 #include "content/public/browser/plugin_service.h" | 220 #include "content/public/browser/plugin_service.h" |
| 221 #include "content/public/browser/render_process_host.h" | 221 #include "content/public/browser/render_process_host.h" |
| 222 #include "content/public/browser/user_metrics.h" | 222 #include "content/public/browser/user_metrics.h" |
| 223 #include "content/public/browser/web_contents.h" | 223 #include "content/public/browser/web_contents.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 245 | 245 |
| 246 #if !defined(OS_ANDROID) | 246 #if !defined(OS_ANDROID) |
| 247 #include "chrome/browser/service_process/service_process_control.h" | 247 #include "chrome/browser/service_process/service_process_control.h" |
| 248 #endif | 248 #endif |
| 249 | 249 |
| 250 using base::Time; | 250 using base::Time; |
| 251 using content::BrowserThread; | 251 using content::BrowserThread; |
| 252 using content::ChildProcessData; | 252 using content::ChildProcessData; |
| 253 using content::LoadNotificationDetails; | 253 using content::LoadNotificationDetails; |
| 254 using content::PluginService; | 254 using content::PluginService; |
| 255 using metrics::MetricsLogManager; |
| 255 | 256 |
| 256 namespace { | 257 namespace { |
| 257 | 258 |
| 258 // Check to see that we're being called on only one thread. | 259 // Check to see that we're being called on only one thread. |
| 259 bool IsSingleThreaded() { | 260 bool IsSingleThreaded() { |
| 260 static base::PlatformThreadId thread_id = 0; | 261 static base::PlatformThreadId thread_id = 0; |
| 261 if (!thread_id) | 262 if (!thread_id) |
| 262 thread_id = base::PlatformThread::CurrentId(); | 263 thread_id = base::PlatformThread::CurrentId(); |
| 263 return base::PlatformThread::CurrentId() == thread_id; | 264 return base::PlatformThread::CurrentId() == thread_id; |
| 264 } | 265 } |
| (...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 // Android has its own settings for metrics / crash uploading. | 2075 // Android has its own settings for metrics / crash uploading. |
| 2075 const PrefService* prefs = g_browser_process->local_state(); | 2076 const PrefService* prefs = g_browser_process->local_state(); |
| 2076 return prefs->GetBoolean(prefs::kCrashReportingEnabled); | 2077 return prefs->GetBoolean(prefs::kCrashReportingEnabled); |
| 2077 #else | 2078 #else |
| 2078 return MetricsServiceHelper::IsMetricsReportingEnabled(); | 2079 return MetricsServiceHelper::IsMetricsReportingEnabled(); |
| 2079 #endif | 2080 #endif |
| 2080 #else | 2081 #else |
| 2081 return false; | 2082 return false; |
| 2082 #endif | 2083 #endif |
| 2083 } | 2084 } |
| OLD | NEW |