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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 routing_id = render_view->GetRoutingID(); | 88 routing_id = render_view->GetRoutingID(); |
89 } | 89 } |
90 | 90 |
91 InstanceInfo instance_info; | 91 InstanceInfo instance_info; |
92 instance_info.url = GURL(alleged_url); | 92 instance_info.url = GURL(alleged_url); |
93 | 93 |
94 uint32_t perm_bits = ppapi::PERMISSION_NONE; | 94 uint32_t perm_bits = ppapi::PERMISSION_NONE; |
95 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so | 95 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so |
96 // 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 |
97 // must also check on the trusted side of the proxy. | 97 // must also check on the trusted side of the proxy. |
98 // TODO(bbudge) verify we're blocking 'Dev' interfaces on the trusted side. | |
99 if (enable_ppapi_dev) | 98 if (enable_ppapi_dev) |
100 perm_bits |= ppapi::PERMISSION_DEV; | 99 perm_bits |= ppapi::PERMISSION_DEV; |
101 instance_info.permissions = ppapi::PpapiPermissions(perm_bits); | 100 instance_info.permissions = |
| 101 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); |
102 | 102 |
103 if (!sender->Send(new ChromeViewHostMsg_LaunchNaCl( | 103 if (!sender->Send(new ChromeViewHostMsg_LaunchNaCl( |
104 instance_info.url, | 104 instance_info.url, |
105 routing_id, | 105 routing_id, |
106 perm_bits, | 106 perm_bits, |
107 socket_count, &sockets, | 107 socket_count, &sockets, |
108 &instance_info.channel_handle, | 108 &instance_info.channel_handle, |
109 &instance_info.plugin_child_id))) { | 109 &instance_info.plugin_child_id))) { |
110 return PP_NACL_FAILED; | 110 return PP_NACL_FAILED; |
111 } | 111 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 &IsPnaclEnabled | 265 &IsPnaclEnabled |
266 }; | 266 }; |
267 | 267 |
268 } // namespace | 268 } // namespace |
269 | 269 |
270 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 270 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
271 return &nacl_interface; | 271 return &nacl_interface; |
272 } | 272 } |
273 | 273 |
274 #endif // DISABLE_NACL | 274 #endif // DISABLE_NACL |
OLD | NEW |