OLD | NEW |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 content::RendererPpapiHost *host = | 61 content::RendererPpapiHost *host = |
62 content::RendererPpapiHost::GetForPPInstance(instance); | 62 content::RendererPpapiHost::GetForPPInstance(instance); |
63 if (!host) | 63 if (!host) |
64 return 0; | 64 return 0; |
65 return host->GetRoutingIDForWidget(instance); | 65 return host->GetRoutingIDForWidget(instance); |
66 } | 66 } |
67 | 67 |
68 // Launch NaCl's sel_ldr process. | 68 // Launch NaCl's sel_ldr process. |
69 PP_NaClResult LaunchSelLdr(PP_Instance instance, | 69 PP_NaClResult LaunchSelLdr(PP_Instance instance, |
70 const char* alleged_url, | 70 const char* alleged_url, |
| 71 PP_Bool uses_irt, |
71 PP_Bool uses_ppapi, | 72 PP_Bool uses_ppapi, |
72 PP_Bool enable_ppapi_dev, | 73 PP_Bool enable_ppapi_dev, |
73 void* imc_handle) { | 74 void* imc_handle) { |
74 nacl::FileDescriptor result_socket; | 75 nacl::FileDescriptor result_socket; |
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. |
(...skipping 14 matching lines...) Expand all Loading... |
95 // it's clearer to developers when they are using 'Dev' inappropriately. We | 96 // it's clearer to developers when they are using 'Dev' inappropriately. We |
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 nacl::NaClLaunchParams(instance_info.url.spec(), | 104 nacl::NaClLaunchParams(instance_info.url.spec(), |
104 routing_id, | 105 routing_id, |
105 perm_bits), | 106 perm_bits, |
| 107 PP_ToBool(uses_irt)), |
106 &result_socket, | 108 &result_socket, |
107 &instance_info.channel_handle, | 109 &instance_info.channel_handle, |
108 &instance_info.plugin_pid, | 110 &instance_info.plugin_pid, |
109 &instance_info.plugin_child_id))) { | 111 &instance_info.plugin_child_id))) { |
110 return PP_NACL_FAILED; | 112 return PP_NACL_FAILED; |
111 } | 113 } |
112 | 114 |
113 // Don't save instance_info if channel handle is invalid. | 115 // Don't save instance_info if channel handle is invalid. |
114 bool invalid_handle = instance_info.channel_handle.name.empty(); | 116 bool invalid_handle = instance_info.channel_handle.name.empty(); |
115 #if defined(OS_POSIX) | 117 #if defined(OS_POSIX) |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 &ReportNaClError | 279 &ReportNaClError |
278 }; | 280 }; |
279 | 281 |
280 } // namespace | 282 } // namespace |
281 | 283 |
282 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 284 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
283 return &nacl_interface; | 285 return &nacl_interface; |
284 } | 286 } |
285 | 287 |
286 #endif // DISABLE_NACL | 288 #endif // DISABLE_NACL |
OLD | NEW |