| OLD | NEW |
| 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/V8TestInterface2.h" | 16 #include "bindings/core/v8/V8TestInterface2.h" |
| 17 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" | 17 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" |
| 18 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h" | 18 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h" |
| 19 #include "bindings/core/v8/V8Uint8Array.h" | 19 #include "bindings/core/v8/V8Uint8Array.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Valu
e, TestDictionary& impl, ExceptionState& exceptionState) | 23 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, TestDictionary& impl, ExceptionState& exceptionState) |
| 24 { | 24 { |
| 25 if (isUndefinedOrNull(v8Value)) | 25 if (isUndefinedOrNull(v8Value)) |
| 26 return; | 26 return; |
| 27 if (!v8Value->IsObject()) { | 27 if (!v8Value->IsObject()) { |
| 28 exceptionState.throwTypeError("cannot convert to dictionary."); | 28 exceptionState.throwTypeError("cannot convert to dictionary."); |
| 29 return; | 29 return; |
| 30 } | 30 } |
| 31 | 31 |
| 32 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); | 32 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); |
| 33 v8::TryCatch block; | 33 v8::TryCatch block; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array()
? V8Uint8Array::toImpl(v8::Handle<v8::Uint8Array>::Cast(uint8ArrayMemberValue))
: 0; | 351 DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array()
? V8Uint8Array::toImpl(v8::Handle<v8::Uint8Array>::Cast(uint8ArrayMemberValue))
: 0; |
| 352 if (!uint8ArrayMember && !uint8ArrayMemberValue->IsNull()) { | 352 if (!uint8ArrayMember && !uint8ArrayMemberValue->IsNull()) { |
| 353 exceptionState.throwTypeError("member uint8ArrayMember is not of typ
e Uint8Array."); | 353 exceptionState.throwTypeError("member uint8ArrayMember is not of typ
e Uint8Array."); |
| 354 return; | 354 return; |
| 355 } | 355 } |
| 356 impl.setUint8ArrayMember(uint8ArrayMember); | 356 impl.setUint8ArrayMember(uint8ArrayMember); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } | 359 } |
| 360 | 360 |
| 361 v8::Handle<v8::Value> toV8(const TestDictionary& impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 361 v8::Local<v8::Value> toV8(const TestDictionary& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) |
| 362 { | 362 { |
| 363 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); | 363 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
| 364 toV8TestDictionary(impl, v8Object, creationContext, isolate); | 364 toV8TestDictionary(impl, v8Object, creationContext, isolate); |
| 365 return v8Object; | 365 return v8Object; |
| 366 } | 366 } |
| 367 | 367 |
| 368 void toV8TestDictionary(const TestDictionary& impl, v8::Handle<v8::Object> dicti
onary, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 368 void toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio
nary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) |
| 369 { | 369 { |
| 370 if (impl.hasBooleanMember()) { | 370 if (impl.hasBooleanMember()) { |
| 371 dictionary->Set(v8String(isolate, "booleanMember"), v8Boolean(impl.boole
anMember(), isolate)); | 371 dictionary->Set(v8String(isolate, "booleanMember"), v8Boolean(impl.boole
anMember(), isolate)); |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (impl.hasCreateMember()) { | 374 if (impl.hasCreateMember()) { |
| 375 dictionary->Set(v8String(isolate, "create"), v8Boolean(impl.createMember
(), isolate)); | 375 dictionary->Set(v8String(isolate, "create"), v8Boolean(impl.createMember
(), isolate)); |
| 376 } | 376 } |
| 377 | 377 |
| 378 if (impl.hasDoubleOrNullMember()) { | 378 if (impl.hasDoubleOrNullMember()) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 if (impl.hasTestInterfaceWillBeGarbageCollectedOrNullMember()) { | 460 if (impl.hasTestInterfaceWillBeGarbageCollectedOrNullMember()) { |
| 461 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOr
NullMember"), toV8(impl.testInterfaceWillBeGarbageCollectedOrNullMember(), creat
ionContext, isolate)); | 461 dictionary->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOr
NullMember"), toV8(impl.testInterfaceWillBeGarbageCollectedOrNullMember(), creat
ionContext, isolate)); |
| 462 } | 462 } |
| 463 | 463 |
| 464 if (impl.hasUint8ArrayMember()) { | 464 if (impl.hasUint8ArrayMember()) { |
| 465 dictionary->Set(v8String(isolate, "uint8ArrayMember"), toV8(impl.uint8Ar
rayMember(), creationContext, isolate)); | 465 dictionary->Set(v8String(isolate, "uint8ArrayMember"), toV8(impl.uint8Ar
rayMember(), creationContext, isolate)); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } | 468 } |
| 469 | 469 |
| 470 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(const v8::Handle<v
8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) | 470 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(const v8::Local<v8
::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) |
| 471 { | 471 { |
| 472 TestDictionary impl; | 472 TestDictionary impl; |
| 473 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); | 473 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); |
| 474 return impl; | 474 return impl; |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace blink | 477 } // namespace blink |
| OLD | NEW |