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

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

Issue 1412433004: bindings: Generation of dictionary IDLs with RuntimeEnabled attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 {% from 'conversions.cpp' import declare_enum_validation_variable %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable %}
2 {% include 'copyright_block.txt' %} 2 {% include 'copyright_block.txt' %}
3 #include "config.h" 3 #include "config.h"
4 #include "{{v8_original_class}}.h" 4 #include "{{v8_original_class}}.h"
5 5
6 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} 6 {% for filename in cpp_includes if filename != '%s.h' % v8_class %}
7 #include "{{filename}}" 7 #include "{{filename}}"
8 {% endfor %} 8 {% endfor %}
9 9
10 namespace blink { 10 namespace blink {
(...skipping 22 matching lines...) Expand all
33 {# Declare local variables only when the dictionary has members to avoid unu sed variable warnings. #} 33 {# Declare local variables only when the dictionary has members to avoid unu sed variable warnings. #}
34 {% if members %} 34 {% if members %}
35 v8::TryCatch block; 35 v8::TryCatch block;
36 v8::Local<v8::Object> v8Object; 36 v8::Local<v8::Object> v8Object;
37 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block )) { 37 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block )) {
38 exceptionState.rethrowV8Exception(block.Exception()); 38 exceptionState.rethrowV8Exception(block.Exception());
39 return; 39 return;
40 } 40 }
41 {% endif %} 41 {% endif %}
42 {% for member in members %} 42 {% for member in members %}
43 {% if member.runtime_enabled_function %}
44 if ({{member.runtime_enabled_function}}()) {
45 {% else %}
43 { 46 {
47 {% endif %}
44 v8::Local<v8::Value> {{member.name}}Value; 48 v8::Local<v8::Value> {{member.name}}Value;
45 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{me mber.name}}")).ToLocal(&{{member.name}}Value)) { 49 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{me mber.name}}")).ToLocal(&{{member.name}}Value)) {
46 exceptionState.rethrowV8Exception(block.Exception()); 50 exceptionState.rethrowV8Exception(block.Exception());
47 return; 51 return;
48 } 52 }
49 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined( )) { 53 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined( )) {
50 {% if member.is_required %} 54 {% if member.is_required %}
51 exceptionState.throwTypeError("required member {{member.name}} is un defined."); 55 exceptionState.throwTypeError("required member {{member.name}} is un defined.");
52 return; 56 return;
53 {% else %} 57 {% else %}
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 125 }
122 126
123 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate , v8::Local<v8::Value> value, ExceptionState& exceptionState) 127 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate , v8::Local<v8::Value> value, ExceptionState& exceptionState)
124 { 128 {
125 {{cpp_class}} impl; 129 {{cpp_class}} impl;
126 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); 130 {{v8_class}}::toImpl(isolate, value, impl, exceptionState);
127 return impl; 131 return impl;
128 } 132 }
129 133
130 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698