| 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 #include "ppapi/proxy/ppb_buffer_proxy.h" | 5 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ppapi/c/pp_completion_callback.h" | 11 #include "ppapi/c/pp_completion_callback.h" |
| 12 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
| 13 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "ppapi/c/dev/ppb_buffer_dev.h" | 14 #include "ppapi/c/dev/ppb_buffer_dev.h" |
| 15 #include "ppapi/proxy/host_dispatcher.h" | 15 #include "ppapi/proxy/host_dispatcher.h" |
| 16 #include "ppapi/proxy/plugin_dispatcher.h" | 16 #include "ppapi/proxy/plugin_dispatcher.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
| 18 #include "ppapi/thunk/enter.h" | 18 #include "ppapi/thunk/enter.h" |
| 19 #include "ppapi/thunk/ppb_buffer_trusted_api.h" | 19 #include "ppapi/thunk/ppb_buffer_trusted_api.h" |
| 20 #include "ppapi/thunk/resource_creation_api.h" | 20 #include "ppapi/thunk/resource_creation_api.h" |
| 21 #include "ppapi/thunk/thunk.h" | 21 #include "ppapi/thunk/thunk.h" |
| 22 | 22 |
| 23 namespace ppapi { | 23 namespace ppapi { |
| 24 namespace proxy { | 24 namespace proxy { |
| 25 | 25 |
| 26 Buffer::Buffer(const HostResource& resource, | 26 Buffer::Buffer(const HostResource& resource, |
| 27 const base::SharedMemoryHandle& shm_handle, | 27 const base::SharedMemoryHandle& shm_handle, |
| 28 uint32_t size) | 28 uint32_t size) |
| 29 : Resource(resource), | 29 : Resource(OBJECT_IS_PROXY, resource), |
| 30 shm_(shm_handle, false), | 30 shm_(shm_handle, false), |
| 31 size_(size), | 31 size_(size), |
| 32 mapped_data_(NULL), | 32 mapped_data_(NULL), |
| 33 map_count_(0) { | 33 map_count_(0) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 Buffer::~Buffer() { | 36 Buffer::~Buffer() { |
| 37 Unmap(); | 37 Unmap(); |
| 38 } | 38 } |
| 39 | 39 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 #elif defined(OS_POSIX) | 141 #elif defined(OS_POSIX) |
| 142 local_fd; | 142 local_fd; |
| 143 #else | 143 #else |
| 144 #error Not implemented. | 144 #error Not implemented. |
| 145 #endif | 145 #endif |
| 146 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); | 146 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace proxy | 149 } // namespace proxy |
| 150 } // namespace ppapi | 150 } // namespace ppapi |
| OLD | NEW |