| 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 "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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // The plugin module owns the handle. | 47 // The plugin module owns the handle. |
| 48 // The host side transfers ownership of the handle to the plugin side when it | 48 // The host side transfers ownership of the handle to the plugin side when it |
| 49 // sends the IPC. This member holds the handle value for the plugin module | 49 // sends the IPC. This member holds the handle value for the plugin module |
| 50 // to read, but the plugin side of the proxy never takes ownership. | 50 // to read, but the plugin side of the proxy never takes ownership. |
| 51 base::SyncSocket::Handle socket_handle_; | 51 base::SyncSocket::Handle socket_handle_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(Broker); | 53 DISALLOW_COPY_AND_ASSIGN(Broker); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 Broker::Broker(const HostResource& resource) | 56 Broker::Broker(const HostResource& resource) |
| 57 : Resource(resource), | 57 : Resource(OBJECT_IS_PROXY, resource), |
| 58 called_connect_(false), | 58 called_connect_(false), |
| 59 socket_handle_(base::kInvalidPlatformFileValue) { | 59 socket_handle_(base::kInvalidPlatformFileValue) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 Broker::~Broker() { | 62 Broker::~Broker() { |
| 63 socket_handle_ = base::kInvalidPlatformFileValue; | 63 socket_handle_ = base::kInvalidPlatformFileValue; |
| 64 } | 64 } |
| 65 | 65 |
| 66 PPB_Broker_API* Broker::AsPPB_Broker_API() { | 66 PPB_Broker_API* Broker::AsPPB_Broker_API() { |
| 67 return this; | 67 return this; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // The easiest way to clean it up is to just put it in an object | 226 // The easiest way to clean it up is to just put it in an object |
| 227 // and then close it. This failure case is not performance critical. | 227 // and then close it. This failure case is not performance critical. |
| 228 // The handle could still leak if Send succeeded but the IPC later failed. | 228 // The handle could still leak if Send succeeded but the IPC later failed. |
| 229 base::SyncSocket temp_socket( | 229 base::SyncSocket temp_socket( |
| 230 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); | 230 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace proxy | 234 } // namespace proxy |
| 235 } // namespace ppapi | 235 } // namespace ppapi |
| OLD | NEW |