Chromium Code Reviews| Index: Source/bindings/core/v8/V8Binding.h |
| diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h |
| index 9b05e4ca967b20b615f6315fa177d29cbc069429..a10c6ea271e8f10fc24e9abc54c8de406089e5b2 100644 |
| --- a/Source/bindings/core/v8/V8Binding.h |
| +++ b/Source/bindings/core/v8/V8Binding.h |
| @@ -237,6 +237,9 @@ struct V8ValueTraits { |
| } |
| }; |
| +template<typename T, size_t inlineCapacity> |
| +v8::Handle<v8::Value> v8ArrayNoInline(const Vector<T, inlineCapacity>& iterator, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
|
gavinp
2014/07/20 04:15:18
These two forward declarations are required to mak
|
| + |
| template <typename T, size_t inlineCapacity, typename Allocator> |
| struct V8ValueTraits<WTF::Vector<T, inlineCapacity, Allocator> > { |
| static v8::Handle<v8::Value> toV8Value(const Vector<T, inlineCapacity, Allocator>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| @@ -245,6 +248,9 @@ struct V8ValueTraits<WTF::Vector<T, inlineCapacity, Allocator> > { |
| } |
| }; |
| +template<typename T, size_t inlineCapacity> |
| +v8::Handle<v8::Value> v8ArrayNoInline(const HeapVector<T, inlineCapacity>& iterator, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| + |
| template <typename T, size_t inlineCapacity> |
| struct V8ValueTraits<HeapVector<T, inlineCapacity> > { |
| static v8::Handle<v8::Value> toV8Value(const HeapVector<T, inlineCapacity>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| @@ -253,6 +259,8 @@ struct V8ValueTraits<HeapVector<T, inlineCapacity> > { |
| } |
| }; |
| +// These explicit specializations allow basic data types to be converted via V8ValueTraits<>::toV8Value(). Where sensible, each data type |
| +// should also have an explicit specialization of toV8NoInline<>() in V8Binding.cpp, so that vectors of the same type can also be converted. |
|
haraken
2014/07/20 04:50:46
Just help me understand: Why do we need to have ex
gavinp
2014/07/20 05:11:16
I do not know; I am very new in this coding area.
haraken
2014/07/20 05:16:35
I think we can ask yhirano@ or tasak@ :) The toV8
|
| template<> |
| struct V8ValueTraits<String> { |
| static inline v8::Handle<v8::Value> toV8Value(const String& value, v8::Handle<v8::Object>, v8::Isolate* isolate) |