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

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

Issue 9702015: [UMA] Add performance profile data to UMA uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add tests Created 8 years, 8 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
Index: chrome/browser/metrics/metrics_service.h
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index ff4df36914c23d3a93c8bd18e0ce74181a0972cd..4ac759f1115f8d0855dd5b03177a010fa37d79fe 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -15,16 +15,15 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "base/memory/weak_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/process_util.h"
#include "chrome/browser/io_thread.h"
+#include "chrome/browser/metrics/tracking_synchronizer_observer.h"
#include "chrome/common/metrics/metrics_service_base.h"
-#include "content/public/common/process_type.h"
-#include "content/public/common/url_fetcher_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/url_fetcher_delegate.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/external_metrics.h"
@@ -32,6 +31,7 @@
class BookmarkModel;
class BookmarkNode;
+class MetricsLog;
class MetricsReportingScheduler;
class PrefService;
class Profile;
@@ -54,14 +54,19 @@ namespace prerender {
bool IsOmniboxEnabled(Profile* profile);
}
+namespace tracked_objects {
+struct ProcessDataSnapshot;
+}
+
namespace webkit {
struct WebPluginInfo;
}
-
-class MetricsService : public content::NotificationObserver,
- public content::URLFetcherDelegate,
- public MetricsServiceBase {
+class MetricsService
+ : public chrome_browser_metrics::TrackingSynchronizerObserver,
+ public content::NotificationObserver,
+ public content::URLFetcherDelegate,
+ public MetricsServiceBase {
public:
MetricsService();
virtual ~MetricsService();
@@ -162,11 +167,18 @@ class MetricsService : public content::NotificationObserver,
// loading plugin information.
void OnInitTaskGotHardwareClass(const std::string& hardware_class);
- // Callback from PluginService::GetPlugins() that moves the state to
- // INIT_TASK_DONE.
+ // Callback from PluginService::GetPlugins() that continues the init task by
+ // loading profiler data.
void OnInitTaskGotPluginInfo(
const std::vector<webkit::WebPluginInfo>& plugins);
+ // TrackingSynchronizerObserver:
+ virtual void ReceivedProfilerData(
+ const tracked_objects::ProcessDataSnapshot& process_data,
+ content::ProcessType process_type) OVERRIDE;
+ // Callback that moves the state to INIT_TASK_DONE.
+ virtual void FinishedReceivingProfilerData() OVERRIDE;
+
// When we start a new version of Chromium (different from our last run), we
// need to discard the old crash stats so that we don't attribute crashes etc.
// in the old version to the current version (via current logs).
@@ -348,6 +360,9 @@ class MetricsService : public content::NotificationObserver,
// The list of plugins which was retrieved on the file thread.
std::vector<webkit::WebPluginInfo> plugins_;
+ // The initial log, used to record startup metrics.
+ scoped_ptr<MetricsLog> initial_log_;
+
// The outstanding transmission appears as a URL Fetch operation.
scoped_ptr<content::URLFetcher> current_fetch_xml_;
scoped_ptr<content::URLFetcher> current_fetch_proto_;

Powered by Google App Engine
This is Rietveld 408576698