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 #ifndef PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ |
7 | 7 |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "ipc/ipc_platform_file.h" | 9 #include "ipc/ipc_platform_file.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
11 #include "ppapi/cpp/completion_callback.h" | 11 #include "ppapi/cpp/completion_callback.h" |
12 #include "ppapi/proxy/interface_proxy.h" | 12 #include "ppapi/proxy/interface_proxy.h" |
13 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 13 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
14 | 14 |
15 struct PPB_Flash_NetConnector; | 15 struct PPB_Flash_NetConnector; |
16 | 16 |
17 namespace pp { | 17 namespace pp { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 class HostResource; | 20 class HostResource; |
21 | 21 |
22 class PPB_Flash_NetConnector_Proxy : public InterfaceProxy { | 22 class PPB_Flash_NetConnector_Proxy : public InterfaceProxy { |
23 public: | 23 public: |
24 PPB_Flash_NetConnector_Proxy(Dispatcher* dispatcher, | 24 PPB_Flash_NetConnector_Proxy(Dispatcher* dispatcher, |
25 const void* target_interface); | 25 const void* target_interface); |
26 virtual ~PPB_Flash_NetConnector_Proxy(); | 26 virtual ~PPB_Flash_NetConnector_Proxy(); |
27 | 27 |
28 static const Info* GetInfo(); | 28 static const Info* GetInfo(); |
29 | 29 |
30 const PPB_Flash_NetConnector* ppb_flash_net_connector_target() const { | 30 static PP_Resource CreateProxyResource(PP_Instance instance); |
31 return reinterpret_cast<const PPB_Flash_NetConnector*>( | |
32 target_interface()); | |
33 } | |
34 | 31 |
35 // InterfaceProxy implementation. | 32 // InterfaceProxy implementation. |
36 virtual bool OnMessageReceived(const IPC::Message& msg); | 33 virtual bool OnMessageReceived(const IPC::Message& msg); |
37 | 34 |
38 private: | 35 private: |
39 struct ConnectCallbackInfo; | 36 struct ConnectCallbackInfo; |
40 | 37 |
41 // Plugin->host message handlers. | 38 // Plugin->host message handlers. |
42 void OnMsgCreate(PP_Instance instance, | 39 void OnMsgCreate(PP_Instance instance, |
43 HostResource* result); | 40 HostResource* result); |
(...skipping 13 matching lines...) Expand all Loading... |
57 void OnCompleteCallbackInHost(int32_t result, ConnectCallbackInfo* info); | 54 void OnCompleteCallbackInHost(int32_t result, ConnectCallbackInfo* info); |
58 | 55 |
59 CompletionCallbackFactory<PPB_Flash_NetConnector_Proxy, | 56 CompletionCallbackFactory<PPB_Flash_NetConnector_Proxy, |
60 ProxyNonThreadSafeRefCount> callback_factory_; | 57 ProxyNonThreadSafeRefCount> callback_factory_; |
61 }; | 58 }; |
62 | 59 |
63 } // namespace proxy | 60 } // namespace proxy |
64 } // namespace pp | 61 } // namespace pp |
65 | 62 |
66 #endif // PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ | 63 #endif // PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_ |
OLD | NEW |