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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (!invalid_handle) | 121 if (!invalid_handle) |
122 g_instance_info.Get()[instance] = instance_info; | 122 g_instance_info.Get()[instance] = instance_info; |
123 | 123 |
124 *(static_cast<nacl::Handle*>(imc_handle)) = | 124 *(static_cast<nacl::Handle*>(imc_handle)) = |
125 nacl::ToNativeHandle(result_socket); | 125 nacl::ToNativeHandle(result_socket); |
126 | 126 |
127 return PP_NACL_OK; | 127 return PP_NACL_OK; |
128 } | 128 } |
129 | 129 |
130 PP_NaClResult StartPpapiProxy(PP_Instance instance) { | 130 PP_NaClResult StartPpapiProxy(PP_Instance instance) { |
131 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
132 switches::kEnableNaClSRPCProxy)) | |
133 return PP_NACL_USE_SRPC; | |
134 | |
135 InstanceInfoMap& map = g_instance_info.Get(); | 131 InstanceInfoMap& map = g_instance_info.Get(); |
136 InstanceInfoMap::iterator it = map.find(instance); | 132 InstanceInfoMap::iterator it = map.find(instance); |
137 if (it == map.end()) | 133 if (it == map.end()) |
138 return PP_NACL_FAILED; | 134 return PP_NACL_FAILED; |
139 InstanceInfo instance_info = it->second; | 135 InstanceInfo instance_info = it->second; |
140 map.erase(it); | 136 map.erase(it); |
141 | 137 |
142 webkit::ppapi::PluginInstance* plugin_instance = | 138 webkit::ppapi::PluginInstance* plugin_instance = |
143 content::GetHostGlobals()->GetInstance(instance); | 139 content::GetHostGlobals()->GetInstance(instance); |
144 if (!plugin_instance) | 140 if (!plugin_instance) |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 &ReportNaClError | 275 &ReportNaClError |
280 }; | 276 }; |
281 | 277 |
282 } // namespace | 278 } // namespace |
283 | 279 |
284 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 280 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
285 return &nacl_interface; | 281 return &nacl_interface; |
286 } | 282 } |
287 | 283 |
288 #endif // DISABLE_NACL | 284 #endif // DISABLE_NACL |
OLD | NEW |