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

Unified Diff: content/browser/browser_child_process_host_impl.h

Issue 2224063002: Use persistent memory for receiving metrics from sub-processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 4 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: content/browser/browser_child_process_host_impl.h
diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h
index 2d0792ef4bc04809305240c2e16fe7519622a22f..43cd8bebc276fc86113f28bc3df96f6bb4824306 100644
--- a/content/browser/browser_child_process_host_impl.h
+++ b/content/browser/browser_child_process_host_impl.h
@@ -76,6 +76,8 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl
ChildProcessHost* GetHost() const override;
base::TerminationStatus GetTerminationStatus(bool known_dead,
int* exit_code) override;
+ std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
+ override;
void SetName(const base::string16& name) override;
void SetHandle(base::ProcessHandle handle) override;
@@ -120,6 +122,14 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl
static void AddObserver(BrowserChildProcessObserver* observer);
static void RemoveObserver(BrowserChildProcessObserver* observer);
+ // Creates the |metrics_allocator_|.
+ void CreateMetricsAllocator();
+
+ // Passes the |metrics_allocator_|, if any, to the managed process. This
+ // requires the process to have been launched and the IPC channel to be
+ // available.
+ void ShareMetricsAllocatorToProcess();
+
// ChildProcessLauncher::Client implementation.
void OnProcessLaunched() override;
void OnProcessLaunchFailed(int error_code) override;
@@ -156,6 +166,9 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl
base::win::ObjectWatcher early_exit_watcher_;
#endif
+ // The memory allocator, if any, in which the process will write its metrics.
+ std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_;
+
bool is_channel_connected_;
bool notify_child_disconnected_;
« no previous file with comments | « chrome/browser/metrics/subprocess_metrics_provider_unittest.cc ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698