| 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/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| 11 #include "core/dom/Element.h" | 11 #include "core/dom/Element.h" |
| 12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class InternalDictionary; | 17 class InternalDictionary; |
| 18 | 18 |
| 19 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public
ScriptWrappable { | 19 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public
ScriptWrappable { |
| 20 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 21 public: | 21 public: |
| 22 static DictionaryTest* create() | 22 static DictionaryTest* create() |
| 23 { | 23 { |
| 24 return new DictionaryTest(); | 24 return new DictionaryTest(); |
| 25 } | 25 } |
| 26 virtual ~DictionaryTest(); | 26 virtual ~DictionaryTest(); |
| 27 | 27 |
| 28 // Stores all members into corresponding fields | 28 // Stores all members into corresponding fields |
| 29 void set(const InternalDictionary&); | 29 void set(const InternalDictionary&); |
| 30 // Creates a TestDictionary instnace from fields and returns it | 30 // Sets each member of the given TestDictionary from fields |
| 31 InternalDictionary* get(); | 31 void get(InternalDictionary&); |
| 32 | 32 |
| 33 void trace(Visitor*); | 33 void trace(Visitor*); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 DictionaryTest(); | 36 DictionaryTest(); |
| 37 | 37 |
| 38 void reset(); | 38 void reset(); |
| 39 | 39 |
| 40 // The reason to use Nullable<T> is convenience; we use Nullable<T> here to | 40 // The reason to use Nullable<T> is convenience; we use Nullable<T> here to |
| 41 // record whether the member field is set or not. Some members are not | 41 // record whether the member field is set or not. Some members are not |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 String m_enumOrNullMember; | 57 String m_enumOrNullMember; |
| 58 RefPtrWillBeMember<Element> m_elementMember; | 58 RefPtrWillBeMember<Element> m_elementMember; |
| 59 RefPtrWillBeMember<Element> m_elementOrNullMember; | 59 RefPtrWillBeMember<Element> m_elementOrNullMember; |
| 60 ScriptValue m_objectMember; | 60 ScriptValue m_objectMember; |
| 61 ScriptValue m_objectOrNullMemberWithDefault; | 61 ScriptValue m_objectOrNullMemberWithDefault; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif // DictionaryTest_h | 66 #endif // DictionaryTest_h |
| OLD | NEW |