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

Unified Diff: base/values.h

Issue 2807953002: Use base::flat_map for base::Value dictionary storage. (Closed)
Patch Set: Fix 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') | no next file with comments »
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..9509c95f609078562fcc32ee87583f579c7c064c 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 {
@@ -95,6 +96,8 @@ class BASE_EXPORT Value {
explicit Value(const std::vector<char>& in_blob);
explicit Value(std::vector<char>&& in_blob) noexcept;
+ explicit Value(DictStorage&& in_dict) noexcept;
+
Value& operator=(const Value& that);
Value& operator=(Value&& that) noexcept;
« no previous file with comments | « base/json/json_parser.cc ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698