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

Unified Diff: mojo/public/cpp/bindings/lib/map_internal.h

Issue 1358353002: * Change C++ serialization/deserialization to not be move-only operations (with the except of |Ha… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: (*it).get() to it->, and other formatting Created 5 years, 3 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/lib/map_internal.h
diff --git a/mojo/public/cpp/bindings/lib/map_internal.h b/mojo/public/cpp/bindings/lib/map_internal.h
index 84f927c9918144fcd2c8bbca02874d94ab31b026..cf3f0d9c3eb295e7c10c6b28c4d7a9a97b822144 100644
--- a/mojo/public/cpp/bindings/lib/map_internal.h
+++ b/mojo/public/cpp/bindings/lib/map_internal.h
@@ -40,20 +40,6 @@ struct MapTraits<Key, Value, false> {
for (size_t i = 0; i < keys.size(); ++i)
Insert(m, keys[i], values[i]);
}
- static inline void Decompose(std::map<KeyStorageType, ValueStorageType>* m,
- mojo::Array<Key>* keys,
- mojo::Array<Value>* values) {
- keys->resize(m->size());
- values->resize(m->size());
- int i = 0;
- for (typename std::map<KeyStorageType, ValueStorageType>::iterator
- it = m->begin();
- it != m->end();
- ++it, ++i) {
- (*keys)[i] = it->first;
- (*values)[i] = it->second;
- }
- }
static inline void Finalize(std::map<KeyStorageType, ValueStorageType>* m) {}
static inline ValueRefType at(std::map<KeyStorageType, ValueStorageType>* m,
KeyForwardType key) {
@@ -133,20 +119,6 @@ struct MapTraits<Key, Value, true> {
for (size_t i = 0; i < keys.size(); ++i)
Insert(m, keys[i], values[i]);
}
- static inline void Decompose(std::map<KeyStorageType, ValueStorageType>* m,
- mojo::Array<Key>* keys,
- mojo::Array<Value>* values) {
- keys->resize(m->size());
- values->resize(m->size());
- int i = 0;
- for (typename std::map<KeyStorageType, ValueStorageType>::iterator
- it = m->begin();
- it != m->end();
- ++it, ++i) {
- (*keys)[i] = it->first;
- (*values)[i] = GetValue(it).Pass();
- }
- }
static inline void Finalize(std::map<KeyStorageType, ValueStorageType>* m) {
for (auto& pair : *m)
reinterpret_cast<Value*>(pair.second.buf)->~Value();
« no previous file with comments | « mojo/public/cpp/bindings/lib/control_message_proxy.cc ('k') | mojo/public/cpp/bindings/lib/map_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698