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

Unified Diff: chrome/nacl/nacl_listener.cc

Issue 8397001: Open NaCl IRT file only once at startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 1 month 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
« no previous file with comments | « chrome/nacl/nacl_listener.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_listener.cc
diff --git a/chrome/nacl/nacl_listener.cc b/chrome/nacl/nacl_listener.cc
index 678a87f0e64b6731cb1bccd42447cee7904d0620..55f7e432f62d97a77b58583414b5717d5843e164 100644
--- a/chrome/nacl/nacl_listener.cc
+++ b/chrome/nacl/nacl_listener.cc
@@ -96,9 +96,7 @@ bool NaClListener::OnMessageReceived(const IPC::Message& msg) {
return handled;
}
-void NaClListener::OnStartSelLdr(
- std::vector<nacl::FileDescriptor> handles,
- bool have_irt_file) {
+void NaClListener::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
#if defined(OS_LINUX)
nacl::SetCreateMemoryObjectFunc(content::MakeSharedMemorySegmentViaIPC);
#elif defined(OS_MACOSX)
@@ -108,22 +106,22 @@ void NaClListener::OnStartSelLdr(
handles.pop_back();
#endif
- if (have_irt_file) {
- CHECK(handles.size() >= 1);
- NaClHandle irt_handle = nacl::ToNativeHandle(handles[handles.size() - 1]);
- handles.pop_back();
+ CHECK(handles.size() >= 1);
+ NaClHandle irt_handle = nacl::ToNativeHandle(handles[handles.size() - 1]);
+ handles.pop_back();
+
#if defined(OS_WIN)
- int irt_desc = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle),
- _O_RDWR | _O_BINARY);
- if (irt_desc < 0) {
- LOG(ERROR) << "_open_osfhandle() failed";
- return;
- }
+ int irt_desc = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle),
+ _O_RDONLY | _O_BINARY);
+ if (irt_desc < 0) {
+ LOG(ERROR) << "_open_osfhandle() failed";
+ return;
+ }
#else
- int irt_desc = irt_handle;
+ int irt_desc = irt_handle;
#endif
- NaClSetIrtFileDesc(irt_desc);
- }
+
+ NaClSetIrtFileDesc(irt_desc);
scoped_array<NaClHandle> array(new NaClHandle[handles.size()]);
for (size_t i = 0; i < handles.size(); i++) {
« no previous file with comments | « chrome/nacl/nacl_listener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698