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

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

Issue 1837883003: Some fleshing out the mojo based localstorage implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « content/renderer/dom_storage/local_storage_cached_area.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/array.h
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h
index f522faab532a4d5d6276098cfc8fd907835b0471..e9bd6838412e94fcd927f58637e98e1faa44d66f 100644
--- a/mojo/public/cpp/bindings/array.h
+++ b/mojo/public/cpp/bindings/array.h
@@ -295,6 +295,16 @@ struct TypeConverter<std::set<E>, Array<T>> {
}
};
+// Less than operator to allow Arrays as keys in std maps and sets.
+template <typename T>
+inline bool operator<(const Array<T>& a, const Array<T>& b) {
+ if (a.is_null())
+ return !b.is_null();
+ if (b.is_null())
+ return false;
+ return a.storage() < b.storage();
+}
+
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_
« no previous file with comments | « content/renderer/dom_storage/local_storage_cached_area.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698