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 3119c1b1dd9b1bce1b6c89aeabf41b6821d4f005..0cd1e23b079ba1acaf16157632a693b264758e9d 100644 |
| --- a/chrome/browser/nacl_host/nacl_process_host.cc |
| +++ b/chrome/browser/nacl_host/nacl_process_host.cc |
| @@ -144,7 +144,8 @@ bool NaClProcessHost::PluginListener::OnMessageReceived( |
| NaClProcessHost::NaClProcessHost(const GURL& manifest_url, |
| int render_view_id, |
| uint32 permission_bits, |
| - bool off_the_record) |
| + bool off_the_record, |
| + bool uses_irt) |
| : manifest_url_(manifest_url), |
| permissions_(GetNaClPermissions(permission_bits)), |
| #if defined(OS_WIN) |
| @@ -162,6 +163,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url, |
| enable_debug_stub_(false), |
| off_the_record_(off_the_record), |
| enable_ipc_proxy_(false), |
| + uses_irt_(uses_irt), |
| ALLOW_THIS_IN_INITIALIZER_LIST(ipc_plugin_listener_(this)), |
| render_view_id_(render_view_id) { |
| process_.reset(content::BrowserChildProcessHost::Create( |
| @@ -712,9 +714,7 @@ bool NaClProcessHost::StartNaClExecution() { |
| params.enable_debug_stub = enable_debug_stub_ && |
| NaClBrowser::GetInstance()->URLMatchesDebugPatterns(manifest_url_); |
| params.enable_ipc_proxy = enable_ipc_proxy_; |
| - |
| - base::PlatformFile irt_file = nacl_browser->IrtFile(); |
| - CHECK_NE(irt_file, base::kInvalidPlatformFileValue); |
| + params.uses_irt = uses_irt_; |
| const ChildProcessData& data = process_->GetData(); |
| for (size_t i = 0; i < internal_->sockets_for_sel_ldr.size(); i++) { |
| @@ -725,9 +725,14 @@ bool NaClProcessHost::StartNaClExecution() { |
| } |
| } |
| - // Send over the IRT file handle. We don't close our own copy! |
| - if (!ShareHandleToSelLdr(data.handle, irt_file, false, ¶ms.handles)) |
| - return false; |
| + if (params.uses_irt) { |
| + // Send over the IRT file handle. We don't close our own copy! |
|
Mark Seaborn
2013/01/04 17:40:54
I think this comment should stay next to the Share
jvoung (off chromium)
2013/01/04 17:59:27
Done.
|
| + base::PlatformFile irt_file = nacl_browser->IrtFile(); |
| + CHECK_NE(irt_file, base::kInvalidPlatformFileValue); |
| + |
| + if (!ShareHandleToSelLdr(data.handle, irt_file, false, ¶ms.handles)) |
| + return false; |
| + } |
| #if defined(OS_MACOSX) |
| // For dynamic loading support, NaCl requires a file descriptor that |