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

Side by Side Diff: Source/bindings/templates/dictionary_v8.cpp

Issue 420763002: IDL: DOM impl class code generation for IDL dictionaries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "{{v8_class}}.h" 8 #include "{{v8_class}}.h"
9 9
10 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} 10 {% for filename in cpp_includes if filename != '%s.h' % v8_class %}
(...skipping 17 matching lines...) Expand all
28 impl->{{member.setter_name}}({{member.cpp_default_value}}); 28 impl->{{member.setter_name}}({{member.cpp_default_value}});
29 {% endif %} 29 {% endif %}
30 {% endfor %} 30 {% endfor %}
31 return impl; 31 return impl;
32 } 32 }
33 33
34 v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate) 34 v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate)
35 { 35 {
36 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); 36 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate);
37 {% for member in members %} 37 {% for member in members %}
38 if (impl->{{member.has_name}}()) 38 if (impl->{{member.has_method_name}}())
39 v8Object->Set(v8String(isolate, "{{member.name}}"), {{member.cpp_value_t o_v8_value}}); 39 v8Object->Set(v8String(isolate, "{{member.name}}"), {{member.cpp_value_t o_v8_value}});
40 {% if member.v8_default_value %} 40 {% if member.v8_default_value %}
41 else 41 else
42 v8Object->Set(v8String(isolate, "{{member.name}}"), {{member.v8_default_ value}}); 42 v8Object->Set(v8String(isolate, "{{member.name}}"), {{member.v8_default_ value}});
43 {% endif %} 43 {% endif %}
44 {% endfor %} 44 {% endfor %}
45 return v8Object; 45 return v8Object;
46 } 46 }
47 47
48 } // namespace blink 48 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698