Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Values.h

Issue 2087953004: Switch v8 inspector to stl collections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually remove a value from the list Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/Values.h
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Values.h b/third_party/WebKit/Source/platform/inspector_protocol/Values.h
index e4a719286fb67d31c12567a787253fb8ac06f824..dc9afcf27aab1d6dc65e37874e05c2dd854aa73c 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Values.h
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Values.h
@@ -10,6 +10,8 @@
#include "platform/inspector_protocol/Platform.h"
#include "platform/inspector_protocol/String16.h"
+#include <vector>
+
namespace blink {
namespace protocol {
@@ -174,10 +176,20 @@ public:
private:
DictionaryValue();
+ template<typename T>
+ void set(const String16& key, std::unique_ptr<T>& value)
+ {
+ DCHECK(value);
+ bool isNew = m_data.find(key) == m_data.end();
+ m_data[key] = std::move(value);
+ if (isNew) {
dgozman 2016/06/24 17:01:12 style: redundant {}
eostroukhov-old 2016/06/24 22:24:25 Done.
+ m_order.push_back(key);
+ }
+ }
using Dictionary = protocol::HashMap<String16, std::unique_ptr<Value>>;
Dictionary m_data;
- protocol::Vector<String16> m_order;
+ std::vector<String16> m_order;
};
class PLATFORM_EXPORT ListValue : public Value {
@@ -211,7 +223,7 @@ public:
private:
ListValue();
- protocol::Vector<std::unique_ptr<Value>> m_data;
+ std::vector<std::unique_ptr<Value>> m_data;
};
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698