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

Side by Side Diff: content/public/browser/browser_child_process_host.h

Issue 972083002: Report utility process JS memory in task manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-oop
Patch Set: Redesign. Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
7 7
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/process/kill.h" 9 #include "base/process/kill.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
11 #include "base/process/process_metrics.h" 11 #include "base/process/process_metrics.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/common/process_type.h" 15 #include "content/public/common/process_type.h"
16 #include "ipc/ipc_sender.h" 16 #include "ipc/ipc_sender.h"
17 17
18 namespace base { 18 namespace base {
19 class CommandLine; 19 class CommandLine;
20 class FilePath; 20 class FilePath;
21 } 21 }
22 22
23 namespace content { 23 namespace content {
24 24
25 class BrowserChildProcessHostDelegate; 25 class BrowserChildProcessHostDelegate;
26 class ChildProcessHost; 26 class ChildProcessHost;
27 class SandboxedProcessLauncherDelegate; 27 class SandboxedProcessLauncherDelegate;
28 class ServiceRegistry;
28 struct ChildProcessData; 29 struct ChildProcessData;
29 30
30 // This represents child processes of the browser process, i.e. plugins. They 31 // This represents child processes of the browser process, i.e. plugins. They
31 // will get terminated at browser shutdown. 32 // will get terminated at browser shutdown.
32 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender { 33 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender {
33 public: 34 public:
34 // Used to create a child process host. The delegate must outlive this object. 35 // Used to create a child process host. The delegate must outlive this object.
35 // |process_type| needs to be either an enum value from ProcessType or an 36 // |process_type| needs to be either an enum value from ProcessType or an
36 // embedder-defined value. 37 // embedder-defined value.
37 static BrowserChildProcessHost* Create( 38 static BrowserChildProcessHost* Create(
38 content::ProcessType process_type, 39 content::ProcessType process_type,
39 BrowserChildProcessHostDelegate* delegate); 40 BrowserChildProcessHostDelegate* delegate);
40 41
42 // Returns the child process host with unique id |id|, or nullptr if it
43 // doesn't exist.
44 static BrowserChildProcessHost* Get(int id);
ncarter (slow) 2015/05/07 20:12:44 Name this FromID to match the convention establish
Anand Mistry (off Chromium) 2015/05/11 05:41:31 Done. Also clarified the comment to indicate what
45
41 ~BrowserChildProcessHost() override {} 46 ~BrowserChildProcessHost() override {}
42 47
43 // Derived classes call this to launch the child process asynchronously. 48 // Derived classes call this to launch the child process asynchronously.
44 // Takes ownership of |cmd_line| and |delegate|. 49 // Takes ownership of |cmd_line| and |delegate|.
45 virtual void Launch( 50 virtual void Launch(
46 SandboxedProcessLauncherDelegate* delegate, 51 SandboxedProcessLauncherDelegate* delegate,
47 base::CommandLine* cmd_line, 52 base::CommandLine* cmd_line,
48 bool terminate_on_shutdown) = 0; 53 bool terminate_on_shutdown) = 0;
49 54
50 virtual const ChildProcessData& GetData() const = 0; 55 virtual const ChildProcessData& GetData() const = 0;
(...skipping 14 matching lines...) Expand all
65 // Sets the user-visible name of the process. 70 // Sets the user-visible name of the process.
66 virtual void SetName(const base::string16& name) = 0; 71 virtual void SetName(const base::string16& name) = 0;
67 72
68 // Set the handle of the process. BrowserChildProcessHost will do this when 73 // Set the handle of the process. BrowserChildProcessHost will do this when
69 // the Launch method is used to start the process. However if the owner 74 // the Launch method is used to start the process. However if the owner
70 // of this object doesn't call Launch and starts the process in another way, 75 // of this object doesn't call Launch and starts the process in another way,
71 // they need to call this method so that the process handle is associated with 76 // they need to call this method so that the process handle is associated with
72 // this object. 77 // this object.
73 virtual void SetHandle(base::ProcessHandle handle) = 0; 78 virtual void SetHandle(base::ProcessHandle handle) = 0;
74 79
80 // Get the Mojo service registry connected to the child process. Returns
81 // nullptr if no service registry exists.
82 virtual ServiceRegistry* GetServiceRegistry() = 0;
83
75 #if defined(OS_MACOSX) && !defined(OS_IOS) 84 #if defined(OS_MACOSX) && !defined(OS_IOS)
76 // Returns a PortProvider used to get process metrics for child processes. 85 // Returns a PortProvider used to get process metrics for child processes.
77 static base::ProcessMetrics::PortProvider* GetPortProvider(); 86 static base::ProcessMetrics::PortProvider* GetPortProvider();
78 #endif 87 #endif
79 }; 88 };
80 89
81 }; // namespace content 90 }; // namespace content
82 91
83 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ 92 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698