| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_broker_proxy.h" | 5 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/trusted/ppb_broker_trusted.h" | 8 #include "ppapi/c/trusted/ppb_broker_trusted.h" |
| 9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| 11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
| 12 #include "ppapi/thunk/ppb_broker_api.h" | 12 #include "ppapi/thunk/ppb_broker_api.h" |
| 13 #include "ppapi/thunk/enter.h" | 13 #include "ppapi/thunk/enter.h" |
| 14 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
| 15 | 15 |
| 16 using ppapi::HostResource; | |
| 17 using ppapi::Resource; | |
| 18 using ppapi::thunk::PPB_Broker_API; | 16 using ppapi::thunk::PPB_Broker_API; |
| 19 | 17 |
| 20 namespace pp { | 18 namespace ppapi { |
| 21 namespace proxy { | 19 namespace proxy { |
| 22 | 20 |
| 23 namespace { | 21 namespace { |
| 24 | 22 |
| 25 base::PlatformFile IntToPlatformFile(int32_t handle) { | 23 base::PlatformFile IntToPlatformFile(int32_t handle) { |
| 26 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| 27 return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); | 25 return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); |
| 28 #elif defined(OS_POSIX) | 26 #elif defined(OS_POSIX) |
| 29 return handle; | 27 return handle; |
| 30 #else | 28 #else |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // The plugin did not receive the handle, so it must be closed. | 266 // The plugin did not receive the handle, so it must be closed. |
| 269 // The easiest way to clean it up is to just put it in an object | 267 // The easiest way to clean it up is to just put it in an object |
| 270 // and then close it. This failure case is not performance critical. | 268 // and then close it. This failure case is not performance critical. |
| 271 // The handle could still leak if Send succeeded but the IPC later failed. | 269 // The handle could still leak if Send succeeded but the IPC later failed. |
| 272 base::SyncSocket temp_socket( | 270 base::SyncSocket temp_socket( |
| 273 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); | 271 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); |
| 274 } | 272 } |
| 275 } | 273 } |
| 276 | 274 |
| 277 } // namespace proxy | 275 } // namespace proxy |
| 278 } // namespace pp | 276 } // namespace ppapi |
| OLD | NEW |