Chromium Code Reviews| Index: chrome/browser/nacl_host/nacl_process_host.cc |
| diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc |
| index 1d79727a415bfcb1dfe98c710e4bc40930842f32..0d4dc2334b558cb67b789cd38f53a4b22d26f209 100644 |
| --- a/chrome/browser/nacl_host/nacl_process_host.cc |
| +++ b/chrome/browser/nacl_host/nacl_process_host.cc |
| @@ -880,8 +880,13 @@ void NaClProcessHost::IrtReady() { |
| } |
| } |
| -bool NaClProcessHost::SendStart() { |
| +bool NaClProcessHost::MakeStartParams(nacl::NaClStartParams* params) { |
| NaClBrowser* nacl_browser = NaClBrowser::GetInstance(); |
| + |
| + params->validation_cache_key = nacl_browser->GetValidatorCacheKey(); |
| + params->version = chrome::VersionInfo().CreateVersionString(); |
| + params->enable_exception_handling = enable_exception_handling_; |
| + |
| base::PlatformFile irt_file = nacl_browser->IrtFile(); |
| CHECK_NE(irt_file, base::kInvalidPlatformFileValue); |
| @@ -943,17 +948,16 @@ bool NaClProcessHost::SendStart() { |
| reply_msg_ = NULL; |
| internal_->sockets_for_renderer.clear(); |
| - std::vector<nacl::FileDescriptor> handles_for_sel_ldr; |
| for (size_t i = 0; i < internal_->sockets_for_sel_ldr.size(); i++) { |
| if (!SendHandleToSelLdr(data.handle, |
| internal_->sockets_for_sel_ldr[i], true, |
| - &handles_for_sel_ldr)) { |
| + ¶ms->sockets)) { |
| return false; |
| } |
| } |
| // Send over the IRT file handle. We don't close our own copy! |
| - if (!SendHandleToSelLdr(data.handle, irt_file, false, &handles_for_sel_ldr)) |
| + if (!SendHandleToSelLdr(data.handle, irt_file, false, ¶ms->sockets)) |
| return false; |
| #if defined(OS_MACOSX) |
| @@ -976,17 +980,18 @@ bool NaClProcessHost::SendStart() { |
| return false; |
| } |
| memory_fd.auto_close = true; |
| - handles_for_sel_ldr.push_back(memory_fd); |
| + params->sockets.push_back(memory_fd); |
|
Mark Seaborn
2012/04/06 23:13:50
The name "sockets" isn't accurate because this arr
|
| #endif |
| - // Sending the version string over IPC avoids linkage issues in cases where |
|
Mark Seaborn
2012/04/06 23:13:50
Can you keep this comment and move it to the point
|
| - // NaCl is not compiled into the main Chromium executable or DLL. |
| - chrome::VersionInfo version_info; |
| - IPC::Message* start_message = |
| - new NaClProcessMsg_Start(handles_for_sel_ldr, |
| - nacl_browser->GetValidatorCacheKey(), |
| - version_info.CreateVersionString(), |
| - enable_exception_handling_); |
| + return true; |
| +} |
| + |
| +bool NaClProcessHost::SendStart() { |
| + nacl::NaClStartParams params; |
| + if (!MakeStartParams(¶ms)) |
| + return false; |
| + |
| + IPC::Message* start_message = new NaClProcessMsg_Start(params); |
| #if defined(OS_WIN) |
| if (debug_context_ != NULL) { |
| debug_context_->SetStartMessage(start_message); |