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

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

Issue 1125683002: Avoid nearly identical toImplArray() and toImplHeapArray() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 "V8TestDictionary.h" 8 #include "V8TestDictionary.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 { 168 {
169 v8::Local<v8::Value> enumSequenceMemberValue; 169 v8::Local<v8::Value> enumSequenceMemberValue;
170 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enum SequenceMember")).ToLocal(&enumSequenceMemberValue)) { 170 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enum SequenceMember")).ToLocal(&enumSequenceMemberValue)) {
171 exceptionState.rethrowV8Exception(block.Exception()); 171 exceptionState.rethrowV8Exception(block.Exception());
172 return; 172 return;
173 } 173 }
174 if (enumSequenceMemberValue.IsEmpty() || enumSequenceMemberValue->IsUnde fined()) { 174 if (enumSequenceMemberValue.IsEmpty() || enumSequenceMemberValue->IsUnde fined()) {
175 // Do nothing. 175 // Do nothing.
176 } else { 176 } else {
177 Vector<String> enumSequenceMember = toImplArray<String>(enumSequence MemberValue, 0, isolate, exceptionState); 177 Vector<String> enumSequenceMember = toImplArray<Vector<String>>(enum SequenceMemberValue, 0, isolate, exceptionState);
178 if (exceptionState.hadException()) 178 if (exceptionState.hadException())
179 return; 179 return;
180 static const char* validValues[] = { 180 static const char* validValues[] = {
181 "", 181 "",
182 "EnumValue1", 182 "EnumValue1",
183 "EnumValue2", 183 "EnumValue2",
184 "EnumValue3", 184 "EnumValue3",
185 }; 185 };
186 if (!isValidEnum(enumSequenceMember, validValues, WTF_ARRAY_LENGTH(v alidValues), "TestEnum", exceptionState)) 186 if (!isValidEnum(enumSequenceMember, validValues, WTF_ARRAY_LENGTH(v alidValues), "TestEnum", exceptionState))
187 return; 187 return;
(...skipping 21 matching lines...) Expand all
209 209
210 { 210 {
211 v8::Local<v8::Value> internalDictionarySequenceMemberValue; 211 v8::Local<v8::Value> internalDictionarySequenceMemberValue;
212 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "inte rnalDictionarySequenceMember")).ToLocal(&internalDictionarySequenceMemberValue)) { 212 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "inte rnalDictionarySequenceMember")).ToLocal(&internalDictionarySequenceMemberValue)) {
213 exceptionState.rethrowV8Exception(block.Exception()); 213 exceptionState.rethrowV8Exception(block.Exception());
214 return; 214 return;
215 } 215 }
216 if (internalDictionarySequenceMemberValue.IsEmpty() || internalDictionar ySequenceMemberValue->IsUndefined()) { 216 if (internalDictionarySequenceMemberValue.IsEmpty() || internalDictionar ySequenceMemberValue->IsUndefined()) {
217 // Do nothing. 217 // Do nothing.
218 } else { 218 } else {
219 HeapVector<InternalDictionary> internalDictionarySequenceMember = to ImplHeapArray<InternalDictionary>(internalDictionarySequenceMemberValue, 0, isol ate, exceptionState); 219 HeapVector<InternalDictionary> internalDictionarySequenceMember = to ImplArray<HeapVector<InternalDictionary>>(internalDictionarySequenceMemberValue, 0, isolate, exceptionState);
220 if (exceptionState.hadException()) 220 if (exceptionState.hadException())
221 return; 221 return;
222 impl.setInternalDictionarySequenceMember(internalDictionarySequenceM ember); 222 impl.setInternalDictionarySequenceMember(internalDictionarySequenceM ember);
223 } 223 }
224 } 224 }
225 225
226 { 226 {
227 v8::Local<v8::Value> longMemberValue; 227 v8::Local<v8::Value> longMemberValue;
228 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "long Member")).ToLocal(&longMemberValue)) { 228 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "long Member")).ToLocal(&longMemberValue)) {
229 exceptionState.rethrowV8Exception(block.Exception()); 229 exceptionState.rethrowV8Exception(block.Exception());
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 { 313 {
314 v8::Local<v8::Value> stringArrayMemberValue; 314 v8::Local<v8::Value> stringArrayMemberValue;
315 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngArrayMember")).ToLocal(&stringArrayMemberValue)) { 315 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngArrayMember")).ToLocal(&stringArrayMemberValue)) {
316 exceptionState.rethrowV8Exception(block.Exception()); 316 exceptionState.rethrowV8Exception(block.Exception());
317 return; 317 return;
318 } 318 }
319 if (stringArrayMemberValue.IsEmpty() || stringArrayMemberValue->IsUndefi ned()) { 319 if (stringArrayMemberValue.IsEmpty() || stringArrayMemberValue->IsUndefi ned()) {
320 // Do nothing. 320 // Do nothing.
321 } else { 321 } else {
322 Vector<String> stringArrayMember = toImplArray<String>(stringArrayMe mberValue, 0, isolate, exceptionState); 322 Vector<String> stringArrayMember = toImplArray<Vector<String>>(strin gArrayMemberValue, 0, isolate, exceptionState);
323 if (exceptionState.hadException()) 323 if (exceptionState.hadException())
324 return; 324 return;
325 impl.setStringArrayMember(stringArrayMember); 325 impl.setStringArrayMember(stringArrayMember);
326 } 326 }
327 } 327 }
328 328
329 { 329 {
330 v8::Local<v8::Value> stringMemberValue; 330 v8::Local<v8::Value> stringMemberValue;
331 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngMember")).ToLocal(&stringMemberValue)) { 331 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngMember")).ToLocal(&stringMemberValue)) {
332 exceptionState.rethrowV8Exception(block.Exception()); 332 exceptionState.rethrowV8Exception(block.Exception());
(...skipping 29 matching lines...) Expand all
362 362
363 { 363 {
364 v8::Local<v8::Value> stringSequenceMemberValue; 364 v8::Local<v8::Value> stringSequenceMemberValue;
365 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngSequenceMember")).ToLocal(&stringSequenceMemberValue)) { 365 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stri ngSequenceMember")).ToLocal(&stringSequenceMemberValue)) {
366 exceptionState.rethrowV8Exception(block.Exception()); 366 exceptionState.rethrowV8Exception(block.Exception());
367 return; 367 return;
368 } 368 }
369 if (stringSequenceMemberValue.IsEmpty() || stringSequenceMemberValue->Is Undefined()) { 369 if (stringSequenceMemberValue.IsEmpty() || stringSequenceMemberValue->Is Undefined()) {
370 // Do nothing. 370 // Do nothing.
371 } else { 371 } else {
372 Vector<String> stringSequenceMember = toImplArray<String>(stringSequ enceMemberValue, 0, isolate, exceptionState); 372 Vector<String> stringSequenceMember = toImplArray<Vector<String>>(st ringSequenceMemberValue, 0, isolate, exceptionState);
373 if (exceptionState.hadException()) 373 if (exceptionState.hadException())
374 return; 374 return;
375 impl.setStringSequenceMember(stringSequenceMember); 375 impl.setStringSequenceMember(stringSequenceMember);
376 } 376 }
377 } 377 }
378 378
379 { 379 {
380 v8::Local<v8::Value> testInterface2OrUint8ArrayMemberValue; 380 v8::Local<v8::Value> testInterface2OrUint8ArrayMemberValue;
381 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "test Interface2OrUint8ArrayMember")).ToLocal(&testInterface2OrUint8ArrayMemberValue)) { 381 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "test Interface2OrUint8ArrayMember")).ToLocal(&testInterface2OrUint8ArrayMemberValue)) {
382 exceptionState.rethrowV8Exception(block.Exception()); 382 exceptionState.rethrowV8Exception(block.Exception());
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 724
725 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) 725 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState)
726 { 726 {
727 TestDictionary impl; 727 TestDictionary impl;
728 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 728 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
729 return impl; 729 return impl;
730 } 730 }
731 731
732 } // namespace blink 732 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698