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

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

Issue 1167343002: Add methods for creating V8 extras-based ReadableStreams from C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Trying blindly to resolve circular dependency Created 4 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptValue.h ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ToV8.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
index e211d9ca61313f245fe71486a6d4c3e545c1fbec..926cec829001fa6ff945b1f82e45d51ed08396b7 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -262,6 +262,13 @@ inline v8::Local<v8::Value> toV8(T&& value, ScriptState* scriptState)
// This hack helps detect such unwanted implicit conversions from T* to bool.
v8::Local<v8::Value> toV8(void* value, v8::Local<v8::Object> creationContext, v8::Isolate*) = delete;
+// Cannot define in ScriptValue because of the circular dependency between toV8 and ScriptValue
+template<typename T>
+inline ScriptValue ScriptValue::from(ScriptState* scriptState, T&& value)
+{
+ return ScriptValue(scriptState, toV8(std::forward<T>(value), scriptState));
+}
+
} // namespace blink
#endif // ToV8_h
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptValue.h ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698