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

Unified Diff: chromecast/metrics/cast_stability_metrics_provider.h

Issue 602393004: Chromecast: adds stability metrics provider to track crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS changes not caught by git cl presubmit Created 6 years, 2 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: chromecast/metrics/cast_stability_metrics_provider.h
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.h b/chromecast/metrics/cast_stability_metrics_provider.h
similarity index 63%
copy from chrome/browser/metrics/chrome_stability_metrics_provider.h
copy to chromecast/metrics/cast_stability_metrics_provider.h
index 562418292badf553bfcee9bf5178295600d4213e..28c6818e77e6fd091685a44be9869b68be4ee5de 100644
--- a/chrome/browser/metrics/chrome_stability_metrics_provider.h
+++ b/chromecast/metrics/cast_stability_metrics_provider.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_
-#define CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_
+#ifndef CHROMECAST_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_
+#define CHROMECAST_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_
#include "base/basictypes.h"
#include "base/metrics/user_metrics.h"
@@ -13,6 +13,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+class MetricsService;
class PrefRegistrySimple;
namespace content {
@@ -20,40 +21,38 @@ class RenderProcessHost;
class WebContents;
}
-// ChromeStabilityMetricsProvider gathers and logs Chrome-specific stability-
-// related metrics.
-class ChromeStabilityMetricsProvider
- : public metrics::MetricsProvider,
+namespace chromecast {
+namespace metrics {
+
+// CastStabilityMetricsProvider gathers and logs stability-related metrics.
+// Loosely based on ChromeStabilityMetricsProvider from chrome/browser/metrics.
+class CastStabilityMetricsProvider
+ : public ::metrics::MetricsProvider,
public content::BrowserChildProcessObserver,
public content::NotificationObserver {
public:
- ChromeStabilityMetricsProvider();
- virtual ~ChromeStabilityMetricsProvider();
+ // Registers local state prefs used by this class.
+ static void RegisterPrefs(PrefRegistrySimple* registry);
- // metrics::MetricsDataProvider:
+ CastStabilityMetricsProvider();
+ virtual ~CastStabilityMetricsProvider();
+
+ // metrics::MetricsDataProvider implementation:
virtual void OnRecordingEnabled() OVERRIDE;
virtual void OnRecordingDisabled() OVERRIDE;
virtual void ProvideStabilityMetrics(
- metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
- virtual void ClearSavedStabilityMetrics() OVERRIDE;
-
- // Registers local state prefs used by this class.
- static void RegisterPrefs(PrefRegistrySimple* registry);
+ ::metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
private:
- // content::NotificationObserver:
+ // content::NotificationObserver implementation:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // content::BrowserChildProcessObserver:
+ // content::BrowserChildProcessObserver implementation:
virtual void BrowserChildProcessCrashed(
const content::ChildProcessData& data) OVERRIDE;
- // Logs the initiation of a page load and uses |web_contents| to do
- // additional logging of the type of page loaded.
- void LogLoadStarted(content::WebContents* web_contents);
-
// Records a renderer process crash.
void LogRendererCrash(content::RenderProcessHost* host,
base::TerminationStatus status,
@@ -65,7 +64,10 @@ class ChromeStabilityMetricsProvider
// Registrar for receiving stability-related notifications.
content::NotificationRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(ChromeStabilityMetricsProvider);
+ DISALLOW_COPY_AND_ASSIGN(CastStabilityMetricsProvider);
};
-#endif // CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_
+} // namespace metrics
+} // namespace chromecast
+
+#endif // CHROMECAST_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_
« no previous file with comments | « chromecast/metrics/cast_metrics_service_client_unittest.cc ('k') | chromecast/metrics/cast_stability_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698