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