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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 shm_(shm_handle, false), | 38 shm_(shm_handle, false), |
39 size_(size), | 39 size_(size), |
40 mapped_data_(NULL), | 40 mapped_data_(NULL), |
41 map_count_(0) { | 41 map_count_(0) { |
42 } | 42 } |
43 | 43 |
44 Buffer::~Buffer() { | 44 Buffer::~Buffer() { |
45 Unmap(); | 45 Unmap(); |
46 } | 46 } |
47 | 47 |
48 Buffer* Buffer::AsBuffer() { | |
49 return this; | |
50 } | |
51 | |
52 ppapi::thunk::PPB_Buffer_API* Buffer::AsPPB_Buffer_API() { | 48 ppapi::thunk::PPB_Buffer_API* Buffer::AsPPB_Buffer_API() { |
53 return this; | 49 return this; |
54 } | 50 } |
55 | 51 |
56 PP_Bool Buffer::Describe(uint32_t* size_in_bytes) { | 52 PP_Bool Buffer::Describe(uint32_t* size_in_bytes) { |
57 *size_in_bytes = size_; | 53 *size_in_bytes = size_; |
58 return PP_TRUE; | 54 return PP_TRUE; |
59 } | 55 } |
60 | 56 |
61 PP_Bool Buffer::IsMapped() { | 57 PP_Bool Buffer::IsMapped() { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #elif defined(OS_POSIX) | 158 #elif defined(OS_POSIX) |
163 local_fd; | 159 local_fd; |
164 #else | 160 #else |
165 #error Not implemented. | 161 #error Not implemented. |
166 #endif | 162 #endif |
167 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); | 163 *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false); |
168 } | 164 } |
169 | 165 |
170 } // namespace proxy | 166 } // namespace proxy |
171 } // namespace pp | 167 } // namespace pp |
OLD | NEW |