| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Values_h | 5 #ifndef Values_h |
| 6 #define Values_h | 6 #define Values_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/inspector_protocol/Allocator.h" | 9 #include "platform/inspector_protocol/Allocator.h" |
| 10 #include "wtf/HashMap.h" | 10 #include "platform/inspector_protocol/Collections.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 #include "wtf/TypeTraits.h" | |
| 13 #include "wtf/Vector.h" | |
| 14 #include "wtf/text/StringHash.h" | 12 #include "wtf/text/StringHash.h" |
| 15 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 16 | 14 |
| 17 namespace blink { | 15 namespace blink { |
| 18 namespace protocol { | 16 namespace protocol { |
| 19 | 17 |
| 20 class ListValue; | 18 class ListValue; |
| 21 class DictionaryValue; | 19 class DictionaryValue; |
| 22 class Value; | 20 class Value; |
| 23 | 21 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 Entry at(size_t index) const; | 169 Entry at(size_t index) const; |
| 172 | 170 |
| 173 bool booleanProperty(const String& name, bool defaultValue) const; | 171 bool booleanProperty(const String& name, bool defaultValue) const; |
| 174 void remove(const String& name); | 172 void remove(const String& name); |
| 175 | 173 |
| 176 ~DictionaryValue() override; | 174 ~DictionaryValue() override; |
| 177 | 175 |
| 178 private: | 176 private: |
| 179 DictionaryValue(); | 177 DictionaryValue(); |
| 180 | 178 |
| 181 using Dictionary = HashMap<String, OwnPtr<Value>>; | 179 using Dictionary = protocol::HashMap<String, OwnPtr<Value>>; |
| 182 Dictionary m_data; | 180 Dictionary m_data; |
| 183 Vector<String> m_order; | 181 protocol::Vector<String> m_order; |
| 184 }; | 182 }; |
| 185 | 183 |
| 186 class PLATFORM_EXPORT ListValue : public Value { | 184 class PLATFORM_EXPORT ListValue : public Value { |
| 187 public: | 185 public: |
| 188 static PassOwnPtr<ListValue> create() | 186 static PassOwnPtr<ListValue> create() |
| 189 { | 187 { |
| 190 return adoptPtr(new ListValue()); | 188 return adoptPtr(new ListValue()); |
| 191 } | 189 } |
| 192 | 190 |
| 193 static ListValue* cast(Value* value) | 191 static ListValue* cast(Value* value) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 207 void writeJSON(StringBuilder* output) const override; | 205 void writeJSON(StringBuilder* output) const override; |
| 208 PassOwnPtr<Value> clone() const override; | 206 PassOwnPtr<Value> clone() const override; |
| 209 | 207 |
| 210 void pushValue(PassOwnPtr<Value>); | 208 void pushValue(PassOwnPtr<Value>); |
| 211 | 209 |
| 212 Value* at(size_t index); | 210 Value* at(size_t index); |
| 213 size_t size() const { return m_data.size(); } | 211 size_t size() const { return m_data.size(); } |
| 214 | 212 |
| 215 private: | 213 private: |
| 216 ListValue(); | 214 ListValue(); |
| 217 Vector<OwnPtr<Value>> m_data; | 215 protocol::Vector<OwnPtr<Value>> m_data; |
| 218 }; | 216 }; |
| 219 | 217 |
| 220 } // namespace protocol | 218 } // namespace protocol |
| 221 } // namespace blink | 219 } // namespace blink |
| 222 | 220 |
| 223 #endif // Values_h | 221 #endif // Values_h |
| OLD | NEW |