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

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

Issue 2725673002: WIP bindings: Expand usage of NativeValueTraits. (Closed)
Patch Set: Created 3 years, 10 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..4cc67b2ff436060e9e2edb7141d74f438d08b7b7 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -975,6 +975,7 @@ struct NativeValueTraits<v8::Local<v8::Value>> {
template <>
struct NativeValueTraits<ScriptValue> {
+ using ImplType = ScriptValue;
static inline ScriptValue nativeValue(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exceptionState) {
@@ -982,6 +983,17 @@ struct NativeValueTraits<ScriptValue> {
}
};
+class Promise;
+template <>
+struct NativeValueTraits<Promise> {
+ using ImplType = ScriptPromise;
+ static inline ScriptPromise nativeValue(v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exceptionState) {
+ return ScriptPromise::cast(ScriptState::current(isolate), value);
+ }
+};
+
template <typename T>
struct NativeValueTraits<Vector<T>> {
static inline Vector<T> nativeValue(v8::Isolate* isolate,

Powered by Google App Engine
This is Rietveld 408576698