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

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

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: Rebased patch using NativeValueTraits for IDL types Created 3 years, 9 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 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %} 1 {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %}
2 {% filter format_blink_cpp_source_code %} 2 {% filter format_blink_cpp_source_code %}
3 3
4 {% include 'copyright_block.txt' %} 4 {% include 'copyright_block.txt' %}
5 5
6 #include "{{cpp_class}}.h" 6 #include "{{cpp_class}}.h"
7 7
8 {% for filename in cpp_includes %} 8 {% for filename in cpp_includes %}
9 #include "{{filename}}" 9 #include "{{filename}}"
10 {% endfor %} 10 {% endfor %}
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()) , m_scriptState->getExecutionContext(), thisValue, {{arguments | length}}, argv, m_scriptState->isolate()).ToLocal(&v8ReturnValue)) { 67 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()) , m_scriptState->getExecutionContext(), thisValue, {{arguments | length}}, argv, m_scriptState->isolate()).ToLocal(&v8ReturnValue)) {
68 {% if return_value %} 68 {% if return_value %}
69 {{v8_value_to_local_cpp_value(return_value) | indent(8)}} 69 {{v8_value_to_local_cpp_value(return_value) | indent(8)}}
70 returnValue = cppValue; 70 returnValue = cppValue;
71 {% endif %} 71 {% endif %}
72 return true; 72 return true;
73 } 73 }
74 return false; 74 return false;
75 } 75 }
76 76
77 {{cpp_class}}* NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolat e, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
78 return {{cpp_class}}::create(ScriptState::current(isolate), value);
79 }
80
77 } // namespace blink 81 } // namespace blink
78 82
79 {% endfilter %}{# format_blink_cpp_source_code #} 83 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698