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. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "V8TestInterfaceEventInit.h" | 8 #include "V8TestInterfaceEventInit.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
11 #include "bindings/core/v8/V8EventInit.h" | 11 #include "bindings/core/v8/V8EventInit.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, TestInterfaceEventInit& impl, ExceptionState& exceptionState) | 15 void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, TestInterfaceEventInit& impl, ExceptionState& exceptionState) |
16 { | 16 { |
17 if (isUndefinedOrNull(v8Value)) | 17 if (isUndefinedOrNull(v8Value)) |
18 return; | 18 return; |
19 if (!v8Value->IsObject()) { | 19 if (!v8Value->IsObject()) { |
20 exceptionState.throwTypeError("cannot convert to dictionary."); | 20 exceptionState.throwTypeError("cannot convert to dictionary."); |
21 return; | 21 return; |
22 } | 22 } |
23 | 23 |
24 V8EventInitDictionary::toImpl(isolate, v8Value, impl, exceptionState); | 24 V8EventInit::toImpl(isolate, v8Value, impl, exceptionState); |
25 if (exceptionState.hadException()) | 25 if (exceptionState.hadException()) |
26 return; | 26 return; |
27 | 27 |
28 v8::TryCatch block; | 28 v8::TryCatch block; |
29 v8::Local<v8::Object> v8Object; | 29 v8::Local<v8::Object> v8Object; |
30 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block
)) { | 30 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block
)) { |
31 exceptionState.rethrowV8Exception(block.Exception()); | 31 exceptionState.rethrowV8Exception(block.Exception()); |
32 return; | 32 return; |
33 } | 33 } |
34 { | 34 { |
(...skipping 10 matching lines...) Expand all Loading... |
45 return; | 45 return; |
46 impl.setStringMember(stringMember); | 46 impl.setStringMember(stringMember); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 } | 50 } |
51 | 51 |
52 v8::Local<v8::Value> toV8(const TestInterfaceEventInit& impl, v8::Local<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 52 v8::Local<v8::Value> toV8(const TestInterfaceEventInit& impl, v8::Local<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
53 { | 53 { |
54 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); | 54 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
55 if (!toV8EventInitDictionary(impl, v8Object, creationContext, isolate)) | 55 if (!toV8EventInit(impl, v8Object, creationContext, isolate)) |
56 return v8::Local<v8::Value>(); | 56 return v8::Local<v8::Value>(); |
57 if (!toV8TestInterfaceEventInit(impl, v8Object, creationContext, isolate)) | 57 if (!toV8TestInterfaceEventInit(impl, v8Object, creationContext, isolate)) |
58 return v8::Local<v8::Value>(); | 58 return v8::Local<v8::Value>(); |
59 return v8Object; | 59 return v8Object; |
60 } | 60 } |
61 | 61 |
62 bool toV8TestInterfaceEventInit(const TestInterfaceEventInit& impl, v8::Local<v8
::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolat
e) | 62 bool toV8TestInterfaceEventInit(const TestInterfaceEventInit& impl, v8::Local<v8
::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolat
e) |
63 { | 63 { |
64 // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720 | 64 // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720 |
65 if (impl.hasStringMember()) { | 65 if (impl.hasStringMember()) { |
66 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "stringMember"), v8String(isolate, impl.stringMember())))) | 66 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "stringMember"), v8String(isolate, impl.stringMember())))) |
67 return false; | 67 return false; |
68 } | 68 } |
69 | 69 |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(v8
::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 73 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(v8
::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
74 { | 74 { |
75 TestInterfaceEventInit impl; | 75 TestInterfaceEventInit impl; |
76 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState); | 76 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState); |
77 return impl; | 77 return impl; |
78 } | 78 } |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
OLD | NEW |