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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 11761025: When launching PNaCl helper nexes, explicitly disable IRT loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rearrange parameter order, etc. Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
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, &params.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, &params.handles))
+ return false;
+ }
#if defined(OS_MACOSX)
// For dynamic loading support, NaCl requires a file descriptor that
« no previous file with comments | « chrome/browser/nacl_host/nacl_process_host.h ('k') | chrome/browser/renderer_host/chrome_render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698