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

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

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. 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
474 void MetricsService::SetRecording(bool enabled) { 478 void MetricsService::SetRecording(bool enabled) {
475 DCHECK(IsSingleThreaded()); 479 DCHECK(IsSingleThreaded());
476 480
477 if (enabled == recording_active_) 481 if (enabled == recording_active_)
478 return; 482 return;
479 483
480 if (enabled) { 484 if (enabled) {
481 if (client_id_.empty()) { 485 if (client_id_.empty()) {
482 PrefService* pref = g_browser_process->local_state(); 486 PrefService* pref = g_browser_process->local_state();
483 DCHECK(pref); 487 DCHECK(pref);
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 thread_id = base::PlatformThread::CurrentId(); 1689 thread_id = base::PlatformThread::CurrentId();
1686 return base::PlatformThread::CurrentId() == thread_id; 1690 return base::PlatformThread::CurrentId() == thread_id;
1687 } 1691 }
1688 1692
1689 #if defined(OS_CHROMEOS) 1693 #if defined(OS_CHROMEOS)
1690 void MetricsService::StartExternalMetrics() { 1694 void MetricsService::StartExternalMetrics() {
1691 external_metrics_ = new chromeos::ExternalMetrics; 1695 external_metrics_ = new chromeos::ExternalMetrics;
1692 external_metrics_->Start(); 1696 external_metrics_->Start();
1693 } 1697 }
1694 #endif 1698 #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