| 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 "ppapi/proxy/ppb_broker_proxy.h" | 5 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/trusted/ppb_broker_trusted.h" | 9 #include "ppapi/c/trusted/ppb_broker_trusted.h" |
| 10 #include "ppapi/proxy/enter_proxy.h" | 10 #include "ppapi/proxy/enter_proxy.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // and then close them. This failure case is not performance critical. | 101 // and then close them. This failure case is not performance critical. |
| 102 base::SyncSocket temp_socket( | 102 base::SyncSocket temp_socket( |
| 103 IPC::PlatformFileForTransitToPlatformFile(socket_handle)); | 103 IPC::PlatformFileForTransitToPlatformFile(socket_handle)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 if (!TrackedCallback::IsPending(current_connect_callback_)) { | 106 if (!TrackedCallback::IsPending(current_connect_callback_)) { |
| 107 // The handle might leak if the plugin never calls GetHandle(). | 107 // The handle might leak if the plugin never calls GetHandle(). |
| 108 return; | 108 return; |
| 109 } | 109 } |
| 110 | 110 |
| 111 TrackedCallback::ClearAndRun(¤t_connect_callback_, result); | 111 current_connect_callback_->Run(result); |
| 112 } | 112 } |
| 113 | 113 |
| 114 PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher) | 114 PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher) |
| 115 : InterfaceProxy(dispatcher), | 115 : InterfaceProxy(dispatcher), |
| 116 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)){ | 116 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)){ |
| 117 } | 117 } |
| 118 | 118 |
| 119 PPB_Broker_Proxy::~PPB_Broker_Proxy() { | 119 PPB_Broker_Proxy::~PPB_Broker_Proxy() { |
| 120 } | 120 } |
| 121 | 121 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // The easiest way to clean it up is to just put it in an object | 222 // The easiest way to clean it up is to just put it in an object |
| 223 // and then close it. This failure case is not performance critical. | 223 // and then close it. This failure case is not performance critical. |
| 224 // The handle could still leak if Send succeeded but the IPC later failed. | 224 // The handle could still leak if Send succeeded but the IPC later failed. |
| 225 base::SyncSocket temp_socket( | 225 base::SyncSocket temp_socket( |
| 226 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); | 226 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace proxy | 230 } // namespace proxy |
| 231 } // namespace ppapi | 231 } // namespace ppapi |
| OLD | NEW |