Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.h

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Move specialization for SerializedScriptValue to the appropriate header Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8Binding.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index 1df7fae7726c68025efbae99fb7607a1ef7a794a..f8bd5f59830dc6170efbc3daaa422750b91e4f1a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -761,12 +761,12 @@ HeapVector<Member<T>> toMemberNativeArray(v8::Local<v8::Value> value,
// Converts a JavaScript value to an array as per the Web IDL specification:
// http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-array
-template <typename VectorType>
+template <typename VectorType,
+ typename ValueType = typename VectorType::ValueType>
VectorType toImplArray(v8::Local<v8::Value> value,
int argumentIndex,
v8::Isolate* isolate,
ExceptionState& exceptionState) {
- typedef typename VectorType::ValueType ValueType;
typedef NativeValueTraits<ValueType> TraitsType;
uint32_t length = 0;
@@ -903,6 +903,10 @@ inline bool toV8Sequence(v8::Local<v8::Value> value,
return true;
}
+// TODO(rakuco): remove the specializations below (and consequently the
+// non-IDLBase version of NativeValueTraitsBase) once we manage to convert all
+// uses of NativeValueTraits to types that derive from IDLBase or for generated
+// IDL interfaces/dictionaries/unions.
template <>
struct NativeValueTraits<String> {
static inline String nativeValue(v8::Isolate* isolate,

Powered by Google App Engine
This is Rietveld 408576698