Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.h

Issue 293393010: Move initial metrics gathering tasks out of MetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/metrics/chrome_metrics_service_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/chrome_metrics_service_client.h
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.h b/chrome/browser/metrics/chrome_metrics_service_client.h
index 63bf92e06503d9c43fa3e3aef322217ffc41ea8c..a60960afe2f030364e9b049b2870bc23126d2783 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.h
+++ b/chrome/browser/metrics/chrome_metrics_service_client.h
@@ -13,12 +13,21 @@
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "chrome/browser/metrics/network_stats_uploader.h"
+#include "chrome/browser/metrics/tracking_synchronizer_observer.h"
#include "components/metrics/metrics_service_client.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class ChromeOSMetricsProvider;
+class GoogleUpdateMetricsProviderWin;
class MetricsService;
+class PluginMetricsProvider;
+class PrefRegistrySimple;
+class ProfilerMetricsProvider;
+
+namespace base {
+class FilePath;
+}
namespace metrics {
class MetricsStateManager;
@@ -26,8 +35,10 @@ class MetricsStateManager;
// ChromeMetricsServiceClient provides an implementation of MetricsServiceClient
// that depends on chrome/.
-class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
- public content::NotificationObserver {
+class ChromeMetricsServiceClient
+ : public metrics::MetricsServiceClient,
+ public chrome_browser_metrics::TrackingSynchronizerObserver,
+ public content::NotificationObserver {
public:
virtual ~ChromeMetricsServiceClient();
@@ -36,6 +47,9 @@ class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
metrics::MetricsStateManager* state_manager,
PrefService* local_state);
+ // Registers local state prefs used by this class.
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
// metrics::MetricsServiceClient:
virtual void SetClientID(const std::string& client_id) OVERRIDE;
virtual bool IsOffTheRecordSessionActive() OVERRIDE;
@@ -56,6 +70,8 @@ class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
MetricsService* metrics_service() { return metrics_service_.get(); }
+ void LogPluginLoadingError(const base::FilePath& plugin_path);
+
private:
explicit ChromeMetricsServiceClient(
metrics::MetricsStateManager* state_manager);
@@ -63,6 +79,23 @@ class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
// Completes the two-phase initialization of ChromeMetricsServiceClient.
void Initialize();
+ // Callback that continues the init task by loading plugin information.
+ void OnInitTaskGotHardwareClass();
+
+ // Called after the Plugin init task has been completed that continues the
+ // init task by launching a task to gather Google Update statistics.
+ void OnInitTaskGotPluginInfo();
+
+ // Called after GoogleUpdate init task has been completed that continues the
+ // init task by loading profiler data.
+ void OnInitTaskGotGoogleUpdateData();
+
+ // TrackingSynchronizerObserver:
+ virtual void ReceivedProfilerData(
+ const tracked_objects::ProcessDataSnapshot& process_data,
+ int process_type) OVERRIDE;
+ virtual void FinishedReceivingProfilerData() OVERRIDE;
+
// Callbacks for various stages of final log info collection. Do not call
// these directly.
void OnMemoryDetailCollectionDone();
@@ -113,6 +146,25 @@ class ChromeMetricsServiceClient : public metrics::MetricsServiceClient,
// Number of async histogram fetch requests in progress.
int num_async_histogram_fetches_in_progress_;
+ // The ProfilerMetricsProvider instance that was registered with
+ // MetricsService. Has the same lifetime as |metrics_service_|.
+ ProfilerMetricsProvider* profiler_metrics_provider_;
+
+#if defined(ENABLE_PLUGINS)
+ // The PluginMetricsProvider instance that was registered with
+ // MetricsService. Has the same lifetime as |metrics_service_|.
+ PluginMetricsProvider* plugin_metrics_provider_;
+#endif
+
+#if defined(OS_WIN)
+ // The GoogleUpdateMetricsProviderWin instance that was registered with
+ // MetricsService. Has the same lifetime as |metrics_service_|.
+ GoogleUpdateMetricsProviderWin* google_update_metrics_provider_;
+#endif
+
+ // Callback that is called when initial metrics gathering is complete.
+ base::Closure finished_gathering_initial_metrics_callback_;
+
base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient);
« no previous file with comments | « no previous file | chrome/browser/metrics/chrome_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698