diff options
author | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 10:20:49 +0000 |
---|---|---|
committer | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 10:20:49 +0000 |
commit | c47ec40ba81351041096fc6cfb00c98bd74b7c06 (patch) | |
tree | 5fe3445e973fac493d888df2e30d27cdc79225fe /chrome/nacl | |
parent | a4a849608e4b1b06dc27b986c98b5e2c57f3367c (diff) | |
download | chromium_src-c47ec40ba81351041096fc6cfb00c98bd74b7c06.zip chromium_src-c47ec40ba81351041096fc6cfb00c98bd74b7c06.tar.gz chromium_src-c47ec40ba81351041096fc6cfb00c98bd74b7c06.tar.bz2 |
NaCl: Allow setting up multiple sockets for subprocess instead of just one
Remove the "channel number" parameter from messages, since this is now
fixed in the NaCl plugin code in sel_main_chrome.c.
Replace pair_ and descriptor_ with sockets_for_renderer_ and
sockets_for_sel_ldr_.
NaClProcessMsg_Start: Pass an array of FDs instead of one FD.
ViewHostMsg_LaunchNaCl:
* Add socket count.
* Return an array of FDs instead of one FD.
Expose this functionality to the NaCl plugin via a new function,
"launch_nacl_process_multi_fd".
BUG=50626
TEST=nacl_ui_tests
Review URL: http://codereview.chromium.org/2832093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r-- | chrome/nacl/nacl_thread.cc | 11 | ||||
-rw-r--r-- | chrome/nacl/nacl_thread.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_thread.cc index 33c0195..77b78c7 100644 --- a/chrome/nacl/nacl_thread.cc +++ b/chrome/nacl/nacl_thread.cc @@ -36,8 +36,11 @@ void NaClThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_END_MESSAGE_MAP() } -void NaClThread::OnStartSelLdr(int channel_descriptor, - nacl::FileDescriptor handle) { - NaClHandle nacl_handle = nacl::ToNativeHandle(handle); - NaClMainForChromium(/* handle_count= */ 1, &nacl_handle); +void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) { + NaClHandle* array = new NaClHandle[handles.size()]; + for (size_t i = 0; i < handles.size(); i++) { + array[i] = nacl::ToNativeHandle(handles[i]); + } + NaClMainForChromium(static_cast<int>(handles.size()), array); + delete array; } diff --git a/chrome/nacl/nacl_thread.h b/chrome/nacl/nacl_thread.h index 70bfe6f..33cccae 100644 --- a/chrome/nacl/nacl_thread.h +++ b/chrome/nacl/nacl_thread.h @@ -22,7 +22,7 @@ class NaClThread : public ChildThread { private: virtual void OnControlMessageReceived(const IPC::Message& msg); - void OnStartSelLdr(int channel_descriptor, nacl::FileDescriptor handle); + void OnStartSelLdr(std::vector<nacl::FileDescriptor> handles); // TODO(gregoryd): do we need to override Cleanup as in PluginThread? DISALLOW_COPY_AND_ASSIGN(NaClThread); |