| 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 "{{header_filename}}" | 8 #include "{{header_filename}}" |
| 9 | 9 |
| 10 {% macro assign_and_return_if_hasinstance(member) %} | 10 {% macro assign_and_return_if_hasinstance(member) %} |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void {{container.cpp_class}}::trace(Visitor* visitor) | 45 void {{container.cpp_class}}::trace(Visitor* visitor) |
| 46 { | 46 { |
| 47 {% for member in container.members if member.is_traceable %} | 47 {% for member in container.members if member.is_traceable %} |
| 48 visitor->trace(m_{{member.cpp_name}}); | 48 visitor->trace(m_{{member.cpp_name}}); |
| 49 {% endfor %} | 49 {% endfor %} |
| 50 } | 50 } |
| 51 | 51 |
| 52 {% endif %} | 52 {% endif %} |
| 53 void V8{{container.cpp_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Valu
e> v8Value, {{container.cpp_class}}& impl, ExceptionState& exceptionState) | 53 void V8{{container.cpp_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Valu
e> v8Value, {{container.cpp_class}}& impl, ExceptionState& exceptionState) |
| 54 { | 54 { |
| 55 {# FIXME: We don't follow the spec on handling null and undefined at this | |
| 56 moment. Should be fixed once we implement all necessary conversion steps | |
| 57 below. #} | |
| 58 if (v8Value.IsEmpty()) | 55 if (v8Value.IsEmpty()) |
| 59 return; | 56 return; |
| 60 | 57 |
| 61 {# The numbers in the following comments refer to the steps described in | 58 {# The numbers in the following comments refer to the steps described in |
| 62 http://heycam.github.io/webidl/#es-union | 59 http://heycam.github.io/webidl/#es-union |
| 60 NOTE: Step 1 (null or undefined) is handled in *OrNull::toImpl() |
| 63 FIXME: Implement all necessary steps #} | 61 FIXME: Implement all necessary steps #} |
| 64 {# 3. Platform objects (interfaces) #} | 62 {# 3. Platform objects (interfaces) #} |
| 65 {% for interface in container.interface_types %} | 63 {% for interface in container.interface_types %} |
| 66 {{assign_and_return_if_hasinstance(interface) | indent}} | 64 {{assign_and_return_if_hasinstance(interface) | indent}} |
| 67 | 65 |
| 68 {% endfor %} | 66 {% endfor %} |
| 69 {# 8. ArrayBuffer #} | 67 {# 8. ArrayBuffer #} |
| 70 {% if container.array_buffer_type %} | 68 {% if container.array_buffer_type %} |
| 71 {{assign_and_return_if_hasinstance(container.array_buffer_type) | indent}} | 69 {{assign_and_return_if_hasinstance(container.array_buffer_type) | indent}} |
| 72 | 70 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (impl.is{{member.type_name}}()) | 144 if (impl.is{{member.type_name}}()) |
| 147 return {{member.cpp_value_to_v8_value}}; | 145 return {{member.cpp_value_to_v8_value}}; |
| 148 | 146 |
| 149 {% endfor %} | 147 {% endfor %} |
| 150 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
| 151 return v8::Handle<v8::Value>(); | 149 return v8::Handle<v8::Value>(); |
| 152 } | 150 } |
| 153 | 151 |
| 154 {% endfor %} | 152 {% endfor %} |
| 155 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |