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/Dictionary.h" | 10 #include "bindings/core/v8/PropertyBag.h" |
11 #include "bindings/tests/v8/V8TestInterface.h" | 11 #include "bindings/tests/v8/V8TestInterface.h" |
12 #include "bindings/tests/v8/V8TestInterfaceGarbageCollected.h" | 12 #include "bindings/tests/v8/V8TestInterfaceGarbageCollected.h" |
13 #include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h" | 13 #include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 TestDictionary* V8TestDictionary::toNative(v8::Isolate* isolate, v8::Handle<v8::
Value> v8Value) | 17 TestDictionary* V8TestDictionary::toNative(v8::Isolate* isolate, v8::Handle<v8::
Value> v8Value) |
18 { | 18 { |
19 TestDictionary* impl = TestDictionary::create(); | 19 TestDictionary* impl = TestDictionary::create(); |
20 // FIXME: Do not use Dictionary and DictionaryHelper | 20 if (v8Value.IsEmpty() || !v8Value->IsObject()) |
21 // https://crbug.com/321462 | 21 return impl; |
22 Dictionary dictionary(v8Value, isolate); | 22 v8::Local<v8::Object> v8Object = v8Value->ToObject(); |
| 23 PropertyBag bag(isolate, v8Object); |
23 bool booleanMember; | 24 bool booleanMember; |
24 if (DictionaryHelper::get(dictionary, "booleanMember", booleanMember)) | 25 if (bag.get("booleanMember", booleanMember)) |
25 impl->setBooleanMember(booleanMember); | 26 impl->setBooleanMember(booleanMember); |
26 double doubleOrNullMember; | 27 double doubleOrNullMember; |
27 if (DictionaryHelper::get(dictionary, "doubleOrNullMember", doubleOrNullMemb
er)) | 28 if (bag.get("doubleOrNullMember", doubleOrNullMember)) |
28 impl->setDoubleOrNullMember(doubleOrNullMember); | 29 impl->setDoubleOrNullMember(doubleOrNullMember); |
29 int longMember; | 30 int longMember; |
30 if (DictionaryHelper::get(dictionary, "longMember", longMember)) | 31 if (bag.get("longMember", longMember)) |
31 impl->setLongMember(longMember); | 32 impl->setLongMember(longMember); |
32 Vector<String> stringArrayMember; | 33 Vector<String> stringArrayMember; |
33 if (DictionaryHelper::get(dictionary, "stringArrayMember", stringArrayMember
)) | 34 if (bag.get("stringArrayMember", stringArrayMember)) |
34 impl->setStringArrayMember(stringArrayMember); | 35 impl->setStringArrayMember(stringArrayMember); |
35 String stringMember; | 36 String stringMember; |
36 if (DictionaryHelper::get(dictionary, "stringMember", stringMember)) | 37 if (bag.get("stringMember", stringMember)) |
37 impl->setStringMember(stringMember); | 38 impl->setStringMember(stringMember); |
38 String stringOrNullMember; | 39 String stringOrNullMember; |
39 if (DictionaryHelper::get(dictionary, "stringOrNullMember", stringOrNullMemb
er)) | 40 if (bag.get("stringOrNullMember", stringOrNullMember)) |
40 impl->setStringOrNullMember(stringOrNullMember); | 41 impl->setStringOrNullMember(stringOrNullMember); |
41 Vector<String> stringSequenceMember; | 42 Vector<String> stringSequenceMember; |
42 if (DictionaryHelper::get(dictionary, "stringSequenceMember", stringSequence
Member)) | 43 if (bag.get("stringSequenceMember", stringSequenceMember)) |
43 impl->setStringSequenceMember(stringSequenceMember); | 44 impl->setStringSequenceMember(stringSequenceMember); |
44 RawPtr<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedMember; | 45 RawPtr<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedMember; |
45 if (DictionaryHelper::get(dictionary, "testInterfaceGarbageCollectedMember",
testInterfaceGarbageCollectedMember)) | 46 if (bag.get("testInterfaceGarbageCollectedMember", testInterfaceGarbageColle
ctedMember)) |
46 impl->setTestInterfaceGarbageCollectedMember(testInterfaceGarbageCollect
edMember); | 47 impl->setTestInterfaceGarbageCollectedMember(testInterfaceGarbageCollect
edMember); |
47 RawPtr<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedOrNullMem
ber; | 48 RawPtr<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedOrNullMem
ber; |
48 if (DictionaryHelper::get(dictionary, "testInterfaceGarbageCollectedOrNullMe
mber", testInterfaceGarbageCollectedOrNullMember)) | 49 if (bag.get("testInterfaceGarbageCollectedOrNullMember", testInterfaceGarbag
eCollectedOrNullMember)) |
49 impl->setTestInterfaceGarbageCollectedOrNullMember(testInterfaceGarbageC
ollectedOrNullMember); | 50 impl->setTestInterfaceGarbageCollectedOrNullMember(testInterfaceGarbageC
ollectedOrNullMember); |
50 RefPtr<TestInterfaceImplementation> testInterfaceMember; | 51 RefPtr<TestInterfaceImplementation> testInterfaceMember; |
51 if (DictionaryHelper::get(dictionary, "testInterfaceMember", testInterfaceMe
mber)) | 52 if (bag.get("testInterfaceMember", testInterfaceMember)) |
52 impl->setTestInterfaceMember(testInterfaceMember); | 53 impl->setTestInterfaceMember(testInterfaceMember); |
53 RefPtr<TestInterfaceImplementation> testInterfaceOrNullMember; | 54 RefPtr<TestInterfaceImplementation> testInterfaceOrNullMember; |
54 if (DictionaryHelper::get(dictionary, "testInterfaceOrNullMember", testInter
faceOrNullMember)) | 55 if (bag.get("testInterfaceOrNullMember", testInterfaceOrNullMember)) |
55 impl->setTestInterfaceOrNullMember(testInterfaceOrNullMember); | 56 impl->setTestInterfaceOrNullMember(testInterfaceOrNullMember); |
56 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeG
arbageCollectedMember; | 57 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeG
arbageCollectedMember; |
57 if (DictionaryHelper::get(dictionary, "testInterfaceWillBeGarbageCollectedMe
mber", testInterfaceWillBeGarbageCollectedMember)) | 58 if (bag.get("testInterfaceWillBeGarbageCollectedMember", testInterfaceWillBe
GarbageCollectedMember)) |
58 impl->setTestInterfaceWillBeGarbageCollectedMember(testInterfaceWillBeGa
rbageCollectedMember); | 59 impl->setTestInterfaceWillBeGarbageCollectedMember(testInterfaceWillBeGa
rbageCollectedMember); |
59 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeG
arbageCollectedOrNullMember; | 60 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeG
arbageCollectedOrNullMember; |
60 if (DictionaryHelper::get(dictionary, "testInterfaceWillBeGarbageCollectedOr
NullMember", testInterfaceWillBeGarbageCollectedOrNullMember)) | 61 if (bag.get("testInterfaceWillBeGarbageCollectedOrNullMember", testInterface
WillBeGarbageCollectedOrNullMember)) |
61 impl->setTestInterfaceWillBeGarbageCollectedOrNullMember(testInterfaceWi
llBeGarbageCollectedOrNullMember); | 62 impl->setTestInterfaceWillBeGarbageCollectedOrNullMember(testInterfaceWi
llBeGarbageCollectedOrNullMember); |
62 return impl; | 63 return impl; |
63 } | 64 } |
64 | 65 |
65 v8::Handle<v8::Value> toV8(TestDictionary* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) | 66 v8::Handle<v8::Value> toV8(TestDictionary* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) |
66 { | 67 { |
67 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); | 68 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate); |
68 if (impl->hasBooleanMember()) | 69 if (impl->hasBooleanMember()) |
69 v8Object->Set(v8String(isolate, "booleanMember"), v8Boolean(impl->boolea
nMember(), isolate)); | 70 v8Object->Set(v8String(isolate, "booleanMember"), v8Boolean(impl->boolea
nMember(), isolate)); |
70 if (impl->hasDoubleOrNullMember()) | 71 if (impl->hasDoubleOrNullMember()) |
(...skipping 23 matching lines...) Expand all Loading... |
94 if (impl->hasTestInterfaceOrNullMember()) | 95 if (impl->hasTestInterfaceOrNullMember()) |
95 v8Object->Set(v8String(isolate, "testInterfaceOrNullMember"), toV8(impl-
>testInterfaceOrNullMember(), creationContext, isolate)); | 96 v8Object->Set(v8String(isolate, "testInterfaceOrNullMember"), toV8(impl-
>testInterfaceOrNullMember(), creationContext, isolate)); |
96 if (impl->hasTestInterfaceWillBeGarbageCollectedMember()) | 97 if (impl->hasTestInterfaceWillBeGarbageCollectedMember()) |
97 v8Object->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedMemb
er"), toV8(impl->testInterfaceWillBeGarbageCollectedMember(), creationContext, i
solate)); | 98 v8Object->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedMemb
er"), toV8(impl->testInterfaceWillBeGarbageCollectedMember(), creationContext, i
solate)); |
98 if (impl->hasTestInterfaceWillBeGarbageCollectedOrNullMember()) | 99 if (impl->hasTestInterfaceWillBeGarbageCollectedOrNullMember()) |
99 v8Object->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOrNu
llMember"), toV8(impl->testInterfaceWillBeGarbageCollectedOrNullMember(), creati
onContext, isolate)); | 100 v8Object->Set(v8String(isolate, "testInterfaceWillBeGarbageCollectedOrNu
llMember"), toV8(impl->testInterfaceWillBeGarbageCollectedOrNullMember(), creati
onContext, isolate)); |
100 return v8Object; | 101 return v8Object; |
101 } | 102 } |
102 | 103 |
103 } // namespace blink | 104 } // namespace blink |
OLD | NEW |