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

Unified Diff: base/values.h

Issue 2807953002: Use base::flat_map for base::Value dictionary storage. (Closed)
Patch Set: Swap Created 3 years, 8 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
« no previous file with comments | « base/json/json_parser.cc ('k') | base/values.cc » ('j') | base/values.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index e19eca761fdeabadb474b69e02b0e183ad01d327..9df4c6eac94aa380538d2b5d9bdc604d0c9a25bd 100644
--- a/base/values.h
+++ b/base/values.h
@@ -29,6 +29,7 @@
#include "base/base_export.h"
#include "base/compiler_specific.h"
+#include "base/containers/flat_map.h"
#include "base/macros.h"
#include "base/memory/manual_constructor.h"
#include "base/strings/string16.h"
@@ -48,7 +49,7 @@ using BinaryValue = Value;
// See the file-level comment above for more information.
class BASE_EXPORT Value {
public:
- using DictStorage = std::map<std::string, std::unique_ptr<Value>>;
+ using DictStorage = base::flat_map<std::string, std::unique_ptr<Value>>;
using ListStorage = std::vector<std::unique_ptr<Value>>;
enum class Type {
@@ -92,6 +93,8 @@ class BASE_EXPORT Value {
explicit Value(const string16& in_string);
explicit Value(StringPiece in_string);
+ explicit Value(DictStorage&& in_dict) noexcept;
jdoerrie 2017/04/10 11:44:57 nit: Consider moving this constructor down after t
+
explicit Value(const std::vector<char>& in_blob);
explicit Value(std::vector<char>&& in_blob) noexcept;
« no previous file with comments | « base/json/json_parser.cc ('k') | base/values.cc » ('j') | base/values.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698