| 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 #include "platform/inspector_protocol/Values.h" | 5 #include "platform/inspector_protocol/Values.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/Parser.h" | 7 #include "platform/inspector_protocol/Parser.h" |
| 8 #include "platform/inspector_protocol/String16.h" | 8 #include "platform/inspector_protocol/String16.h" |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 return std::make_pair(key, m_data.get(key)); | 252 return std::make_pair(key, m_data.get(key)); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool DictionaryValue::booleanProperty(const String16& name, bool defaultValue) c
onst | 255 bool DictionaryValue::booleanProperty(const String16& name, bool defaultValue) c
onst |
| 256 { | 256 { |
| 257 bool result = defaultValue; | 257 bool result = defaultValue; |
| 258 getBoolean(name, &result); | 258 getBoolean(name, &result); |
| 259 return result; | 259 return result; |
| 260 } | 260 } |
| 261 | 261 |
| 262 double DictionaryValue::numberProperty(const String16& name, double defaultValue
) const | |
| 263 { | |
| 264 double result = defaultValue; | |
| 265 getNumber(name, &result); | |
| 266 return result; | |
| 267 } | |
| 268 | |
| 269 void DictionaryValue::remove(const String16& name) | 262 void DictionaryValue::remove(const String16& name) |
| 270 { | 263 { |
| 271 m_data.remove(name); | 264 m_data.remove(name); |
| 272 for (size_t i = 0; i < m_order.size(); ++i) { | 265 for (size_t i = 0; i < m_order.size(); ++i) { |
| 273 if (m_order[i] == name) { | 266 if (m_order[i] == name) { |
| 274 m_order.remove(i); | 267 m_order.remove(i); |
| 275 break; | 268 break; |
| 276 } | 269 } |
| 277 } | 270 } |
| 278 } | 271 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 } | 337 } |
| 345 | 338 |
| 346 protocol::Value* ListValue::at(size_t index) | 339 protocol::Value* ListValue::at(size_t index) |
| 347 { | 340 { |
| 348 ASSERT_WITH_SECURITY_IMPLICATION(index < m_data.size()); | 341 ASSERT_WITH_SECURITY_IMPLICATION(index < m_data.size()); |
| 349 return m_data[index].get(); | 342 return m_data[index].get(); |
| 350 } | 343 } |
| 351 | 344 |
| 352 } // namespace protocol | 345 } // namespace protocol |
| 353 } // namespace blink | 346 } // namespace blink |
| OLD | NEW |