Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/metrics/metrics_service.cc

Issue 13583007: Create a field trial to test if we can detect good QPC implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/cpu.cc ('k') | chrome/browser/metrics/time_ticks_experiment_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 #include "base/values.h" 172 #include "base/values.h"
173 #include "chrome/browser/autocomplete/autocomplete_log.h" 173 #include "chrome/browser/autocomplete/autocomplete_log.h"
174 #include "chrome/browser/browser_process.h" 174 #include "chrome/browser/browser_process.h"
175 #include "chrome/browser/extensions/extension_service.h" 175 #include "chrome/browser/extensions/extension_service.h"
176 #include "chrome/browser/extensions/process_map.h" 176 #include "chrome/browser/extensions/process_map.h"
177 #include "chrome/browser/io_thread.h" 177 #include "chrome/browser/io_thread.h"
178 #include "chrome/browser/memory_details.h" 178 #include "chrome/browser/memory_details.h"
179 #include "chrome/browser/metrics/metrics_log.h" 179 #include "chrome/browser/metrics/metrics_log.h"
180 #include "chrome/browser/metrics/metrics_log_serializer.h" 180 #include "chrome/browser/metrics/metrics_log_serializer.h"
181 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" 181 #include "chrome/browser/metrics/metrics_reporting_scheduler.h"
182 #include "chrome/browser/metrics/time_ticks_experiment_win.h"
182 #include "chrome/browser/metrics/tracking_synchronizer.h" 183 #include "chrome/browser/metrics/tracking_synchronizer.h"
183 #include "chrome/browser/net/http_pipelining_compatibility_client.h" 184 #include "chrome/browser/net/http_pipelining_compatibility_client.h"
184 #include "chrome/browser/net/network_stats.h" 185 #include "chrome/browser/net/network_stats.h"
185 #include "chrome/browser/prefs/scoped_user_pref_update.h" 186 #include "chrome/browser/prefs/scoped_user_pref_update.h"
186 #include "chrome/browser/profiles/profile.h" 187 #include "chrome/browser/profiles/profile.h"
187 #include "chrome/browser/search_engines/template_url_service.h" 188 #include "chrome/browser/search_engines/template_url_service.h"
188 #include "chrome/browser/ui/browser_list.h" 189 #include "chrome/browser/ui/browser_list.h"
189 #include "chrome/browser/ui/browser_otr_state.h" 190 #include "chrome/browser/ui/browser_otr_state.h"
190 #include "chrome/common/child_process_logging.h" 191 #include "chrome/common/child_process_logging.h"
191 #include "chrome/common/chrome_process_type.h" 192 #include "chrome/common/chrome_process_type.h"
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 // don't consider that a sign that the server is in trouble. 1479 // don't consider that a sign that the server is in trouble.
1479 bool server_is_healthy = upload_succeeded || response_code == 400; 1480 bool server_is_healthy = upload_succeeded || response_code == 400;
1480 scheduler_->UploadFinished(server_is_healthy, log_manager_.has_unsent_logs()); 1481 scheduler_->UploadFinished(server_is_healthy, log_manager_.has_unsent_logs());
1481 1482
1482 // Collect network stats if UMA upload succeeded. 1483 // Collect network stats if UMA upload succeeded.
1483 IOThread* io_thread = g_browser_process->io_thread(); 1484 IOThread* io_thread = g_browser_process->io_thread();
1484 if (server_is_healthy && io_thread) { 1485 if (server_is_healthy && io_thread) {
1485 chrome_browser_net::CollectNetworkStats(network_stats_server_, io_thread); 1486 chrome_browser_net::CollectNetworkStats(network_stats_server_, io_thread);
1486 chrome_browser_net::CollectPipeliningCapabilityStatsOnUIThread( 1487 chrome_browser_net::CollectPipeliningCapabilityStatsOnUIThread(
1487 http_pipelining_test_server_, io_thread); 1488 http_pipelining_test_server_, io_thread);
1489 #if defined(OS_WIN)
1490 chrome::CollectTimeTicksStats();
1491 #endif
1488 } 1492 }
1489 } 1493 }
1490 1494
1491 void MetricsService::LogWindowOrTabChange(int type, uintptr_t window_or_tab) { 1495 void MetricsService::LogWindowOrTabChange(int type, uintptr_t window_or_tab) {
1492 int controller_id = -1; 1496 int controller_id = -1;
1493 MetricsLog::WindowEventType window_type; 1497 MetricsLog::WindowEventType window_type;
1494 1498
1495 // Note: since we stop all logging when a single OTR session is active, it is 1499 // Note: since we stop all logging when a single OTR session is active, it is
1496 // possible that we start getting notifications about a window that we don't 1500 // possible that we start getting notifications about a window that we don't
1497 // know about. 1501 // know about.
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 if (local_state) { 1808 if (local_state) {
1805 const PrefService::Preference* uma_pref = 1809 const PrefService::Preference* uma_pref =
1806 local_state->FindPreference(prefs::kMetricsReportingEnabled); 1810 local_state->FindPreference(prefs::kMetricsReportingEnabled);
1807 if (uma_pref) { 1811 if (uma_pref) {
1808 bool success = uma_pref->GetValue()->GetAsBoolean(&result); 1812 bool success = uma_pref->GetValue()->GetAsBoolean(&result);
1809 DCHECK(success); 1813 DCHECK(success);
1810 } 1814 }
1811 } 1815 }
1812 return result; 1816 return result;
1813 } 1817 }
OLDNEW
« no previous file with comments | « base/cpu.cc ('k') | chrome/browser/metrics/time_ticks_experiment_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698