| 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_CPP_VAR_ARRAY_BUFFER_H_ | 5 #ifndef PPAPI_CPP_VAR_ARRAY_BUFFER_H_ |
| 6 #define PPAPI_CPP_VAR_ARRAY_BUFFER_H_ | 6 #define PPAPI_CPP_VAR_ARRAY_BUFFER_H_ |
| 7 | 7 |
| 8 #include "ppapi/cpp/var.h" | 8 #include "ppapi/cpp/var.h" |
| 9 | 9 |
| 10 /// @file | 10 /// @file |
| 11 /// This file defines the API for interacting with a JavaScript ArrayBuffer. | 11 /// This file defines the API for interacting with a JavaScript ArrayBuffer. |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 /// <code>VarArrayBuffer</code> provides a way to interact with JavaScript | 15 /// <code>VarArrayBuffer</code> provides a way to interact with JavaScript |
| 16 /// ArrayBuffers, which represent a contiguous sequence of bytes. Note that | 16 /// ArrayBuffers, which represent a contiguous sequence of bytes. Note that |
| 17 /// these vars are not part of the embedding page's DOM, and can only be | 17 /// these vars are not part of the embedding page's DOM, and can only be |
| 18 /// shared with JavaScript using the <code>PostMessage</code> and | 18 /// shared with JavaScript using the <code>PostMessage</code> and |
| 19 /// <code>HandleMessage</code> functions of <code>Instance</code>. | 19 /// <code>HandleMessage</code> functions of <code>Instance</code>. |
| 20 class VarArrayBuffer : public Var { | 20 class VarArrayBuffer : public Var { |
| 21 public: | 21 public: |
| 22 /// Contruct a <code>VarArrayBuffer</code> given a var for which | 22 /// Construct a <code>VarArrayBuffer</code> given a var for which |
| 23 /// is_array_buffer() is true. This will refer to the same | 23 /// is_array_buffer() is true. This will refer to the same |
| 24 /// <code>ArrayBuffer</code> as var, but allows you to access methods | 24 /// <code>ArrayBuffer</code> as var, but allows you to access methods |
| 25 /// specific to <code>VarArrayBuffer</code>. | 25 /// specific to <code>VarArrayBuffer</code>. |
| 26 /// | 26 /// |
| 27 /// @param[in] var An <code>ArrayBuffer</code> var. | 27 /// @param[in] var An <code>ArrayBuffer</code> var. |
| 28 explicit VarArrayBuffer(const Var& var); | 28 explicit VarArrayBuffer(const Var& var); |
| 29 | 29 |
| 30 /// Construct a new <code>VarArrayBuffer_Dev</code> which is | 30 /// Construct a new <code>VarArrayBuffer_Dev</code> which is |
| 31 /// <code>size_in_bytes</code> bytes long and initialized to zero. | 31 /// <code>size_in_bytes</code> bytes long and initialized to zero. |
| 32 /// | 32 /// |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 /// Unmap() unmaps this <code>ArrayBuffer</code> var from the module address | 89 /// Unmap() unmaps this <code>ArrayBuffer</code> var from the module address |
| 90 /// space. Use this if you want to save memory but might want to call Map() | 90 /// space. Use this if you want to save memory but might want to call Map() |
| 91 /// to map the buffer again later. | 91 /// to map the buffer again later. |
| 92 void Unmap(); | 92 void Unmap(); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace pp | 95 } // namespace pp |
| 96 | 96 |
| 97 #endif // PPAPI_CPP_VAR_ARRAY_BUFFER_H_ | 97 #endif // PPAPI_CPP_VAR_ARRAY_BUFFER_H_ |
| OLD | NEW |