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

Unified Diff: mojo/public/cpp/bindings/map.h

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 years, 5 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 | « mojo/public/cpp/bindings/lib/wtf_serialization.h ('k') | mojo/public/cpp/bindings/map_traits_stl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/map.h
diff --git a/mojo/public/cpp/bindings/map.h b/mojo/public/cpp/bindings/map.h
index 8fa3d6708dd13241d32014c7f64697e850371f21..d4c79525ee83c47ce9749fbab68bf9781c4dab3e 100644
--- a/mojo/public/cpp/bindings/map.h
+++ b/mojo/public/cpp/bindings/map.h
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <map>
+#include <unordered_map>
#include <utility>
#include "base/logging.h"
@@ -135,14 +136,13 @@ class Map {
const std::map<Key, Value>& storage() const { return map_; }
// Passes the underlying storage and resets this map to null.
- //
- // TODO(yzshen): Consider changing this to a rvalue-ref-qualified conversion
- // to std::map<Key, Value> after we move to MSVC 2015.
std::map<Key, Value> PassStorage() {
is_null_ = true;
return std::move(map_);
}
+ operator const std::map<Key, Value>&() const { return map_; }
+
// Swaps the contents of this Map with another Map of the same type (including
// nullness).
void Swap(Map<Key, Value>* other) {
« no previous file with comments | « mojo/public/cpp/bindings/lib/wtf_serialization.h ('k') | mojo/public/cpp/bindings/map_traits_stl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698