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_v8.py. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl |
10 | 10 |
11 // clang-format off | 11 // clang-format off |
12 #include "V8TestDictionaryDerived.h" | 12 #include "V8TestDictionaryDerived.h" |
13 | 13 |
14 #include "bindings/core/v8/ExceptionState.h" | 14 #include "bindings/core/v8/ExceptionState.h" |
15 #include "bindings/core/v8/IDLTypes.h" | 15 #include "bindings/core/v8/IDLTypes.h" |
16 #include "bindings/core/v8/NativeValueTraitsImpl.h" | 16 #include "bindings/core/v8/NativeValueTraitsImpl.h" |
17 #include "bindings/core/v8/V8TestDictionary.h" | 17 #include "bindings/core/v8/V8TestDictionary.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
l<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) { | 21 void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
l<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) { |
22 if (isUndefinedOrNull(v8Value)) { | 22 if (isUndefinedOrNull(v8Value)) { |
23 exceptionState.throwTypeError("Missing required member(s): requiredLongMembe
r."); | 23 exceptionState.throwTypeError("Missing required member(s): requiredLongMembe
r."); |
24 return; | 24 return; |
25 } | 25 } |
26 if (!v8Value->IsObject()) { | 26 if (!v8Value->IsObject()) { |
27 exceptionState.throwTypeError("cannot convert to dictionary."); | 27 exceptionState.throwTypeError("cannot convert to dictionary."); |
28 return; | 28 return; |
29 } | 29 } |
| 30 v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>(); |
| 31 (void)v8Object; |
30 | 32 |
31 V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState); | 33 V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState); |
32 if (exceptionState.hadException()) | 34 if (exceptionState.hadException()) |
33 return; | 35 return; |
34 | 36 |
35 v8::TryCatch block(isolate); | 37 v8::TryCatch block(isolate); |
36 v8::Local<v8::Object> v8Object; | |
37 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block))
{ | |
38 exceptionState.rethrowV8Exception(block.Exception()); | |
39 return; | |
40 } | |
41 v8::Local<v8::Value> derivedStringMemberValue; | 38 v8::Local<v8::Value> derivedStringMemberValue; |
42 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "deri
vedStringMember")).ToLocal(&derivedStringMemberValue)) { | 39 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "deri
vedStringMember")).ToLocal(&derivedStringMemberValue)) { |
43 exceptionState.rethrowV8Exception(block.Exception()); | 40 exceptionState.rethrowV8Exception(block.Exception()); |
44 return; | 41 return; |
45 } | 42 } |
46 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefine
d()) { | 43 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefine
d()) { |
47 // Do nothing. | 44 // Do nothing. |
48 } else { | 45 } else { |
49 V8StringResource<> derivedStringMember = derivedStringMemberValue; | 46 V8StringResource<> derivedStringMember = derivedStringMemberValue; |
50 if (!derivedStringMember.prepare(exceptionState)) | 47 if (!derivedStringMember.prepare(exceptionState)) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return true; | 132 return true; |
136 } | 133 } |
137 | 134 |
138 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) { | 135 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) { |
139 TestDictionaryDerivedImplementedAs impl; | 136 TestDictionaryDerivedImplementedAs impl; |
140 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exceptionSt
ate); | 137 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exceptionSt
ate); |
141 return impl; | 138 return impl; |
142 } | 139 } |
143 | 140 |
144 } // namespace blink | 141 } // namespace blink |
OLD | NEW |