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 #ifndef DictionaryTest_h | 5 #ifndef DictionaryTest_h |
6 #define DictionaryTest_h | 6 #define DictionaryTest_h |
7 | 7 |
8 #include "bindings/core/v8/Nullable.h" | 8 #include "bindings/core/v8/Nullable.h" |
| 9 #include "bindings/core/v8/ScriptState.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 11 #include "bindings/core/v8/ScriptWrappable.h" |
11 #include "bindings/core/v8/UnionTypesCore.h" | 12 #include "bindings/core/v8/UnionTypesCore.h" |
12 #include "core/dom/Element.h" | 13 #include "core/dom/Element.h" |
13 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 15 #include "wtf/HashMap.h" |
14 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 | 19 |
18 class InternalDictionary; | 20 class InternalDictionary; |
19 class InternalDictionaryDerived; | 21 class InternalDictionaryDerived; |
20 | 22 |
21 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public
ScriptWrappable { | 23 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public
ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 public: | 25 public: |
24 static DictionaryTest* create() | 26 static DictionaryTest* create() |
25 { | 27 { |
26 return new DictionaryTest(); | 28 return new DictionaryTest(); |
27 } | 29 } |
28 virtual ~DictionaryTest(); | 30 virtual ~DictionaryTest(); |
29 | 31 |
30 // Stores all members into corresponding fields | 32 // Stores all members into corresponding fields |
31 void set(const InternalDictionary&); | 33 void set(const InternalDictionary&); |
32 // Sets each member of the given TestDictionary from fields | 34 // Sets each member of the given TestDictionary from fields |
33 void get(InternalDictionary&); | 35 void get(InternalDictionary&); |
| 36 // Returns properties of the latest |dictionaryMember| which was set via |
| 37 // set(). |
| 38 ScriptValue getDictionaryMemberProperties(ScriptState*); |
34 | 39 |
35 void setDerived(const InternalDictionaryDerived&); | 40 void setDerived(const InternalDictionaryDerived&); |
36 void getDerived(InternalDictionaryDerived&); | 41 void getDerived(InternalDictionaryDerived&); |
37 | 42 |
38 DECLARE_TRACE(); | 43 DECLARE_TRACE(); |
39 | 44 |
40 private: | 45 private: |
41 DictionaryTest(); | 46 DictionaryTest(); |
42 | 47 |
43 void reset(); | 48 void reset(); |
(...skipping 26 matching lines...) Expand all Loading... |
70 RefPtrWillBeMember<Element> m_elementMember; | 75 RefPtrWillBeMember<Element> m_elementMember; |
71 RefPtrWillBeMember<Element> m_elementOrNullMember; | 76 RefPtrWillBeMember<Element> m_elementOrNullMember; |
72 ScriptValue m_objectMember; | 77 ScriptValue m_objectMember; |
73 ScriptValue m_objectOrNullMemberWithDefault; | 78 ScriptValue m_objectOrNullMemberWithDefault; |
74 DoubleOrString m_doubleOrStringMember; | 79 DoubleOrString m_doubleOrStringMember; |
75 Nullable<HeapVector<DoubleOrString>> m_doubleOrStringSequenceMember; | 80 Nullable<HeapVector<DoubleOrString>> m_doubleOrStringSequenceMember; |
76 RefPtrWillBeMember<EventTarget> m_eventTargetOrNullMember; | 81 RefPtrWillBeMember<EventTarget> m_eventTargetOrNullMember; |
77 String m_derivedStringMember; | 82 String m_derivedStringMember; |
78 String m_derivedStringMemberWithDefault; | 83 String m_derivedStringMemberWithDefault; |
79 bool m_requiredBooleanMember; | 84 bool m_requiredBooleanMember; |
| 85 Nullable<HashMap<String, String>> m_dictionaryMemberProperties; |
80 }; | 86 }; |
81 | 87 |
82 } // namespace blink | 88 } // namespace blink |
83 | 89 |
84 #endif // DictionaryTest_h | 90 #endif // DictionaryTest_h |
OLD | NEW |