OLD | NEW |
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_original_class}}.h" | 8 #include "{{v8_original_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 %} |
11 #include "{{filename}}" | 11 #include "{{filename}}" |
12 {% endfor %} | 12 {% endfor %} |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 {% macro convert_and_set_member(member) %} | 16 {% macro convert_and_set_member(member) %} |
17 {% endmacro %} | 17 {% endmacro %} |
18 void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {
{cpp_class}}& impl, ExceptionState& exceptionState) | 18 void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {
{cpp_class}}& impl, ExceptionState& exceptionState) |
19 { | 19 { |
20 if (isUndefinedOrNull(v8Value)) | 20 if (isUndefinedOrNull(v8Value)) |
21 return; | 21 return; |
22 if (!v8Value->IsObject()) { | 22 if (!v8Value->IsObject()) { |
| 23 {% if use_permissive_dictionary_conversion %} |
| 24 // Do nothing. |
| 25 {% else %} |
23 exceptionState.throwTypeError("cannot convert to dictionary."); | 26 exceptionState.throwTypeError("cannot convert to dictionary."); |
| 27 {% endif %} |
24 return; | 28 return; |
25 } | 29 } |
26 | 30 |
27 {% if parent_v8_class %} | 31 {% if parent_v8_class %} |
28 {{parent_v8_class}}::toImpl(isolate, v8Value, impl, exceptionState); | 32 {{parent_v8_class}}::toImpl(isolate, v8Value, impl, exceptionState); |
29 if (exceptionState.hadException()) | 33 if (exceptionState.hadException()) |
30 return; | 34 return; |
31 | 35 |
32 {% endif %} | 36 {% endif %} |
33 {# Declare local variables only when the dictionary has members to avoid unu
sed variable warnings. #} | 37 {# Declare local variables only when the dictionary has members to avoid unu
sed variable warnings. #} |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 108 } |
105 | 109 |
106 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(const v8::Handle<v8:
:Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) | 110 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(const v8::Handle<v8:
:Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) |
107 { | 111 { |
108 {{cpp_class}} impl; | 112 {{cpp_class}} impl; |
109 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); | 113 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); |
110 return impl; | 114 return impl; |
111 } | 115 } |
112 | 116 |
113 } // namespace blink | 117 } // namespace blink |
OLD | NEW |