Commit 4babd807 authored by isherman@chromium.org's avatar isherman@chromium.org

[Metrics] Move ExternalMetrics ownership to ChromeBrowserMainPartsChromeos

BUG=374215
TEST=compiles
R=asvitkine@chromium.org, xiyuan@chromium.org

Review URL: https://codereview.chromium.org/289303003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271441 0039d316-1c4b-4281-b951-d872f2087c98
parent d6def3d5
...@@ -704,7 +704,10 @@ void ChromeBrowserMainPartsChromeos::PreBrowserStart() { ...@@ -704,7 +704,10 @@ void ChromeBrowserMainPartsChromeos::PreBrowserStart() {
// -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
// -- just before MetricsService::LogNeedForCleanShutdown(). // -- just before MetricsService::LogNeedForCleanShutdown().
g_browser_process->metrics_service()->StartExternalMetrics(); // Start the external metrics service, which collects metrics from Chrome OS
// and passes them to the browser process.
external_metrics_ = new chromeos::ExternalMetrics;
external_metrics_->Start();
#if defined(USE_X11) #if defined(USE_X11)
// Listen for system key events so that the user will be able to adjust the // Listen for system key events so that the user will be able to adjust the
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/task/cancelable_task_tracker.h" #include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/chrome_browser_main_linux.h" #include "chrome/browser/chrome_browser_main_linux.h"
#include "chrome/browser/chromeos/external_metrics.h"
#include "chrome/browser/chromeos/version_loader.h" #include "chrome/browser/chromeos/version_loader.h"
namespace content { namespace content {
...@@ -71,6 +72,8 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { ...@@ -71,6 +72,8 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux {
scoped_ptr<EventRewriterController> keyboard_event_rewriters_; scoped_ptr<EventRewriterController> keyboard_event_rewriters_;
scoped_refptr<chromeos::ExternalMetrics> external_metrics_;
VersionLoader cros_version_loader_; VersionLoader cros_version_loader_;
base::CancelableTaskTracker tracker_; base::CancelableTaskTracker tracker_;
bool use_new_network_change_notifier_; bool use_new_network_change_notifier_;
......
...@@ -226,7 +226,6 @@ ...@@ -226,7 +226,6 @@
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/external_metrics.h"
#include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chromeos/system/statistics_provider.h" #include "chromeos/system/statistics_provider.h"
#endif #endif
...@@ -1915,13 +1914,6 @@ bool MetricsService::IsPluginProcess(int process_type) { ...@@ -1915,13 +1914,6 @@ bool MetricsService::IsPluginProcess(int process_type) {
process_type == content::PROCESS_TYPE_PPAPI_BROKER); process_type == content::PROCESS_TYPE_PPAPI_BROKER);
} }
#if defined(OS_CHROMEOS)
void MetricsService::StartExternalMetrics() {
external_metrics_ = new chromeos::ExternalMetrics;
external_metrics_->Start();
}
#endif
// static // static
bool MetricsServiceHelper::IsMetricsReportingEnabled() { bool MetricsServiceHelper::IsMetricsReportingEnabled() {
bool result = false; bool result = false;
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "chrome/browser/android/activity_type_ids.h" #include "chrome/browser/android/activity_type_ids.h"
#elif defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/external_metrics.h"
#endif #endif
class ChromeBrowserMetricsServiceObserver; class ChromeBrowserMetricsServiceObserver;
...@@ -256,10 +254,6 @@ class MetricsService ...@@ -256,10 +254,6 @@ class MetricsService
#endif // OS_WIN #endif // OS_WIN
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// Start the external metrics service, which collects metrics from Chrome OS
// and passes them to UMA.
void StartExternalMetrics();
// Records a Chrome OS crash. // Records a Chrome OS crash.
void LogChromeOSCrash(const std::string &crash_type); void LogChromeOSCrash(const std::string &crash_type);
#endif #endif
...@@ -574,11 +568,6 @@ class MetricsService ...@@ -574,11 +568,6 @@ class MetricsService
// Number of async histogram fetch requests in progress. // Number of async histogram fetch requests in progress.
int num_async_histogram_fetches_in_progress_; int num_async_histogram_fetches_in_progress_;
#if defined(OS_CHROMEOS)
// The external metric service is used to log ChromeOS UMA events.
scoped_refptr<chromeos::ExternalMetrics> external_metrics_;
#endif
// Stores the time of the first call to |GetUptimes()|. // Stores the time of the first call to |GetUptimes()|.
base::TimeTicks first_updated_time_; base::TimeTicks first_updated_time_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment