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

Unified Diff: Source/bindings/core/v8/ScriptValue.h

Issue 1021713003: [bindings] Let NativeValueTraits<T>::nativeValue be variadic function and merge various convers… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the compiler error behind ASSERT flag Created 5 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: Source/bindings/core/v8/ScriptValue.h
diff --git a/Source/bindings/core/v8/ScriptValue.h b/Source/bindings/core/v8/ScriptValue.h
index 4a727dd732a30cdab4624dc4af2e5e6e06244db8..08e079e129f1284b4eca5d07db359b54464de45a 100644
--- a/Source/bindings/core/v8/ScriptValue.h
+++ b/Source/bindings/core/v8/ScriptValue.h
@@ -52,10 +52,16 @@ public:
return ScriptValue(scriptState, toV8(value, scriptState->context()->Global(), scriptState->isolate()));
}
- template<typename T>
- inline T to(ExceptionState& exceptionState) const
+ template<typename T, typename... Arguments>
+ static inline T to(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState, Arguments... arguments)
+ {
+ return NativeValueTraits<T>::nativeValue(value, isolate, exceptionState, arguments...);
+ }
+
+ template<typename T, typename... Arguments>
+ static inline T to(v8::Isolate* isolate, const ScriptValue& value, ExceptionState& exceptionState, Arguments... arguments)
{
- return NativeValueTraits<T>::nativeValue(v8Value(), isolate(), exceptionState);
+ return to<T>(isolate, value.v8Value(), exceptionState, arguments...);
}
ScriptValue() { }
@@ -153,7 +159,6 @@ public:
v8::Handle<v8::Value> v8ValueUnsafe() const;
bool toString(String&) const;
- PassRefPtr<JSONValue> toJSONValue(ScriptState*) const;
static ScriptValue createNull(ScriptState*);

Powered by Google App Engine
This is Rietveld 408576698