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

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

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)
Patch Set: Addressed review comments (rename, empty line). Created 4 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 "V8TestInterfaceConstructor2.h" 7 #include "V8TestInterfaceConstructor2.h"
8 8
9 #include "bindings/core/v8/Dictionary.h" 9 #include "bindings/core/v8/Dictionary.h"
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 decltype(&ScriptWrappable::hasPendingActivity)>::value, 46 decltype(&ScriptWrappable::hasPendingActivity)>::value,
47 "TestInterfaceConstructor2 is overriding hasPendingActivity(), but is not sp ecifying " 47 "TestInterfaceConstructor2 is overriding hasPendingActivity(), but is not sp ecifying "
48 "[ActiveScriptWrappable] extended attribute in the IDL file. " 48 "[ActiveScriptWrappable] extended attribute in the IDL file. "
49 "Be consistent."); 49 "Be consistent.");
50 50
51 namespace TestInterfaceConstructor2V8Internal { 51 namespace TestInterfaceConstructor2V8Internal {
52 52
53 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 53 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
54 { 54 {
55 V8StringResource<> stringArg; 55 V8StringResource<> stringArg;
56 { 56 stringArg = info[0];
57 stringArg = info[0]; 57 if (!stringArg.prepare())
58 if (!stringArg.prepare()) 58 return;
59 return; 59
60 }
61 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringAr g); 60 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringAr g);
62 v8::Local<v8::Object> wrapper = info.Holder(); 61 v8::Local<v8::Object> wrapper = info.Holder();
63 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 62 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
64 v8SetReturnValue(info, wrapper); 63 v8SetReturnValue(info, wrapper);
65 } 64 }
66 65
67 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 66 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
68 { 67 {
69 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 68 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio nContext, "TestInterfaceConstructor2");
69
70 Dictionary dictionaryArg; 70 Dictionary dictionaryArg;
71 { 71 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
72 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 72 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not an o bject.");
73 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not an object."); 73
74 return; 74 return;
75 }
76 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState);
77 if (exceptionState.hadException())
78 return;
79 } 75 }
76 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState);
77 if (exceptionState.hadException())
78 return;
79
80 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(dictiona ryArg); 80 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(dictiona ryArg);
81 v8::Local<v8::Object> wrapper = info.Holder(); 81 v8::Local<v8::Object> wrapper = info.Holder();
82 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 82 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
83 v8SetReturnValue(info, wrapper); 83 v8SetReturnValue(info, wrapper);
84 } 84 }
85 85
86 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 86 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
87 { 87 {
88 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 88 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio nContext, "TestInterfaceConstructor2");
89
89 Vector<Vector<String>> stringSequenceSequenceArg; 90 Vector<Vector<String>> stringSequenceSequenceArg;
90 { 91 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0], 1, info.GetIsolate(), exceptionState);
91 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0], 1, info.GetIsolate(), exceptionState); 92 if (exceptionState.hadException())
92 if (exceptionState.hadException()) 93 return;
93 return; 94
94 }
95 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringSe quenceSequenceArg); 95 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringSe quenceSequenceArg);
96 v8::Local<v8::Object> wrapper = info.Holder(); 96 v8::Local<v8::Object> wrapper = info.Holder();
97 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 97 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
98 v8SetReturnValue(info, wrapper); 98 v8SetReturnValue(info, wrapper);
99 } 99 }
100 100
101 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 101 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
102 { 102 {
103 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 103 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio nContext, "TestInterfaceConstructor2");
104
104 TestInterfaceEmpty* testInterfaceEmptyArg; 105 TestInterfaceEmpty* testInterfaceEmptyArg;
105 int longArg; 106 int longArg;
106 V8StringResource<> defaultUndefinedOptionalStringArg; 107 V8StringResource<> defaultUndefinedOptionalStringArg;
107 V8StringResource<> defaultNullStringOptionalStringArg; 108 V8StringResource<> defaultNullStringOptionalStringArg;
108 Dictionary defaultUndefinedOptionalDictionaryArg; 109 Dictionary defaultUndefinedOptionalDictionaryArg;
109 V8StringResource<> optionalStringArg; 110 V8StringResource<> optionalStringArg;
110 { 111 int numArgsPassed = info.Length();
111 int numArgsPassed = info.Length(); 112 while (numArgsPassed > 0) {
112 while (numArgsPassed > 0) { 113 if (!info[numArgsPassed - 1]->IsUndefined())
113 if (!info[numArgsPassed - 1]->IsUndefined()) 114 break;
114 break; 115 --numArgsPassed;
115 --numArgsPassed; 116 }
116 } 117 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs olate(), info[0]);
117 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]); 118 if (!testInterfaceEmptyArg) {
118 if (!testInterfaceEmptyArg) { 119 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterface Empty'.");
119 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter faceEmpty'."); 120
121 return;
122 }
123
124 longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionSta te);
125 if (exceptionState.hadException())
126 return;
127
128 defaultUndefinedOptionalStringArg = info[2];
129 if (!defaultUndefinedOptionalStringArg.prepare())
130 return;
131
132 if (!info[3]->IsUndefined()) {
133 defaultNullStringOptionalStringArg = info[3];
134 if (!defaultNullStringOptionalStringArg.prepare())
120 return; 135 return;
121 } 136 } else {
122 longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptio nState); 137 defaultNullStringOptionalStringArg = nullptr;
123 if (exceptionState.hadException())
124 return;
125 defaultUndefinedOptionalStringArg = info[2];
126 if (!defaultUndefinedOptionalStringArg.prepare())
127 return;
128 if (!info[3]->IsUndefined()) {
129 defaultNullStringOptionalStringArg = info[3];
130 if (!defaultNullStringOptionalStringArg.prepare())
131 return;
132 } else {
133 defaultNullStringOptionalStringArg = nullptr;
134 }
135 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) {
136 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object.");
137 return;
138 }
139 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol ate(), exceptionState);
140 if (exceptionState.hadException())
141 return;
142 if (UNLIKELY(numArgsPassed <= 5)) {
143 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create( testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullSt ringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
144 v8::Local<v8::Object> wrapper = info.Holder();
145 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter faceConstructor2::wrapperTypeInfo, wrapper);
146 v8SetReturnValue(info, wrapper);
147 return;
148 }
149 optionalStringArg = info[5];
150 if (!optionalStringArg.prepare())
151 return;
152 } 138 }
139 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) {
140 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDic tionaryArg') is not an object.");
141
142 return;
143 }
144 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsolate( ), exceptionState);
145 if (exceptionState.hadException())
146 return;
147
148 if (UNLIKELY(numArgsPassed <= 5)) {
149 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(test InterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullString OptionalStringArg, defaultUndefinedOptionalDictionaryArg);
150 v8::Local<v8::Object> wrapper = info.Holder();
151 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface Constructor2::wrapperTypeInfo, wrapper);
152 v8SetReturnValue(info, wrapper);
153 return;
154 }
155 optionalStringArg = info[5];
156 if (!optionalStringArg.prepare())
157 return;
158
153 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(testInte rfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStringOpti onalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg); 159 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(testInte rfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStringOpti onalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg);
154 v8::Local<v8::Object> wrapper = info.Holder(); 160 v8::Local<v8::Object> wrapper = info.Holder();
155 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 161 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
156 v8SetReturnValue(info, wrapper); 162 v8SetReturnValue(info, wrapper);
157 } 163 }
158 164
159 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 165 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
160 { 166 {
161 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio nContext, "TestInterfaceConstructor2"); 167 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio nContext, "TestInterfaceConstructor2");
162 switch (std::min(6, info.Length())) { 168 switch (std::min(6, info.Length())) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 { 263 {
258 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 264 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
259 } 265 }
260 266
261 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8:: Isolate* isolate, v8::Local<v8::Value> value) 267 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8:: Isolate* isolate, v8::Local<v8::Value> value)
262 { 268 {
263 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr; 269 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr;
264 } 270 }
265 271
266 } // namespace blink 272 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698