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

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

Issue 587653002: IDL: Conversion to Dictionary is trivial (can't fail) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 "V8TestInterfaceConstructor2.h" 8 #include "V8TestInterfaceConstructor2.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg); 43 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg);
44 v8::Handle<v8::Object> wrapper = info.Holder(); 44 v8::Handle<v8::Object> wrapper = info.Holder();
45 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 45 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
46 v8SetReturnValue(info, wrapper); 46 v8SetReturnValue(info, wrapper);
47 } 47 }
48 48
49 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 49 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
50 { 50 {
51 Dictionary dictionaryArg; 51 Dictionary dictionaryArg;
52 { 52 {
53 v8::TryCatch block;
54 V8RethrowTryCatchScope rethrow(block);
55 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 53 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
56 V8ThrowException::throwTypeError(ExceptionMessages::failedToConstruc t("TestInterfaceConstructor2", "parameter 1 ('dictionaryArg') is not an object." ), info.GetIsolate()); 54 V8ThrowException::throwTypeError(ExceptionMessages::failedToConstruc t("TestInterfaceConstructor2", "parameter 1 ('dictionaryArg') is not an object." ), info.GetIsolate());
57 return; 55 return;
58 } 56 }
59 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolat e())); 57 dictionaryArg = Dictionary(info[0], info.GetIsolate());
60 } 58 }
61 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg); 59 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg);
62 v8::Handle<v8::Object> wrapper = info.Holder(); 60 v8::Handle<v8::Object> wrapper = info.Holder();
63 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 61 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
64 v8SetReturnValue(info, wrapper); 62 v8SetReturnValue(info, wrapper);
65 } 63 }
66 64
67 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 65 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
68 { 66 {
69 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
70 TestInterfaceEmpty* testInterfaceEmptyArg; 68 TestInterfaceEmpty* testInterfaceEmptyArg;
71 int longArg; 69 int longArg;
72 V8StringResource<> defaultUndefinedOptionalStringArg; 70 V8StringResource<> defaultUndefinedOptionalStringArg;
73 V8StringResource<> defaultNullStringOptionalStringArg; 71 V8StringResource<> defaultNullStringOptionalStringArg;
74 Dictionary defaultUndefinedOptionalDictionaryArg; 72 Dictionary defaultUndefinedOptionalDictionaryArg;
75 V8StringResource<> optionalStringArg; 73 V8StringResource<> optionalStringArg;
76 { 74 {
77 v8::TryCatch block;
78 V8RethrowTryCatchScope rethrow(block);
79 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]); 75 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]);
80 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState); 76 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState);
81 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]); 77 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]);
82 if (!info[3]->IsUndefined()) { 78 if (!info[3]->IsUndefined()) {
83 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, info[3]); 79 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, info[3]);
84 } else { 80 } else {
85 defaultNullStringOptionalStringArg = nullptr; 81 defaultNullStringOptionalStringArg = nullptr;
86 } 82 }
87 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) { 83 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) {
88 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object."); 84 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object.");
89 exceptionState.throwIfNeeded(); 85 exceptionState.throwIfNeeded();
90 return; 86 return;
91 } 87 }
92 TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary (info[4], info.GetIsolate())); 88 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol ate());
93 if (UNLIKELY(info.Length() <= 5)) { 89 if (UNLIKELY(info.Length() <= 5)) {
94 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); 90 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
95 v8::Handle<v8::Object> wrapper = info.Holder(); 91 v8::Handle<v8::Object> wrapper = info.Holder();
96 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperType Info, wrapper, info.GetIsolate()); 92 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperType Info, wrapper, info.GetIsolate());
97 v8SetReturnValue(info, wrapper); 93 v8SetReturnValue(info, wrapper);
98 return; 94 return;
99 } 95 }
100 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]); 96 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]);
101 } 97 }
102 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg); 98 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return 0; 228 return 0;
233 } 229 }
234 230
235 template<> 231 template<>
236 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 232 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
237 { 233 {
238 return toV8(impl, creationContext, isolate); 234 return toV8(impl, creationContext, isolate);
239 } 235 }
240 236
241 } // namespace blink 237 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698