| Index: chrome/browser/metrics/metrics_log.cc
|
| ===================================================================
|
| --- chrome/browser/metrics/metrics_log.cc (revision 271296)
|
| +++ chrome/browser/metrics/metrics_log.cc (working copy)
|
| @@ -39,6 +39,7 @@
|
| #include "chrome/common/metrics/variations/variations_util.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/installer/util/google_update_settings.h"
|
| +#include "components/metrics/metrics_data_provider.h"
|
| #include "components/metrics/proto/omnibox_event.pb.h"
|
| #include "components/metrics/proto/profiler_event.pb.h"
|
| #include "components/metrics/proto/system_profile.pb.h"
|
| @@ -448,8 +449,10 @@
|
| return g_version_extension.Get();
|
| }
|
|
|
| -void MetricsLog::RecordStabilityMetrics(base::TimeDelta incremental_uptime,
|
| - base::TimeDelta uptime) {
|
| +void MetricsLog::RecordStabilityMetrics(
|
| + const std::vector<metrics::MetricsDataProvider*>& data_providers,
|
| + base::TimeDelta incremental_uptime,
|
| + base::TimeDelta uptime) {
|
| DCHECK(!locked());
|
| DCHECK(HasEnvironment());
|
| DCHECK(!HasStabilityMetrics());
|
| @@ -470,6 +473,11 @@
|
| // uma log upload, just as we send histogram data.
|
| WriteRealtimeStabilityAttributes(pref, incremental_uptime, uptime);
|
|
|
| + SystemProfileProto::Stability* stability =
|
| + uma_proto()->mutable_system_profile()->mutable_stability();
|
| + for (size_t i = 0; i < data_providers.size(); ++i)
|
| + data_providers[i]->ProvideStabilityMetrics(stability);
|
| +
|
| // Omit some stats unless this is the initial stability log.
|
| if (log_type() != INITIAL_STABILITY_LOG)
|
| return;
|
| @@ -492,8 +500,6 @@
|
|
|
| // TODO(jar): The following are all optional, so we *could* optimize them for
|
| // values of zero (and not include them).
|
| - SystemProfileProto::Stability* stability =
|
| - uma_proto()->mutable_system_profile()->mutable_stability();
|
| stability->set_incomplete_shutdown_count(incomplete_shutdown_count);
|
| stability->set_breakpad_registration_success_count(
|
| breakpad_registration_success_count);
|
| @@ -503,6 +509,12 @@
|
| stability->set_debugger_not_present_count(debugger_not_present_count);
|
| }
|
|
|
| +void MetricsLog::RecordGeneralMetrics(
|
| + const std::vector<metrics::MetricsDataProvider*>& data_providers) {
|
| + for (size_t i = 0; i < data_providers.size(); ++i)
|
| + data_providers[i]->ProvideGeneralMetrics(uma_proto());
|
| +}
|
| +
|
| PrefService* MetricsLog::GetPrefService() {
|
| return g_browser_process->local_state();
|
| }
|
| @@ -689,6 +701,7 @@
|
| }
|
|
|
| void MetricsLog::RecordEnvironment(
|
| + const std::vector<metrics::MetricsDataProvider*>& data_providers,
|
| const std::vector<content::WebPluginInfo>& plugin_list,
|
| const GoogleUpdateMetrics& google_update_metrics,
|
| const std::vector<chrome_variations::ActiveGroupId>& synthetic_trials) {
|
| @@ -795,6 +808,9 @@
|
| metrics_log_chromeos_->LogChromeOSMetrics();
|
| #endif // OS_CHROMEOS
|
|
|
| + for (size_t i = 0; i < data_providers.size(); ++i)
|
| + data_providers[i]->ProvideSystemProfileMetrics(system_profile);
|
| +
|
| std::string serialied_system_profile;
|
| std::string base64_system_profile;
|
| if (system_profile->SerializeToString(&serialied_system_profile)) {
|
|
|