| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 6 |
| 7 //------------------------------------------------------------------------------ | 7 //------------------------------------------------------------------------------ |
| 8 // Description of the life cycle of a instance of MetricsService. | 8 // Description of the life cycle of a instance of MetricsService. |
| 9 // | 9 // |
| 10 // OVERVIEW | 10 // OVERVIEW |
| (...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 void MetricsService::RecordCurrentHistograms() { | 1872 void MetricsService::RecordCurrentHistograms() { |
| 1873 DCHECK(current_log_); | 1873 DCHECK(current_log_); |
| 1874 | 1874 |
| 1875 StatisticsRecorder::Histograms histograms; | 1875 StatisticsRecorder::Histograms histograms; |
| 1876 StatisticsRecorder::GetHistograms(&histograms); | 1876 StatisticsRecorder::GetHistograms(&histograms); |
| 1877 for (StatisticsRecorder::Histograms::iterator it = histograms.begin(); | 1877 for (StatisticsRecorder::Histograms::iterator it = histograms.begin(); |
| 1878 histograms.end() != it; | 1878 histograms.end() != it; |
| 1879 ++it) { | 1879 ++it) { |
| 1880 if ((*it)->flags() & kUmaTargetedHistogramFlag) | 1880 if ((*it)->flags() & Histogram::kUmaTargetedHistogramFlag) |
| 1881 // TODO(petersont): Only record historgrams if they are not precluded by | 1881 // TODO(petersont): Only record historgrams if they are not precluded by |
| 1882 // the UMA response data. | 1882 // the UMA response data. |
| 1883 // Bug http://code.google.com/p/chromium/issues/detail?id=2739. | 1883 // Bug http://code.google.com/p/chromium/issues/detail?id=2739. |
| 1884 RecordHistogram(**it); | 1884 RecordHistogram(**it); |
| 1885 } | 1885 } |
| 1886 } | 1886 } |
| 1887 | 1887 |
| 1888 void MetricsService::RecordHistogram(const Histogram& histogram) { | 1888 void MetricsService::RecordHistogram(const Histogram& histogram) { |
| 1889 // Get up-to-date snapshot of sample stats. | 1889 // Get up-to-date snapshot of sample stats. |
| 1890 Histogram::SampleSet snapshot; | 1890 Histogram::SampleSet snapshot; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1920 thread_id = PlatformThread::CurrentId(); | 1920 thread_id = PlatformThread::CurrentId(); |
| 1921 return PlatformThread::CurrentId() == thread_id; | 1921 return PlatformThread::CurrentId() == thread_id; |
| 1922 } | 1922 } |
| 1923 | 1923 |
| 1924 #if defined(OS_CHROMEOS) | 1924 #if defined(OS_CHROMEOS) |
| 1925 void MetricsService::StartExternalMetrics(Profile* profile) { | 1925 void MetricsService::StartExternalMetrics(Profile* profile) { |
| 1926 external_metrics_ = new chromeos::ExternalMetrics; | 1926 external_metrics_ = new chromeos::ExternalMetrics; |
| 1927 external_metrics_->Start(profile); | 1927 external_metrics_->Start(profile); |
| 1928 } | 1928 } |
| 1929 #endif | 1929 #endif |
| OLD | NEW |