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

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

Issue 770903004: IDL: Include DOMTypedArray.h when a dictionary has typed array members (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « Source/bindings/tests/results/core/TestDictionary.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "bindings/core/v8/ScriptValue.h" 11 #include "bindings/core/v8/ScriptValue.h"
12 #include "bindings/core/v8/UnionTypesCore.h" 12 #include "bindings/core/v8/UnionTypesCore.h"
13 #include "bindings/core/v8/V8Element.h" 13 #include "bindings/core/v8/V8Element.h"
14 #include "bindings/core/v8/V8InternalDictionary.h" 14 #include "bindings/core/v8/V8InternalDictionary.h"
15 #include "bindings/core/v8/V8TestInterface.h" 15 #include "bindings/core/v8/V8TestInterface.h"
16 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" 16 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h"
17 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h" 17 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h"
18 #include "bindings/core/v8/V8Uint8Array.h"
18 19
19 namespace blink { 20 namespace blink {
20 21
21 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Valu e, TestDictionary& impl, ExceptionState& exceptionState) 22 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Valu e, TestDictionary& impl, ExceptionState& exceptionState)
22 { 23 {
23 if (isUndefinedOrNull(v8Value)) 24 if (isUndefinedOrNull(v8Value))
24 return; 25 return;
25 if (!v8Value->IsObject()) { 26 if (!v8Value->IsObject()) {
26 exceptionState.throwTypeError("cannot convert to dictionary."); 27 exceptionState.throwTypeError("cannot convert to dictionary.");
27 return; 28 return;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 291 }
291 if (testInterfaceWillBeGarbageCollectedOrNullMemberValue.IsEmpty() || testIn terfaceWillBeGarbageCollectedOrNullMemberValue->IsUndefined()) { 292 if (testInterfaceWillBeGarbageCollectedOrNullMemberValue.IsEmpty() || testIn terfaceWillBeGarbageCollectedOrNullMemberValue->IsUndefined()) {
292 // Do nothing. 293 // Do nothing.
293 } else if (testInterfaceWillBeGarbageCollectedOrNullMemberValue->IsNull()) { 294 } else if (testInterfaceWillBeGarbageCollectedOrNullMemberValue->IsNull()) {
294 impl.setTestInterfaceWillBeGarbageCollectedOrNullMemberToNull(); 295 impl.setTestInterfaceWillBeGarbageCollectedOrNullMemberToNull();
295 } else { 296 } else {
296 TestInterfaceWillBeGarbageCollected* testInterfaceWillBeGarbageCollected OrNullMember = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(isolat e, testInterfaceWillBeGarbageCollectedOrNullMemberValue); 297 TestInterfaceWillBeGarbageCollected* testInterfaceWillBeGarbageCollected OrNullMember = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(isolat e, testInterfaceWillBeGarbageCollectedOrNullMemberValue);
297 impl.setTestInterfaceWillBeGarbageCollectedOrNullMember(testInterfaceWil lBeGarbageCollectedOrNullMember); 298 impl.setTestInterfaceWillBeGarbageCollectedOrNullMember(testInterfaceWil lBeGarbageCollectedOrNullMember);
298 } 299 }
299 300
301 v8::Local<v8::Value> uint8ArrayMemberValue = v8Object->Get(v8String(isolate, "uint8ArrayMember"));
302 if (block.HasCaught()) {
303 exceptionState.rethrowV8Exception(block.Exception());
304 return;
305 }
306 if (uint8ArrayMemberValue.IsEmpty() || uint8ArrayMemberValue->IsUndefined()) {
307 // Do nothing.
308 } else {
309 DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array() ? V8Uint8Array::toImpl(v8::Handle<v8::Uint8Array>::Cast(uint8ArrayMemberValue)) : 0;
310 impl.setUint8ArrayMember(uint8ArrayMember);
311 }
312
300 } 313 }
301 314
302 v8::Handle<v8::Value> toV8(const TestDictionary& impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 315 v8::Handle<v8::Value> toV8(const TestDictionary& impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
303 { 316 {
304 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); 317 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate);
305 toV8TestDictionary(impl, v8Object, creationContext, isolate); 318 toV8TestDictionary(impl, v8Object, creationContext, isolate);
306 return v8Object; 319 return v8Object;
307 } 320 }
308 321
309 template<> 322 template<>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 410 }
398 411
399 if (impl.hasTestInterfaceWillBeGarbageCollectedMember()) { 412 if (impl.hasTestInterfaceWillBeGarbageCollectedMember()) {
400 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedMe mber"), toV8(impl.testInterfaceWillBeGarbageCollectedMember(), creationContext, isolate)); 413 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedMe mber"), toV8(impl.testInterfaceWillBeGarbageCollectedMember(), creationContext, isolate));
401 } 414 }
402 415
403 if (impl.hasTestInterfaceWillBeGarbageCollectedOrNullMember()) { 416 if (impl.hasTestInterfaceWillBeGarbageCollectedOrNullMember()) {
404 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOr NullMember"), toV8(impl.testInterfaceWillBeGarbageCollectedOrNullMember(), creat ionContext, isolate)); 417 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOr NullMember"), toV8(impl.testInterfaceWillBeGarbageCollectedOrNullMember(), creat ionContext, isolate));
405 } 418 }
406 419
420 if (impl.hasUint8ArrayMember()) {
421 dictionary->Set(v8String(isolate, "uint8ArrayMember"), toV8(impl.uint8Ar rayMember(), creationContext, isolate));
422 }
423
407 } 424 }
408 425
409 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(const v8::Handle<v 8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) 426 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(const v8::Handle<v 8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
410 { 427 {
411 TestDictionary impl; 428 TestDictionary impl;
412 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 429 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
413 return impl; 430 return impl;
414 } 431 }
415 432
416 } // namespace blink 433 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/TestDictionary.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698