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

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

Issue 6931048: Revert 84197 - Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « chrome/browser/metrics/metrics_service.h ('k') | chrome/renderer/page_load_histograms.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 10 // A MetricsService instance is typically created at application startup. It
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 SetRecording(true); 464 SetRecording(true);
465 SetReporting(false); 465 SetReporting(false);
466 } 466 }
467 467
468 void MetricsService::Stop() { 468 void MetricsService::Stop() {
469 HandleIdleSinceLastTransmission(false); 469 HandleIdleSinceLastTransmission(false);
470 SetReporting(false); 470 SetReporting(false);
471 SetRecording(false); 471 SetRecording(false);
472 } 472 }
473 473
474 std::string MetricsService::GetClientId() {
475 return client_id_;
476 }
477
478 void MetricsService::SetRecording(bool enabled) { 474 void MetricsService::SetRecording(bool enabled) {
479 DCHECK(IsSingleThreaded()); 475 DCHECK(IsSingleThreaded());
480 476
481 if (enabled == recording_active_) 477 if (enabled == recording_active_)
482 return; 478 return;
483 479
484 if (enabled) { 480 if (enabled) {
485 if (client_id_.empty()) { 481 if (client_id_.empty()) {
486 PrefService* pref = g_browser_process->local_state(); 482 PrefService* pref = g_browser_process->local_state();
487 DCHECK(pref); 483 DCHECK(pref);
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 thread_id = base::PlatformThread::CurrentId(); 1685 thread_id = base::PlatformThread::CurrentId();
1690 return base::PlatformThread::CurrentId() == thread_id; 1686 return base::PlatformThread::CurrentId() == thread_id;
1691 } 1687 }
1692 1688
1693 #if defined(OS_CHROMEOS) 1689 #if defined(OS_CHROMEOS)
1694 void MetricsService::StartExternalMetrics() { 1690 void MetricsService::StartExternalMetrics() {
1695 external_metrics_ = new chromeos::ExternalMetrics; 1691 external_metrics_ = new chromeos::ExternalMetrics;
1696 external_metrics_->Start(); 1692 external_metrics_->Start();
1697 } 1693 }
1698 #endif 1694 #endif
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | chrome/renderer/page_load_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698