| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 GIN_ARRAY_BUFFER_H_ | 5 #ifndef GIN_ARRAY_BUFFER_H_ |
| 6 #define GIN_ARRAY_BUFFER_H_ | 6 #define GIN_ARRAY_BUFFER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" // For scoped_refptr only! | 10 #include "base/memory/ref_counted.h" |
| 11 #include "gin/converter.h" | 11 #include "gin/converter.h" |
| 12 #include "v8/include/v8.h" | 12 #include "v8/include/v8.h" |
| 13 | 13 |
| 14 namespace gin { | 14 namespace gin { |
| 15 | 15 |
| 16 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 16 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 17 public: | 17 public: |
| 18 virtual void* Allocate(size_t length) OVERRIDE; | 18 virtual void* Allocate(size_t length) OVERRIDE; |
| 19 virtual void* AllocateUninitialized(size_t length) OVERRIDE; | 19 virtual void* AllocateUninitialized(size_t length) OVERRIDE; |
| 20 virtual void Free(void* data, size_t length) OVERRIDE; | 20 virtual void Free(void* data, size_t length) OVERRIDE; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 template<> | 70 template<> |
| 71 struct Converter<ArrayBufferView> { | 71 struct Converter<ArrayBufferView> { |
| 72 static bool FromV8(v8::Handle<v8::Value> val, | 72 static bool FromV8(v8::Handle<v8::Value> val, |
| 73 ArrayBufferView* out); | 73 ArrayBufferView* out); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace gin | 76 } // namespace gin |
| 77 | 77 |
| 78 #endif // GIN_ARRAY_BUFFER_H_ | 78 #endif // GIN_ARRAY_BUFFER_H_ |
| OLD | NEW |