| Index: chrome/browser/metrics/subprocess_metrics_provider.h
|
| diff --git a/chrome/browser/metrics/subprocess_metrics_provider.h b/chrome/browser/metrics/subprocess_metrics_provider.h
|
| index 953169c8d8d34002de98100814c65f4c2df03d69..a20989af8ff790df33696764749ce5afd2919a46 100644
|
| --- a/chrome/browser/metrics/subprocess_metrics_provider.h
|
| +++ b/chrome/browser/metrics/subprocess_metrics_provider.h
|
| @@ -10,9 +10,11 @@
|
|
|
| #include "base/gtest_prod_util.h"
|
| #include "base/id_map.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/scoped_observer.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "components/metrics/metrics_provider.h"
|
| +#include "content/public/browser/browser_child_process_observer.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "content/public/browser/render_process_host_observer.h"
|
| @@ -27,6 +29,7 @@ class SharedPersistentMemoryAllocator;
|
| // when metrics are being collected for upload, or when something else needs
|
| // combined metrics (such as the chrome://histograms page).
|
| class SubprocessMetricsProvider : public metrics::MetricsProvider,
|
| + public content::BrowserChildProcessObserver,
|
| public content::NotificationObserver,
|
| public content::RenderProcessHostObserver {
|
| public:
|
| @@ -56,6 +59,18 @@ class SubprocessMetricsProvider : public metrics::MetricsProvider,
|
| // metrics::MetricsProvider:
|
| void MergeHistogramDeltas() override;
|
|
|
| + // content::BrowserChildProcessObserver:
|
| + void BrowserChildProcessHostConnected(
|
| + const content::ChildProcessData& data) override;
|
| + void BrowserChildProcessHostDisconnected(
|
| + const content::ChildProcessData& data) override;
|
| + void BrowserChildProcessCrashed(
|
| + const content::ChildProcessData& data,
|
| + int exit_code) override;
|
| + void BrowserChildProcessKilled(
|
| + const content::ChildProcessData& data,
|
| + int exit_code) override;
|
| +
|
| // content::NotificationObserver:
|
| void Observe(int type,
|
| const content::NotificationSource& source,
|
| @@ -68,6 +83,11 @@ class SubprocessMetricsProvider : public metrics::MetricsProvider,
|
| int exit_code) override;
|
| void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
|
|
| + // Gets a histogram allocator from a subprocess. This must be called on
|
| + // the IO thread.
|
| + static std::unique_ptr<base::PersistentHistogramAllocator>
|
| + GetSubprocessHistogramAllocatorOnIOThread(int id);
|
| +
|
| base::ThreadChecker thread_checker_;
|
|
|
| // Object for registing notification requests.
|
| @@ -82,6 +102,8 @@ class SubprocessMetricsProvider : public metrics::MetricsProvider,
|
| ScopedObserver<content::RenderProcessHost, SubprocessMetricsProvider>
|
| scoped_observer_;
|
|
|
| + base::WeakPtrFactory<SubprocessMetricsProvider> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(SubprocessMetricsProvider);
|
| };
|
|
|
|
|