Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 bool 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 true;
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 false;
22 } 22 }
23 23
24 V8EventInitDictionary::toImpl(isolate, v8Value, impl, exceptionState); 24 if (!V8EventInitDictionary::toImpl(isolate, v8Value, impl, exceptionState))
25 if (exceptionState.hadException()) 25 return false;
26 return;
27 26
28 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); 27 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
29 v8::TryCatch block; 28 v8::TryCatch block;
30 v8::Local<v8::Value> stringMemberValue = v8Object->Get(v8String(isolate, "st ringMember")); 29 v8::Local<v8::Value> stringMemberValue = v8Object->Get(v8String(isolate, "st ringMember"));
31 if (block.HasCaught()) { 30 if (block.HasCaught()) {
32 exceptionState.rethrowV8Exception(block.Exception()); 31 exceptionState.rethrowV8Exception(block.Exception());
33 return; 32 return false;
34 } 33 }
35 if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { 34 if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) {
36 // Do nothing. 35 // Do nothing.
37 } else { 36 } else {
38 TOSTRING_VOID(V8StringResource<>, stringMember, stringMemberValue); 37 TONATIVE_DECLARE(V8StringResource<>, stringMember, (stringMember = strin gMemberValue).prepare(exceptionState), return false);
39 impl.setStringMember(stringMember); 38 impl.setStringMember(stringMember);
40 } 39 }
41 40
41 return true;
42 } 42 }
43 43
44 v8::Local<v8::Value> toV8(const TestInterfaceEventInit& impl, v8::Local<v8::Obje ct> creationContext, v8::Isolate* isolate) 44 v8::Local<v8::Value> toV8(const TestInterfaceEventInit& impl, v8::Local<v8::Obje ct> creationContext, v8::Isolate* isolate)
45 { 45 {
46 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); 46 v8::Local<v8::Object> v8Object = v8::Object::New(isolate);
47 toV8EventInitDictionary(impl, v8Object, creationContext, isolate); 47 toV8EventInitDictionary(impl, v8Object, creationContext, isolate);
48 toV8TestInterfaceEventInit(impl, v8Object, creationContext, isolate); 48 toV8TestInterfaceEventInit(impl, v8Object, creationContext, isolate);
49 return v8Object; 49 return v8Object;
50 } 50 }
51 51
52 void toV8TestInterfaceEventInit(const TestInterfaceEventInit& impl, v8::Local<v8 ::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolat e) 52 void toV8TestInterfaceEventInit(const TestInterfaceEventInit& impl, v8::Local<v8 ::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolat e)
53 { 53 {
54 if (impl.hasStringMember()) { 54 if (impl.hasStringMember()) {
55 dictionary->Set(v8String(isolate, "stringMember"), v8String(isolate, imp l.stringMember())); 55 dictionary->Set(v8String(isolate, "stringMember"), v8String(isolate, imp l.stringMember()));
56 } 56 }
57 57
58 } 58 }
59 59
60 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(co nst v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exception State) 60 TestInterfaceEventInit NativeValueTraits<TestInterfaceEventInit>::nativeValue(co nst v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exception State)
61 { 61 {
62 TestInterfaceEventInit impl; 62 TestInterfaceEventInit impl;
63 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState); 63 V8TestInterfaceEventInit::toImpl(isolate, value, impl, exceptionState);
64 return impl; 64 return impl;
65 } 65 }
66 66
67 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698