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

Unified Diff: Source/bindings/templates/dictionary_v8.cpp

Issue 759893002: IDL: Auto-generate NativeValueTraits for IDL dictionaries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/bindings/templates/dictionary_v8.h ('k') | Source/bindings/tests/idls/core/TestDictionary.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index bbe032fc2b26e0df1cbba991d6b04118306f28f8..94a48cdf5a905696c430ecc76932f09beb4d8a7a 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -58,7 +58,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {
{% endfor %}
}
-v8::Handle<v8::Value> toV8({{cpp_class}}& impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Value> toV8(const {{cpp_class}}& impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> v8Object = v8::Object::New(isolate);
{% if parent_v8_class %}
@@ -68,7 +68,13 @@ v8::Handle<v8::Value> toV8({{cpp_class}}& impl, v8::Handle<v8::Object> creationC
return v8Object;
}
-void toV8{{cpp_class}}({{cpp_class}}& impl, v8::Handle<v8::Object> dictionary, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+template<>
+v8::Handle<v8::Value> toV8NoInline(const {{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(*impl, creationContext, isolate);
+}
+
+void toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Handle<v8::Object> dictionary, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
{% for member in members %}
if (impl.{{member.has_method_name}}()) {
@@ -85,4 +91,11 @@ void toV8{{cpp_class}}({{cpp_class}}& impl, v8::Handle<v8::Object> dictionary, v
{% endfor %}
}
+{{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
+{
+ {{cpp_class}} impl;
+ {{v8_class}}::toImpl(isolate, value, impl, exceptionState);
+ return impl;
+}
+
} // namespace blink
« no previous file with comments | « Source/bindings/templates/dictionary_v8.h ('k') | Source/bindings/tests/idls/core/TestDictionary.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698