| 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 "V8TestDictionaryDerived.h" | 8 #include "V8TestDictionaryDerived.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "bindings/core/v8/V8TestDictionary.h" | 11 #include "bindings/core/v8/V8TestDictionary.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Hand
le<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) | 15 void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
l<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) |
| 16 { | 16 { |
| 17 if (isUndefinedOrNull(v8Value)) | 17 if (isUndefinedOrNull(v8Value)) |
| 18 return; | 18 return; |
| 19 if (!v8Value->IsObject()) { | 19 if (!v8Value->IsObject()) { |
| 20 exceptionState.throwTypeError("cannot convert to dictionary."); | 20 exceptionState.throwTypeError("cannot convert to dictionary."); |
| 21 return; | 21 return; |
| 22 } | 22 } |
| 23 | 23 |
| 24 V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState); | 24 V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState); |
| 25 if (exceptionState.hadException()) | 25 if (exceptionState.hadException()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 } | 46 } |
| 47 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith
DefaultValue->IsUndefined()) { | 47 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith
DefaultValue->IsUndefined()) { |
| 48 // Do nothing. | 48 // Do nothing. |
| 49 } else { | 49 } else { |
| 50 TOSTRING_VOID(V8StringResource<>, derivedStringMemberWithDefault, derive
dStringMemberWithDefaultValue); | 50 TOSTRING_VOID(V8StringResource<>, derivedStringMemberWithDefault, derive
dStringMemberWithDefaultValue); |
| 51 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); | 51 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } | 54 } |
| 55 | 55 |
| 56 v8::Handle<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) | 56 v8::Local<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::Lo
cal<v8::Object> creationContext, v8::Isolate* isolate) |
| 57 { | 57 { |
| 58 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); | 58 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
| 59 toV8TestDictionary(impl, v8Object, creationContext, isolate); | 59 toV8TestDictionary(impl, v8Object, creationContext, isolate); |
| 60 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol
ate); | 60 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol
ate); |
| 61 return v8Object; | 61 return v8Object; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Handle<v8::Object> dictionary, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate* isolate) | 64 void toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationCont
ext, v8::Isolate* isolate) |
| 65 { | 65 { |
| 66 if (impl.hasDerivedStringMember()) { | 66 if (impl.hasDerivedStringMember()) { |
| 67 dictionary->Set(v8String(isolate, "derivedStringMember"), v8String(isola
te, impl.derivedStringMember())); | 67 dictionary->Set(v8String(isolate, "derivedStringMember"), v8String(isola
te, impl.derivedStringMember())); |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (impl.hasDerivedStringMemberWithDefault()) { | 70 if (impl.hasDerivedStringMemberWithDefault()) { |
| 71 dictionary->Set(v8String(isolate, "derivedStringMemberWithDefault"), v8S
tring(isolate, impl.derivedStringMemberWithDefault())); | 71 dictionary->Set(v8String(isolate, "derivedStringMemberWithDefault"), v8S
tring(isolate, impl.derivedStringMemberWithDefault())); |
| 72 } else { | 72 } else { |
| 73 dictionary->Set(v8String(isolate, "derivedStringMemberWithDefault"), v8S
tring(isolate, String("default string value"))); | 73 dictionary->Set(v8String(isolate, "derivedStringMemberWithDefault"), v8S
tring(isolate, String("default string value"))); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } | 76 } |
| 77 | 77 |
| 78 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate,
ExceptionState& exceptionState) | 78 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, E
xceptionState& exceptionState) |
| 79 { | 79 { |
| 80 TestDictionaryDerivedImplementedAs impl; | 80 TestDictionaryDerivedImplementedAs impl; |
| 81 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); | 81 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); |
| 82 return impl; | 82 return impl; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |