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

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

Issue 2183623004: Add IDLDictionaryBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix multi-level inheritance bug Created 4 years, 5 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/templates/dictionary_v8.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
index 1d13190eb01f7d8120fb1546fa0c1c7b0a12b0ad..8211b90fbe1998f09a64ae29d25961a81d65bcf0 100644
--- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
+++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
@@ -88,20 +88,21 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
{% endfor %}
}
-v8::Local<v8::Value> toV8(const {{cpp_class}}& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Local<v8::Value> {{cpp_class}}::toV8Impl(v8::Local<v8::Object> creationContext, v8::Isolate* isolate) const
{
v8::Local<v8::Object> v8Object = v8::Object::New(isolate);
- {% if parent_v8_class %}
- if (!toV8{{parent_cpp_class}}(impl, v8Object, creationContext, isolate))
- return v8::Local<v8::Value>();
- {% endif %}
- if (!toV8{{cpp_class}}(impl, v8Object, creationContext, isolate))
+ if (!toV8{{cpp_class}}(*this, v8Object, creationContext, isolate))
return v8::Local<v8::Value>();
return v8Object;
}
bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{
+ {% if parent_v8_class %}
+ if (!toV8{{parent_cpp_class}}(impl, dictionary, creationContext, isolate))
+ return false;
+
+ {% endif %}
{% for member in members %}
if (impl.{{member.has_method_name}}()) {
{% if member.is_object %}

Powered by Google App Engine
This is Rietveld 408576698