| 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 %} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); | 39 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); |
| 40 v8::TryCatch block; | 40 v8::TryCatch block; |
| 41 {% endif %} | 41 {% endif %} |
| 42 {% for member in members %} | 42 {% for member in members %} |
| 43 v8::Local<v8::Value> {{member.name}}Value = v8Object->Get(v8String(isolate,
"{{member.name}}")); | 43 v8::Local<v8::Value> {{member.name}}Value = v8Object->Get(v8String(isolate,
"{{member.name}}")); |
| 44 if (block.HasCaught()) { | 44 if (block.HasCaught()) { |
| 45 exceptionState.rethrowV8Exception(block.Exception()); | 45 exceptionState.rethrowV8Exception(block.Exception()); |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { | 48 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { |
| 49 {% if member.is_required %} |
| 50 exceptionState.throwTypeError("required member {{member.name}} is undefi
ned."); |
| 51 return; |
| 52 {% else %} |
| 49 // Do nothing. | 53 // Do nothing. |
| 54 {% endif %} |
| 50 {% if member.is_nullable %} | 55 {% if member.is_nullable %} |
| 51 } else if ({{member.name}}Value->IsNull()) { | 56 } else if ({{member.name}}Value->IsNull()) { |
| 52 impl.{{member.null_setter_name}}(); | 57 impl.{{member.null_setter_name}}(); |
| 53 {% endif %} | 58 {% endif %} |
| 54 } else { | 59 } else { |
| 55 {% if member.deprecate_as %} | 60 {% if member.deprecate_as %} |
| 56 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution
Context(isolate), UseCounter::{{member.deprecate_as}}); | 61 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution
Context(isolate), UseCounter::{{member.deprecate_as}}); |
| 57 {% endif %} | 62 {% endif %} |
| 58 {{v8_value_to_local_cpp_value(member) | indent(8)}} | 63 {{v8_value_to_local_cpp_value(member) | indent(8)}} |
| 59 {% if member.is_interface_type %} | 64 {% if member.is_interface_type %} |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 113 } |
| 109 | 114 |
| 110 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 115 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
| 111 { | 116 { |
| 112 {{cpp_class}} impl; | 117 {{cpp_class}} impl; |
| 113 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); | 118 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); |
| 114 return impl; | 119 return impl; |
| 115 } | 120 } |
| 116 | 121 |
| 117 } // namespace blink | 122 } // namespace blink |
| OLD | NEW |