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 "V8TestInterfaceEventInit.h" | 12 #include "V8TestInterfaceEventInit.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/V8EventInit.h" | 17 #include "bindings/core/v8/V8EventInit.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, TestInterfaceEventInit& impl, ExceptionState& exceptionState) { | 21 void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, TestInterfaceEventInit& impl, ExceptionState& exceptionState) { |
22 if (isUndefinedOrNull(v8Value)) { | 22 if (isUndefinedOrNull(v8Value)) { |
23 return; | 23 return; |
24 } | 24 } |
25 if (!v8Value->IsObject()) { | 25 if (!v8Value->IsObject()) { |
26 exceptionState.throwTypeError("cannot convert to dictionary."); | 26 exceptionState.throwTypeError("cannot convert to dictionary."); |
27 return; | 27 return; |
28 } | 28 } |
| 29 v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>(); |
| 30 (void)v8Object; |
29 | 31 |
30 V8EventInit::toImpl(isolate, v8Value, impl, exceptionState); | 32 V8EventInit::toImpl(isolate, v8Value, impl, exceptionState); |
31 if (exceptionState.hadException()) | 33 if (exceptionState.hadException()) |
32 return; | 34 return; |
33 | 35 |
34 v8::TryCatch block(isolate); | 36 v8::TryCatch block(isolate); |
35 v8::Local<v8::Object> v8Object; | |
36 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block))
{ | |
37 exceptionState.rethrowV8Exception(block.Exception()); | |
38 return; | |
39 } | |
40 v8::Local<v8::Value> stringMemberValue; | 37 v8::Local<v8::Value> stringMemberValue; |
41 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "stri
ngMember")).ToLocal(&stringMemberValue)) { | 38 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "stri
ngMember")).ToLocal(&stringMemberValue)) { |
42 exceptionState.rethrowV8Exception(block.Exception()); | 39 exceptionState.rethrowV8Exception(block.Exception()); |
43 return; | 40 return; |
44 } | 41 } |
45 if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { | 42 if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { |
46 // Do nothing. | 43 // Do nothing. |
47 } else { | 44 } else { |
48 V8StringResource<> stringMember = stringMemberValue; | 45 V8StringResource<> stringMember = stringMemberValue; |
49 if (!stringMember.prepare(exceptionState)) | 46 if (!stringMember.prepare(exceptionState)) |
(...skipping 21 matching lines...) Expand all Loading... |
71 return true; | 68 return true; |
72 } | 69 } |
73 | 70 |
74 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(v8
::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState)
{ | 71 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(v8
::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState)
{ |
75 TestInterfaceEventInit impl; | 72 TestInterfaceEventInit impl; |
76 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState); | 73 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState); |
77 return impl; | 74 return impl; |
78 } | 75 } |
79 | 76 |
80 } // namespace blink | 77 } // namespace blink |
OLD | NEW |