Index: content/browser/child_process_launcher.cc |
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc |
index 0bbc03536eb4831cbacc36d2bc3dbe7f75b0ddd8..56937f0c72143943eb9286f8cbcf5659d7668e53 100644 |
--- a/content/browser/child_process_launcher.cc |
+++ b/content/browser/child_process_launcher.cc |
@@ -109,17 +109,19 @@ class ChildProcessLauncher::Context |
// |this_object| is NOT thread safe. Only use it to post a task back. |
scoped_refptr<Context> this_object, |
BrowserThread::ID client_thread_id, |
+ const content::FDInfoList& registered_files, |
base::ProcessHandle handle) { |
if (BrowserThread::CurrentlyOn(client_thread_id)) { |
// This is always invoked on the UI thread which is commonly the |
// |client_thread_id| so we can shortcut one PostTask. |
- this_object->Notify(handle); |
+ this_object->Notify(registered_files, handle); |
} else { |
BrowserThread::PostTask( |
client_thread_id, FROM_HERE, |
base::Bind( |
&ChildProcessLauncher::Context::Notify, |
this_object, |
+ registered_files, |
handle)); |
} |
} |
@@ -166,7 +168,7 @@ class ChildProcessLauncher::Context |
#elif defined(OS_ANDROID) |
std::string process_type = |
cmd_line->GetSwitchValueASCII(switches::kProcessType); |
- std::vector<content::FileDescriptorInfo> files_to_register; |
+ content::FDInfoList files_to_register; |
files_to_register.push_back( |
content::FileDescriptorInfo(kPrimaryIPCChannel, |
base::FileDescriptor(ipcfd, false))); |
@@ -176,7 +178,7 @@ class ChildProcessLauncher::Context |
content::StartSandboxedProcess(cmd_line->argv(), files_to_register, |
base::Bind(&ChildProcessLauncher::Context::OnSandboxedProcessStarted, |
- this_object, client_thread_id)); |
+ this_object, client_thread_id, files_to_register)); |
#elif defined(OS_POSIX) |
base::ProcessHandle handle = base::kNullProcessHandle; |
@@ -186,7 +188,7 @@ class ChildProcessLauncher::Context |
std::string process_type = |
cmd_line->GetSwitchValueASCII(switches::kProcessType); |
- std::vector<content::FileDescriptorInfo> files_to_register; |
+ content::FDInfoList files_to_register; |
files_to_register.push_back( |
content::FileDescriptorInfo(kPrimaryIPCChannel, |
base::FileDescriptor(ipcfd, false))); |
@@ -204,8 +206,8 @@ class ChildProcessLauncher::Context |
{ |
// Convert FD mapping to FileHandleMappingVector |
base::FileHandleMappingVector fds_to_map; |
- for (std::vector<content::FileDescriptorInfo>::const_iterator |
- i = files_to_register.begin(); i != files_to_register.end(); ++i) { |
+ for (content::FDInfoList::const_iterator i = files_to_register.begin(); |
jam
2012/10/19 16:39:17
nit: no need for const_iterator when iterating a v
Jay Civelli
2012/10/22 22:09:48
Done.
|
+ i != files_to_register.end(); ++i) { |
const content::FileDescriptorInfo& fd_info = *i; |
fds_to_map.push_back(std::make_pair( |
fd_info.fd.fd, |
@@ -267,6 +269,7 @@ class ChildProcessLauncher::Context |
#if defined(OS_POSIX) && !defined(OS_MACOSX) |
use_zygote, |
#endif |
+ files_to_register, |
handle)); |
#endif // !defined(OS_ANDROID) |
} |
@@ -275,6 +278,7 @@ class ChildProcessLauncher::Context |
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
bool zygote, |
#endif |
+ const content::FDInfoList& registered_files, |
base::ProcessHandle handle) { |
#if defined(OS_ANDROID) |
// Finally close the ipcfd |
@@ -289,7 +293,7 @@ class ChildProcessLauncher::Context |
zygote_ = zygote; |
#endif |
if (client_) { |
- client_->OnProcessLaunched(); |
+ client_->OnProcessLaunched(registered_files); |
} else { |
Terminate(); |
} |