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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher.cc

Issue 138703002: IndexedDB: Replace passing identically-sized vectors with pairs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 6 years, 11 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: content/child/indexed_db/indexed_db_dispatcher.cc
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index d2de316656853bb10c659f3ebb26f31873547ead..1903ac66e13b1b0227f59db7657caaac83d62a1e 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -4,6 +4,8 @@
#include "content/child/indexed_db/indexed_db_dispatcher.h"
+#include <utility>
+
#include "base/format_macros.h"
#include "base/lazy_instance.h"
#include "base/strings/stringprintf.h"
@@ -346,19 +348,17 @@ void IndexedDBDispatcher::RequestIDBDatabasePut(
params.key = key;
params.put_mode = put_mode;
- COMPILE_ASSERT(sizeof(params.index_ids[0]) == sizeof(index_ids[0]),
- Cant_copy);
- params.index_ids
- .assign(index_ids.data(), index_ids.data() + index_ids.size());
-
- params.index_keys.resize(index_keys.size());
- for (size_t i = 0; i < index_keys.size(); ++i) {
- params.index_keys[i].resize(index_keys[i].size());
+ DCHECK_EQ(index_ids.size(), index_keys.size());
+ params.index_keys.resize(index_ids.size());
+ for (size_t i = 0, len = index_ids.size(); i < len; ++i) {
+ params.index_keys[i].first = index_ids[i];
+ params.index_keys[i].second.resize(index_keys[i].size());
for (size_t j = 0; j < index_keys[i].size(); ++j) {
- params.index_keys[i][j] =
+ params.index_keys[i].second[j] =
IndexedDBKey(IndexedDBKeyBuilder::Build(index_keys[i][j]));
}
}
+
Send(new IndexedDBHostMsg_DatabasePut(params));
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_index_writer.cc ('k') | content/child/indexed_db/webidbdatabase_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698