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_PPP_INSTANCE_PRIVATE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPP_INSTANCE_PRIVATE_PROXY_H_ |
6 #define PPAPI_PROXY_PPP_INSTANCE_PRIVATE_PROXY_H_ | 6 #define PPAPI_PROXY_PPP_INSTANCE_PRIVATE_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
11 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
12 #include "ppapi/shared_impl/host_resource.h" | 12 #include "ppapi/shared_impl/host_resource.h" |
13 | 13 |
14 struct PPP_Instance_Private; | 14 struct PPP_Instance_Private; |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
17 namespace proxy { | 17 namespace proxy { |
18 | 18 |
19 class SerializedVarReturnValue; | 19 class SerializedVarReturnValue; |
20 | 20 |
21 class PPP_Instance_Private_Proxy : public InterfaceProxy { | 21 class PPP_Instance_Private_Proxy : public InterfaceProxy { |
22 public: | 22 public: |
23 PPP_Instance_Private_Proxy(Dispatcher* dispatcher); | 23 PPP_Instance_Private_Proxy(Dispatcher* dispatcher, |
| 24 const void* target_interface); |
24 virtual ~PPP_Instance_Private_Proxy(); | 25 virtual ~PPP_Instance_Private_Proxy(); |
25 | 26 |
26 static const Info* GetInfo(); | 27 static const Info* GetInfo(); |
27 | 28 |
| 29 const PPP_Instance_Private* ppp_instance_private_target() const { |
| 30 return reinterpret_cast<const PPP_Instance_Private*>(target_interface()); |
| 31 } |
| 32 |
28 private: | 33 private: |
29 // InterfaceProxy implementation. | 34 // InterfaceProxy implementation. |
30 virtual bool OnMessageReceived(const IPC::Message& msg); | 35 virtual bool OnMessageReceived(const IPC::Message& msg); |
31 | 36 |
32 // Message handlers. | 37 // Message handlers. |
33 void OnMsgGetInstanceObject(PP_Instance instance, | 38 void OnMsgGetInstanceObject(PP_Instance instance, |
34 SerializedVarReturnValue result); | 39 SerializedVarReturnValue result); |
35 | |
36 // When this proxy is in the plugin side, this value caches the interface | |
37 // pointer so we don't have to retrieve it from the dispatcher each time. | |
38 // In the host, this value is always NULL. | |
39 const PPP_Instance_Private* ppp_instance_private_impl_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(PPP_Instance_Private_Proxy); | |
42 }; | 40 }; |
43 | 41 |
44 } // namespace proxy | 42 } // namespace proxy |
45 } // namespace ppapi | 43 } // namespace ppapi |
46 | 44 |
47 #endif // PPAPI_PROXY_PPP_INSTANCE_PRIVATE_PROXY_H_ | 45 #endif // PPAPI_PROXY_PPP_INSTANCE_PRIVATE_PROXY_H_ |
OLD | NEW |