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

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: create helper method; make test appear to be on UI thread 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 082fdf6e193507030dabc263b2aa3b37de2b7f59..f7e3a18d5f3ccd656440a312740e775500acdc2e 100644
--- a/content/browser/browser_child_process_host_impl.h
+++ b/content/browser/browser_child_process_host_impl.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "base/single_thread_task_runner.h"
+#include "base/strings/string_piece.h"
Alexei Svitkine (slow) 2016/08/19 16:31:56 Nit: Not needed anymore.
bcwhite 2016/08/19 17:19:46 Done.
#include "base/synchronization/waitable_event_watcher.h"
#include "build/build_config.h"
#include "content/browser/child_process_launcher.h"
@@ -75,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;
shell::InterfaceProvider* GetRemoteInterfaces() override;
@@ -115,6 +118,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 RPC channel to be
+ // available.
+ void ShareMetricsAllocatorToProcess();
+
// ChildProcessLauncher::Client implementation.
void OnProcessLaunched() override;
void OnProcessLaunchFailed(int error_code) override;
@@ -149,6 +160,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_;

Powered by Google App Engine
This is Rietveld 408576698