Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service.cc |
| diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc |
| index 5326973085ee8cfe2f352d1877e4aefd3cea4a3c..d8bb38e2a342e3ee4d5dca68a5068b4627a2f12b 100644 |
| --- a/chrome/browser/metrics/metrics_service.cc |
| +++ b/chrome/browser/metrics/metrics_service.cc |
| @@ -208,12 +208,6 @@ |
| #include "chrome/browser/metrics/plugin_metrics_provider.h" |
| #endif |
| -#if defined(OS_CHROMEOS) |
| -#include "chrome/browser/chromeos/settings/cros_settings.h" |
| -#include "chrome/browser/metrics/chromeos_metrics_provider.h" |
| -#include "chromeos/system/statistics_provider.h" |
| -#endif |
| - |
| #if defined(OS_WIN) |
| #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
| #endif |
| @@ -224,7 +218,6 @@ |
| #endif |
| using base::Time; |
| -using content::BrowserThread; |
| using metrics::MetricsLogManager; |
| namespace { |
| @@ -418,10 +411,6 @@ MetricsService::MetricsService(metrics::MetricsStateManager* state_manager, |
| plugin_metrics_provider_)); |
| #endif |
| -#if defined(OS_CHROMEOS) |
| - RegisterMetricsProvider( |
| - scoped_ptr<metrics::MetricsProvider>(new ChromeOSMetricsProvider)); |
| -#endif |
| } |
| MetricsService::~MetricsService() { |
| @@ -699,27 +688,8 @@ void MetricsService::InitializeMetricsState() { |
| ScheduleNextStateSave(); |
| } |
| -// static |
| -void MetricsService::InitTaskGetHardwareClass( |
| - base::WeakPtr<MetricsService> self, |
| - base::MessageLoopProxy* target_loop) { |
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| - |
| - std::string hardware_class; |
| -#if defined(OS_CHROMEOS) |
| - chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( |
| - "hardware_class", &hardware_class); |
| -#endif // OS_CHROMEOS |
| - |
| - target_loop->PostTask(FROM_HERE, |
| - base::Bind(&MetricsService::OnInitTaskGotHardwareClass, |
| - self, hardware_class)); |
| -} |
| - |
| -void MetricsService::OnInitTaskGotHardwareClass( |
| - const std::string& hardware_class) { |
| +void MetricsService::OnInitTaskGotHardwareClass() { |
| DCHECK_EQ(INIT_TASK_SCHEDULED, state_); |
| - hardware_class_ = hardware_class; |
| const base::Closure got_plugin_info_callback = |
| base::Bind(&MetricsService::OnInitTaskGotPluginInfo, |
| @@ -857,22 +827,11 @@ void MetricsService::OpenNewLog() { |
| // We only need to schedule that run once. |
| state_ = INIT_TASK_SCHEDULED; |
| - // TODO(blundell): Change the callback to be |
| - // FinishedReceivingProfilerData() when the initial metrics gathering is |
| - // moved to ChromeMetricsServiceClient. |
| - client_->StartGatheringMetrics(base::Bind(&base::DoNothing)); |
| - |
| - // Schedules a task on the file thread for execution of slower |
| - // initialization steps (such as plugin list generation) necessary |
| - // for sending the initial log. This avoids blocking the main UI |
| - // thread. |
| - BrowserThread::PostDelayedTask( |
| - BrowserThread::FILE, |
| - FROM_HERE, |
| - base::Bind(&MetricsService::InitTaskGetHardwareClass, |
| - self_ptr_factory_.GetWeakPtr(), |
| - base::MessageLoop::current()->message_loop_proxy()), |
| - base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); |
| + // TODO(blundell): Move all initial metrics gathering to |
| + // ChromeMetricsServiceClient. |
| + client_->StartGatheringMetrics( |
| + base::Bind(&MetricsService::OnInitTaskGotHardwareClass, |
| + self_ptr_factory_.GetWeakPtr())); |
| } |
| } |
| @@ -889,9 +848,6 @@ void MetricsService::CloseCurrentLog() { |
| OpenNewLog(); // Start trivial log to hold our histograms. |
| } |
| - // Adds to ongoing logs. |
| - log_manager_.current_log()->set_hardware_class(hardware_class_); |
|
blundell
2014/05/27 13:14:19
Two questions here:
(1) The timing of these calls
Alexei Svitkine (slow)
2014/05/27 13:56:37
I don't think so.
blundell
2014/05/27 14:58:10
Done.
|
| - |
| // Put incremental data (histogram deltas, and realtime stats deltas) at the |
| // end of all log transmissions (initial log handles this separately). |
| // RecordIncrementalStabilityElements only exists on the derived |
| @@ -1113,7 +1069,6 @@ void MetricsService::PrepareInitialStabilityLog() { |
| void MetricsService::PrepareInitialMetricsLog() { |
| DCHECK(state_ == INIT_TASK_DONE || state_ == SENDING_INITIAL_STABILITY_LOG); |
| - initial_metrics_log_->set_hardware_class(hardware_class_); |
| std::vector<variations::ActiveGroupId> synthetic_trials; |
| GetCurrentSyntheticFieldTrials(&synthetic_trials); |