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

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

Issue 293023005: Move MetricsService final log collection tasks to client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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
===================================================================
--- chrome/browser/metrics/chrome_metrics_service_client.h (revision 272175)
+++ chrome/browser/metrics/chrome_metrics_service_client.h (working copy)
@@ -8,6 +8,8 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "chrome/browser/metrics/network_stats_uploader.h"
#include "components/metrics/metrics_service_client.h"
@@ -32,6 +34,8 @@
virtual metrics::SystemProfileProto::Channel GetChannel() OVERRIDE;
virtual std::string GetVersionString() OVERRIDE;
virtual void OnLogUploadComplete() OVERRIDE;
+ virtual void CollectFinalMetrics(const base::Closure& done_callback)
+ OVERRIDE;
// Stores a weak pointer to the given |service|.
// TODO(isherman): Fix the memory ownership model so that this method is not
@@ -39,6 +43,11 @@
void set_service(MetricsService* service) { service_ = service; }
private:
+ // Callbacks for various stages of final log info collection. Do not call
+ // these directly.
+ void OnMemoryDetailCollectionDone();
+ void OnHistogramSynchronizationDone();
+
// Registers |this| as an observer for notifications which indicate that a
// user is performing work. This is useful to allow some features to sleep,
// until the machine becomes active, such as precluding UMA uploads unless
@@ -50,14 +59,26 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ base::ThreadChecker thread_checker_;
+
// The MetricsService that |this| is a client of. Weak pointer.
MetricsService* service_;
content::NotificationRegistrar registrar_;
- base::ThreadChecker thread_checker_;
NetworkStatsUploader network_stats_uploader_;
+ // Saved callback received from CollectFinalMetrics().
+ base::Closure collect_final_metrics_done_callback_;
+
+ // Indicates that collect final metrics step is running.
+ bool waiting_for_collect_final_metrics_step_;
+
+ // Number of async histogram fetch requests in progress.
+ int num_async_histogram_fetches_in_progress_;
+
+ 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