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

Side by Side Diff: chrome/renderer/pepper/ppb_nacl_private_impl.cc

Issue 11761025: When launching PNaCl helper nexes, explicitly disable IRT loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" 5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
6 6
7 #ifndef DISABLE_NACL 7 #ifndef DISABLE_NACL
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return 0; 63 return 0;
64 return host->GetRoutingIDForWidget(instance); 64 return host->GetRoutingIDForWidget(instance);
65 } 65 }
66 66
67 // Launch NaCl's sel_ldr process. 67 // Launch NaCl's sel_ldr process.
68 PP_NaClResult LaunchSelLdr(PP_Instance instance, 68 PP_NaClResult LaunchSelLdr(PP_Instance instance,
69 const char* alleged_url, 69 const char* alleged_url,
70 PP_Bool uses_ppapi, 70 PP_Bool uses_ppapi,
71 PP_Bool enable_ppapi_dev, 71 PP_Bool enable_ppapi_dev,
72 int socket_count, 72 int socket_count,
73 PP_Bool uses_irt,
73 void* imc_handles) { 74 void* imc_handles) {
74 std::vector<nacl::FileDescriptor> sockets; 75 std::vector<nacl::FileDescriptor> sockets;
75 IPC::Sender* sender = content::RenderThread::Get(); 76 IPC::Sender* sender = content::RenderThread::Get();
76 if (sender == NULL) 77 if (sender == NULL)
77 sender = g_background_thread_sender.Pointer()->get(); 78 sender = g_background_thread_sender.Pointer()->get();
78 79
79 int routing_id = 0; 80 int routing_id = 0;
80 // If the nexe uses ppapi APIs, we need a routing ID. 81 // If the nexe uses ppapi APIs, we need a routing ID.
81 // To get the routing ID, we must be on the main thread. 82 // To get the routing ID, we must be on the main thread.
82 // Some nexes do not use ppapi and launch from the background thread, 83 // Some nexes do not use ppapi and launch from the background thread,
(...skipping 13 matching lines...) Expand all
96 // must also check on the trusted side of the proxy. 97 // must also check on the trusted side of the proxy.
97 if (enable_ppapi_dev) 98 if (enable_ppapi_dev)
98 perm_bits |= ppapi::PERMISSION_DEV; 99 perm_bits |= ppapi::PERMISSION_DEV;
99 instance_info.permissions = 100 instance_info.permissions =
100 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); 101 ppapi::PpapiPermissions::GetForCommandLine(perm_bits);
101 102
102 if (!sender->Send(new ChromeViewHostMsg_LaunchNaCl( 103 if (!sender->Send(new ChromeViewHostMsg_LaunchNaCl(
103 instance_info.url, 104 instance_info.url,
104 routing_id, 105 routing_id,
105 perm_bits, 106 perm_bits,
106 socket_count, &sockets, 107 socket_count,
108 PP_ToBool(uses_irt),
Mark Seaborn 2013/01/04 00:05:41 You don't need PP_ToBool() here, do you? It's alr
jvoung (off chromium) 2013/01/04 17:09:23 This is convert it from a PP_Bool to a "bool" (ins
109 &sockets,
107 &instance_info.channel_handle, 110 &instance_info.channel_handle,
108 &instance_info.plugin_child_id))) { 111 &instance_info.plugin_child_id))) {
109 return PP_NACL_FAILED; 112 return PP_NACL_FAILED;
110 } 113 }
111 114
112 // Don't save instance_info if channel handle is invalid. 115 // Don't save instance_info if channel handle is invalid.
113 bool invalid_handle = instance_info.channel_handle.name.empty(); 116 bool invalid_handle = instance_info.channel_handle.name.empty();
114 #if defined(OS_POSIX) 117 #if defined(OS_POSIX)
115 if (!invalid_handle) 118 if (!invalid_handle)
116 invalid_handle = (instance_info.channel_handle.socket.fd == -1); 119 invalid_handle = (instance_info.channel_handle.socket.fd == -1);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 &ReportNaClError 281 &ReportNaClError
279 }; 282 };
280 283
281 } // namespace 284 } // namespace
282 285
283 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { 286 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() {
284 return &nacl_interface; 287 return &nacl_interface;
285 } 288 }
286 289
287 #endif // DISABLE_NACL 290 #endif // DISABLE_NACL
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698