| 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 28 matching lines...) Expand all Loading... |
| 39 base::SharedMemory shm_; | 39 base::SharedMemory shm_; |
| 40 uint32_t size_; | 40 uint32_t size_; |
| 41 void* mapped_data_; | 41 void* mapped_data_; |
| 42 int map_count_; | 42 int map_count_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(Buffer); | 44 DISALLOW_COPY_AND_ASSIGN(Buffer); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class PPB_Buffer_Proxy : public InterfaceProxy { | 47 class PPB_Buffer_Proxy : public InterfaceProxy { |
| 48 public: | 48 public: |
| 49 PPB_Buffer_Proxy(Dispatcher* dispatcher, const void* target_interface); | 49 PPB_Buffer_Proxy(Dispatcher* dispatcher); |
| 50 virtual ~PPB_Buffer_Proxy(); | 50 virtual ~PPB_Buffer_Proxy(); |
| 51 | 51 |
| 52 static const Info* GetInfo(); | |
| 53 | |
| 54 static PP_Resource CreateProxyResource(PP_Instance instance, | 52 static PP_Resource CreateProxyResource(PP_Instance instance, |
| 55 uint32_t size); | 53 uint32_t size); |
| 56 static PP_Resource AddProxyResource(const HostResource& resource, | 54 static PP_Resource AddProxyResource(const HostResource& resource, |
| 57 base::SharedMemoryHandle shm_handle, | 55 base::SharedMemoryHandle shm_handle, |
| 58 uint32_t size); | 56 uint32_t size); |
| 59 | 57 |
| 60 const PPB_Buffer_Dev* ppb_buffer_target() const { | |
| 61 return static_cast<const PPB_Buffer_Dev*>(target_interface()); | |
| 62 } | |
| 63 | |
| 64 // InterfaceProxy implementation. | 58 // InterfaceProxy implementation. |
| 65 virtual bool OnMessageReceived(const IPC::Message& msg); | 59 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 66 | 60 |
| 61 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_BUFFER; |
| 62 |
| 67 private: | 63 private: |
| 68 // Message handlers. | 64 // Message handlers. |
| 69 void OnMsgCreate(PP_Instance instance, | 65 void OnMsgCreate(PP_Instance instance, |
| 70 uint32_t size, | 66 uint32_t size, |
| 71 HostResource* result_resource, | 67 HostResource* result_resource, |
| 72 base::SharedMemoryHandle* result_shm_handle); | 68 base::SharedMemoryHandle* result_shm_handle); |
| 73 }; | 69 }; |
| 74 | 70 |
| 75 } // namespace proxy | 71 } // namespace proxy |
| 76 } // namespace ppapi | 72 } // namespace ppapi |
| 77 | 73 |
| 78 #endif // PPAPI_PPB_BUFFER_PROXY_H_ | 74 #endif // PPAPI_PPB_BUFFER_PROXY_H_ |
| OLD | NEW |