| 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_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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // ArrayBufferVar* array = ArrayBufferVar::FromPPVar(var); | 133 // ArrayBufferVar* array = ArrayBufferVar::FromPPVar(var); |
| 134 // if (!array) | 134 // if (!array) |
| 135 // return false; // Not an ArrayBuffer or an invalid var. | 135 // return false; // Not an ArrayBuffer or an invalid var. |
| 136 // DoSomethingWithTheBuffer(array); | 136 // DoSomethingWithTheBuffer(array); |
| 137 class PPAPI_SHARED_EXPORT ArrayBufferVar : public Var { | 137 class PPAPI_SHARED_EXPORT ArrayBufferVar : public Var { |
| 138 public: | 138 public: |
| 139 ArrayBufferVar(); | 139 ArrayBufferVar(); |
| 140 virtual ~ArrayBufferVar(); | 140 virtual ~ArrayBufferVar(); |
| 141 | 141 |
| 142 virtual void* Map() = 0; | 142 virtual void* Map() = 0; |
| 143 virtual void Unmap() = 0; |
| 143 virtual uint32 ByteLength() = 0; | 144 virtual uint32 ByteLength() = 0; |
| 144 | 145 |
| 145 // Var override. | 146 // Var override. |
| 146 virtual ArrayBufferVar* AsArrayBufferVar() OVERRIDE; | 147 virtual ArrayBufferVar* AsArrayBufferVar() OVERRIDE; |
| 147 virtual PP_VarType GetType() const OVERRIDE; | 148 virtual PP_VarType GetType() const OVERRIDE; |
| 148 | 149 |
| 149 // Helper function that converts a PP_Var to an ArrayBufferVar. This will | 150 // Helper function that converts a PP_Var to an ArrayBufferVar. This will |
| 150 // return NULL if the PP_Var is not of ArrayBuffer type. | 151 // return NULL if the PP_Var is not of ArrayBuffer type. |
| 151 static ArrayBufferVar* FromPPVar(PP_Var var); | 152 static ArrayBufferVar* FromPPVar(PP_Var var); |
| 152 | 153 |
| 153 private: | 154 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); | 155 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 } // namespace ppapi | 158 } // namespace ppapi |
| 158 | 159 |
| 159 #endif // PPAPI_SHARED_IMPL_VAR_H_ | 160 #endif // PPAPI_SHARED_IMPL_VAR_H_ |
| OLD | NEW |