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

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

Issue 646773005: mojo: Switch the clipboard interface over to using map<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. Created 6 years, 2 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: mojo/public/cpp/bindings/map.h
diff --git a/mojo/public/cpp/bindings/map.h b/mojo/public/cpp/bindings/map.h
index f09937a40046c98e9b5f2f1cb5e684191957af6b..f68d074dea77f544e4cb3c2696da33bd940988c1 100644
--- a/mojo/public/cpp/bindings/map.h
+++ b/mojo/public/cpp/bindings/map.h
@@ -88,6 +88,10 @@ class Map {
return Traits::at(&map_, key);
}
+ ValueRefType operator[](KeyForwardType key) {
+ return Traits::GetOrInsert(&map_, key);
+ }
+
void Swap(Map<Key, Value>* other) {
std::swap(is_null_, other->is_null_);
map_.swap(other->map_);

Powered by Google App Engine
This is Rietveld 408576698