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. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); | 97 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
98 if (!toV8TestDictionaryDerivedImplementedAs(*this, v8Object, creationContext,
isolate)) | 98 if (!toV8TestDictionaryDerivedImplementedAs(*this, v8Object, creationContext,
isolate)) |
99 return v8::Undefined(isolate); | 99 return v8::Undefined(isolate); |
100 return v8Object; | 100 return v8Object; |
101 } | 101 } |
102 | 102 |
103 bool toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationCont
ext, v8::Isolate* isolate) { | 103 bool toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationCont
ext, v8::Isolate* isolate) { |
104 if (!toV8TestDictionary(impl, dictionary, creationContext, isolate)) | 104 if (!toV8TestDictionary(impl, dictionary, creationContext, isolate)) |
105 return false; | 105 return false; |
106 | 106 |
| 107 v8::Local<v8::Value> derivedStringMemberValue; |
| 108 bool derivedStringMemberHasValueOrDefault = false; |
107 if (impl.hasDerivedStringMember()) { | 109 if (impl.hasDerivedStringMember()) { |
108 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8AtomicString(isolate, "derivedStringMember"), v8String(isolate, impl.deriv
edStringMember())))) | 110 derivedStringMemberValue = v8String(isolate, impl.derivedStringMember()); |
109 return false; | 111 derivedStringMemberHasValueOrDefault = true; |
| 112 } |
| 113 if (derivedStringMemberHasValueOrDefault && |
| 114 !v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext()
, v8AtomicString(isolate, "derivedStringMember"), derivedStringMemberValue))) { |
| 115 return false; |
110 } | 116 } |
111 | 117 |
| 118 v8::Local<v8::Value> derivedStringMemberWithDefaultValue; |
| 119 bool derivedStringMemberWithDefaultHasValueOrDefault = false; |
112 if (impl.hasDerivedStringMemberWithDefault()) { | 120 if (impl.hasDerivedStringMemberWithDefault()) { |
113 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8AtomicString(isolate, "derivedStringMemberWithDefault"), v8String(isolate,
impl.derivedStringMemberWithDefault())))) | 121 derivedStringMemberWithDefaultValue = v8String(isolate, impl.derivedStringMe
mberWithDefault()); |
114 return false; | 122 derivedStringMemberWithDefaultHasValueOrDefault = true; |
115 } else { | 123 } else { |
116 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8AtomicString(isolate, "derivedStringMemberWithDefault"), v8String(isolate,
"default string value")))) | 124 derivedStringMemberWithDefaultValue = v8String(isolate, "default string valu
e"); |
117 return false; | 125 derivedStringMemberWithDefaultHasValueOrDefault = true; |
| 126 } |
| 127 if (derivedStringMemberWithDefaultHasValueOrDefault && |
| 128 !v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext()
, v8AtomicString(isolate, "derivedStringMemberWithDefault"), derivedStringMember
WithDefaultValue))) { |
| 129 return false; |
118 } | 130 } |
119 | 131 |
| 132 v8::Local<v8::Value> requiredLongMemberValue; |
| 133 bool requiredLongMemberHasValueOrDefault = false; |
120 if (impl.hasRequiredLongMember()) { | 134 if (impl.hasRequiredLongMember()) { |
121 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8AtomicString(isolate, "requiredLongMember"), v8::Integer::New(isolate, imp
l.requiredLongMember())))) | 135 requiredLongMemberValue = v8::Integer::New(isolate, impl.requiredLongMember(
)); |
122 return false; | 136 requiredLongMemberHasValueOrDefault = true; |
123 } else { | 137 } else { |
124 NOTREACHED(); | 138 NOTREACHED(); |
125 } | 139 } |
| 140 if (requiredLongMemberHasValueOrDefault && |
| 141 !v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext()
, v8AtomicString(isolate, "requiredLongMember"), requiredLongMemberValue))) { |
| 142 return false; |
| 143 } |
126 | 144 |
| 145 v8::Local<v8::Value> stringOrDoubleSequenceMemberValue; |
| 146 bool stringOrDoubleSequenceMemberHasValueOrDefault = false; |
127 if (impl.hasStringOrDoubleSequenceMember()) { | 147 if (impl.hasStringOrDoubleSequenceMember()) { |
128 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8AtomicString(isolate, "stringOrDoubleSequenceMember"), ToV8(impl.stringOrD
oubleSequenceMember(), creationContext, isolate)))) | 148 stringOrDoubleSequenceMemberValue = ToV8(impl.stringOrDoubleSequenceMember()
, creationContext, isolate); |
129 return false; | 149 stringOrDoubleSequenceMemberHasValueOrDefault = true; |
| 150 } |
| 151 if (stringOrDoubleSequenceMemberHasValueOrDefault && |
| 152 !v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext()
, v8AtomicString(isolate, "stringOrDoubleSequenceMember"), stringOrDoubleSequenc
eMemberValue))) { |
| 153 return false; |
130 } | 154 } |
131 | 155 |
132 return true; | 156 return true; |
133 } | 157 } |
134 | 158 |
135 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) { | 159 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) { |
136 TestDictionaryDerivedImplementedAs impl; | 160 TestDictionaryDerivedImplementedAs impl; |
137 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exceptionSt
ate); | 161 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exceptionSt
ate); |
138 return impl; | 162 return impl; |
139 } | 163 } |
140 | 164 |
141 } // namespace blink | 165 } // namespace blink |
OLD | NEW |