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_PPB_BUFFER_PROXY_H_ | 5 #ifndef PPAPI_PPB_BUFFER_PROXY_H_ |
6 #define PPAPI_PPB_BUFFER_PROXY_H_ | 6 #define PPAPI_PPB_BUFFER_PROXY_H_ |
7 | 7 |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 class PPB_Buffer_Proxy : public InterfaceProxy { | 50 class PPB_Buffer_Proxy : public InterfaceProxy { |
51 public: | 51 public: |
52 PPB_Buffer_Proxy(Dispatcher* dispatcher, const void* target_interface); | 52 PPB_Buffer_Proxy(Dispatcher* dispatcher, const void* target_interface); |
53 virtual ~PPB_Buffer_Proxy(); | 53 virtual ~PPB_Buffer_Proxy(); |
54 | 54 |
55 static const Info* GetInfo(); | 55 static const Info* GetInfo(); |
56 | 56 |
57 static PP_Resource CreateProxyResource(PP_Instance instance, | 57 static PP_Resource CreateProxyResource(PP_Instance instance, |
58 uint32_t size); | 58 uint32_t size); |
| 59 static PP_Resource AddProxyResource(const HostResource& resource, |
| 60 base::SharedMemoryHandle shm_handle, |
| 61 uint32_t size); |
59 | 62 |
60 const PPB_Buffer_Dev* ppb_buffer_target() const { | 63 const PPB_Buffer_Dev* ppb_buffer_target() const { |
61 return static_cast<const PPB_Buffer_Dev*>(target_interface()); | 64 return static_cast<const PPB_Buffer_Dev*>(target_interface()); |
62 } | 65 } |
63 | 66 |
64 // InterfaceProxy implementation. | 67 // InterfaceProxy implementation. |
65 virtual bool OnMessageReceived(const IPC::Message& msg); | 68 virtual bool OnMessageReceived(const IPC::Message& msg); |
66 | 69 |
67 private: | 70 private: |
68 // Message handlers. | 71 // Message handlers. |
69 void OnMsgCreate(PP_Instance instance, | 72 void OnMsgCreate(PP_Instance instance, |
70 uint32_t size, | 73 uint32_t size, |
71 HostResource* result_resource, | 74 HostResource* result_resource, |
72 base::SharedMemoryHandle* result_shm_handle); | 75 base::SharedMemoryHandle* result_shm_handle); |
73 }; | 76 }; |
74 | 77 |
75 } // namespace proxy | 78 } // namespace proxy |
76 } // namespace pp | 79 } // namespace pp |
77 | 80 |
78 #endif // PPAPI_PPB_BUFFER_PROXY_H_ | 81 #endif // PPAPI_PPB_BUFFER_PROXY_H_ |
OLD | NEW |