| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SHARED_IMPL_VAR_H_ | 5 #ifndef PPAPI_SHARED_IMPL_VAR_H_ |
| 6 #define PPAPI_SHARED_IMPL_VAR_H_ | 6 #define PPAPI_SHARED_IMPL_VAR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 virtual void Unmap() = 0; | 165 virtual void Unmap() = 0; |
| 166 virtual uint32 ByteLength() = 0; | 166 virtual uint32 ByteLength() = 0; |
| 167 | 167 |
| 168 // Creates a new shared memory region, and copies the data in the | 168 // Creates a new shared memory region, and copies the data in the |
| 169 // ArrayBufferVar into it. On the plugin side, host_shm_handle_id will be set | 169 // ArrayBufferVar into it. On the plugin side, host_shm_handle_id will be set |
| 170 // to some value that is not -1. On the host side, plugin_shm_handle will be | 170 // to some value that is not -1. On the host side, plugin_shm_handle will be |
| 171 // set to a valid SharedMemoryHandle. | 171 // set to a valid SharedMemoryHandle. |
| 172 // | 172 // |
| 173 // Returns true if creating the shared memory (and copying) is successful, | 173 // Returns true if creating the shared memory (and copying) is successful, |
| 174 // false otherwise. | 174 // false otherwise. |
| 175 virtual bool CopyToNewShmem( | 175 virtual bool CopyToNewShmem(PP_Instance instance, |
| 176 PP_Instance instance, | 176 int* host_shm_handle_id, |
| 177 int *host_shm_handle_id, | 177 base::SharedMemoryHandle* plugin_shm_handle) = 0; |
| 178 base::SharedMemoryHandle *plugin_shm_handle) = 0; | |
| 179 | 178 |
| 180 // Var override. | 179 // Var override. |
| 181 virtual ArrayBufferVar* AsArrayBufferVar() OVERRIDE; | 180 virtual ArrayBufferVar* AsArrayBufferVar() OVERRIDE; |
| 182 virtual PP_VarType GetType() const OVERRIDE; | 181 virtual PP_VarType GetType() const OVERRIDE; |
| 183 | 182 |
| 184 // Helper function that converts a PP_Var to an ArrayBufferVar. This will | 183 // Helper function that converts a PP_Var to an ArrayBufferVar. This will |
| 185 // return NULL if the PP_Var is not of ArrayBuffer type. | 184 // return NULL if the PP_Var is not of ArrayBuffer type. |
| 186 static ArrayBufferVar* FromPPVar(PP_Var var); | 185 static ArrayBufferVar* FromPPVar(PP_Var var); |
| 187 | 186 |
| 188 private: | 187 private: |
| 189 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); | 188 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); |
| 190 }; | 189 }; |
| 191 | 190 |
| 192 } // namespace ppapi | 191 } // namespace ppapi |
| 193 | 192 |
| 194 #endif // PPAPI_SHARED_IMPL_VAR_H_ | 193 #endif // PPAPI_SHARED_IMPL_VAR_H_ |
| OLD | NEW |