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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Don't save instance_info if channel handle is invalid. | 115 // Don't save instance_info if channel handle is invalid. |
116 bool invalid_handle = instance_info.channel_handle.name.empty(); | 116 bool invalid_handle = instance_info.channel_handle.name.empty(); |
117 #if defined(OS_POSIX) | 117 #if defined(OS_POSIX) |
118 if (!invalid_handle) | 118 if (!invalid_handle) |
119 invalid_handle = (instance_info.channel_handle.socket.fd == -1); | 119 invalid_handle = (instance_info.channel_handle.socket.fd == -1); |
120 #endif | 120 #endif |
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<NaClHandle*>(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 InstanceInfoMap& map = g_instance_info.Get(); | 131 InstanceInfoMap& map = g_instance_info.Get(); |
132 InstanceInfoMap::iterator it = map.find(instance); | 132 InstanceInfoMap::iterator it = map.find(instance); |
133 if (it == map.end()) { | 133 if (it == map.end()) { |
134 DLOG(ERROR) << "Could not find instance ID"; | 134 DLOG(ERROR) << "Could not find instance ID"; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 &ReportNaClError | 281 &ReportNaClError |
282 }; | 282 }; |
283 | 283 |
284 } // namespace | 284 } // namespace |
285 | 285 |
286 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { | 286 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { |
287 return &nacl_interface; | 287 return &nacl_interface; |
288 } | 288 } |
289 | 289 |
290 #endif // DISABLE_NACL | 290 #endif // DISABLE_NACL |
OLD | NEW |