| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_PPB_BROKER_PROXY_H_ |
| 6 #define PPAPI_PPB_BROKER_PROXY_H_ |
| 7 |
| 8 #include "base/sync_socket.h" |
| 9 #include "ipc/ipc_platform_file.h" |
| 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/cpp/completion_callback.h" |
| 12 #include "ppapi/proxy/interface_proxy.h" |
| 13 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
| 14 |
| 15 |
| 16 struct PPB_BrokerTrusted; |
| 17 |
| 18 namespace pp { |
| 19 namespace proxy { |
| 20 |
| 21 class HostResource; |
| 22 |
| 23 class PPB_Broker_Proxy : public InterfaceProxy { |
| 24 public: |
| 25 PPB_Broker_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 26 virtual ~PPB_Broker_Proxy(); |
| 27 |
| 28 static const Info* GetInfo(); |
| 29 |
| 30 const PPB_BrokerTrusted* ppb_broker_target() const { |
| 31 return static_cast<const PPB_BrokerTrusted*>(target_interface()); |
| 32 } |
| 33 |
| 34 // InterfaceProxy implementation. |
| 35 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 36 |
| 37 private: |
| 38 // Message handlers. |
| 39 void OnMsgCreate(PP_Instance instance, HostResource* result_resource); |
| 40 void OnMsgConnect(const HostResource& broker); |
| 41 void OnMsgConnectComplete(const HostResource& broker, |
| 42 IPC::PlatformFileForTransit foreign_socket_handle, |
| 43 int32_t result); |
| 44 |
| 45 void ConnectCompleteInHost(int32_t result, const HostResource& host_resource); |
| 46 |
| 47 CompletionCallbackFactory<PPB_Broker_Proxy, |
| 48 ProxyNonThreadSafeRefCount> callback_factory_; |
| 49 }; |
| 50 |
| 51 } // namespace proxy |
| 52 } // namespace pp |
| 53 |
| 54 #endif // PPAPI_PPB_BROKER_PROXY_H_ |
| OLD | NEW |