| Index: chrome/browser/metrics/metrics_service.cc
|
| ===================================================================
|
| --- chrome/browser/metrics/metrics_service.cc (revision 271296)
|
| +++ chrome/browser/metrics/metrics_service.cc (working copy)
|
| @@ -1168,15 +1168,17 @@
|
| DCHECK(current_log);
|
| std::vector<chrome_variations::ActiveGroupId> synthetic_trials;
|
| GetCurrentSyntheticFieldTrials(&synthetic_trials);
|
| - current_log->RecordEnvironment(plugins_, google_update_metrics_,
|
| - synthetic_trials);
|
| + current_log->RecordEnvironment(data_providers_.get(), plugins_,
|
| + google_update_metrics_, synthetic_trials);
|
| PrefService* pref = g_browser_process->local_state();
|
| base::TimeDelta incremental_uptime;
|
| base::TimeDelta uptime;
|
| GetUptimes(pref, &incremental_uptime, &uptime);
|
| - current_log->RecordStabilityMetrics(incremental_uptime, uptime);
|
| + current_log->RecordStabilityMetrics(data_providers_.get(), incremental_uptime,
|
| + uptime);
|
|
|
| RecordCurrentHistograms();
|
| + current_log->RecordGeneralMetrics(data_providers_.get());
|
|
|
| log_manager_.FinishCurrentLog();
|
| }
|
| @@ -1428,16 +1430,27 @@
|
|
|
| if (!initial_stability_log->LoadSavedEnvironmentFromPrefs())
|
| return;
|
| - initial_stability_log->RecordStabilityMetrics(base::TimeDelta(),
|
| - base::TimeDelta());
|
| +
|
| log_manager_.LoadPersistedUnsentLogs();
|
|
|
| log_manager_.PauseCurrentLog();
|
| log_manager_.BeginLoggingWithLog(initial_stability_log.release());
|
| +
|
| + // Note: Some stability providers may record stability stats via histograms,
|
| + // so this call has to be after BeginLoggingWithLog().
|
| + MetricsLog* current_log =
|
| + static_cast<MetricsLog*>(log_manager_.current_log());
|
| + current_log->RecordStabilityMetrics(data_providers_.get(), base::TimeDelta(),
|
| + base::TimeDelta());
|
| +
|
| #if defined(OS_ANDROID)
|
| ConvertAndroidStabilityPrefsToHistograms(pref);
|
| RecordCurrentStabilityHistograms();
|
| #endif // defined(OS_ANDROID)
|
| +
|
| + // Note: RecordGeneralMetrics() intentionally not called since this log is for
|
| + // stability stats from a previous session only.
|
| +
|
| log_manager_.FinishCurrentLog();
|
| log_manager_.ResumePausedLog();
|
|
|
| @@ -1454,22 +1467,33 @@
|
|
|
| std::vector<chrome_variations::ActiveGroupId> synthetic_trials;
|
| GetCurrentSyntheticFieldTrials(&synthetic_trials);
|
| - initial_metrics_log_->RecordEnvironment(plugins_, google_update_metrics_,
|
| + initial_metrics_log_->RecordEnvironment(data_providers_.get(), plugins_,
|
| + google_update_metrics_,
|
| synthetic_trials);
|
| PrefService* pref = g_browser_process->local_state();
|
| base::TimeDelta incremental_uptime;
|
| base::TimeDelta uptime;
|
| GetUptimes(pref, &incremental_uptime, &uptime);
|
| - initial_metrics_log_->RecordStabilityMetrics(incremental_uptime, uptime);
|
|
|
| // Histograms only get written to the current log, so make the new log current
|
| // before writing them.
|
| log_manager_.PauseCurrentLog();
|
| log_manager_.BeginLoggingWithLog(initial_metrics_log_.release());
|
| +
|
| + // Note: Some stability providers may record stability stats via histograms,
|
| + // so this call has to be after BeginLoggingWithLog().
|
| + MetricsLog* current_log =
|
| + static_cast<MetricsLog*>(log_manager_.current_log());
|
| + current_log->RecordStabilityMetrics(data_providers_.get(), base::TimeDelta(),
|
| + base::TimeDelta());
|
| +
|
| #if defined(OS_ANDROID)
|
| ConvertAndroidStabilityPrefsToHistograms(pref);
|
| #endif // defined(OS_ANDROID)
|
| RecordCurrentHistograms();
|
| +
|
| + current_log->RecordGeneralMetrics(data_providers_.get());
|
| +
|
| log_manager_.FinishCurrentLog();
|
| log_manager_.ResumePausedLog();
|
|
|
| @@ -1722,6 +1746,12 @@
|
| synthetic_trial_groups_.push_back(trial_group);
|
| }
|
|
|
| +void MetricsService::RegisterDataProvider(
|
| + scoped_ptr<metrics::MetricsDataProvider> provider) {
|
| + DCHECK_EQ(INITIALIZED, state_);
|
| + data_providers_.push_back(provider.release());
|
| +}
|
| +
|
| void MetricsService::CheckForClonedInstall() {
|
| state_manager_->CheckForClonedInstall();
|
| }
|
|
|