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

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

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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"
(...skipping 24 matching lines...) Expand all
35 // will get terminated at browser shutdown. 35 // will get terminated at browser shutdown.
36 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender { 36 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender {
37 public: 37 public:
38 // Used to create a child process host. The delegate must outlive this object. 38 // Used to create a child process host. The delegate must outlive this object.
39 // |process_type| needs to be either an enum value from ProcessType or an 39 // |process_type| needs to be either an enum value from ProcessType or an
40 // embedder-defined value. 40 // embedder-defined value.
41 static BrowserChildProcessHost* Create( 41 static BrowserChildProcessHost* Create(
42 content::ProcessType process_type, 42 content::ProcessType process_type,
43 BrowserChildProcessHostDelegate* delegate); 43 BrowserChildProcessHostDelegate* delegate);
44 44
45 // Used to create a child process host, with a unique token to identify the
46 // child process to Mojo. |mojo_child_token| should be a unique string
47 // generated using mojo::edk::GenerateRandomToken().
48 static BrowserChildProcessHost* Create(
49 content::ProcessType process_type,
50 BrowserChildProcessHostDelegate* delegate,
51 const std::string& mojo_child_token);
52
45 // Returns the child process host with unique id |child_process_id|, or 53 // Returns the child process host with unique id |child_process_id|, or
46 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but 54 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but
47 // is the same unique ID as |ChildProcessData::id|. 55 // is the same unique ID as |ChildProcessData::id|.
48 static BrowserChildProcessHost* FromID(int child_process_id); 56 static BrowserChildProcessHost* FromID(int child_process_id);
49 57
50 ~BrowserChildProcessHost() override {} 58 ~BrowserChildProcessHost() override {}
51 59
52 // Derived classes call this to launch the child process asynchronously. 60 // Derived classes call this to launch the child process asynchronously.
53 // Takes ownership of |cmd_line| and |delegate|. 61 // Takes ownership of |cmd_line| and |delegate|.
54 virtual void Launch( 62 virtual void Launch(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 95
88 #if defined(OS_MACOSX) 96 #if defined(OS_MACOSX)
89 // Returns a PortProvider used to get the task port for child processes. 97 // Returns a PortProvider used to get the task port for child processes.
90 static base::PortProvider* GetPortProvider(); 98 static base::PortProvider* GetPortProvider();
91 #endif 99 #endif
92 }; 100 };
93 101
94 }; // namespace content 102 }; // namespace content
95 103
96 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ 104 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/utility_process_host_impl.cc ('k') | content/test/render_thread_impl_browser_test_ipc_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698