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

Unified Diff: content/common/indexed_db/indexed_db_messages.h

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
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/indexed_db_messages.h
diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h
index 047fd0ce488c851c7d819e3ce8b61e00c5d63744..365d12924bcc79c9302bcdc2c7312ae4e6d7de14 100644
--- a/content/common/indexed_db/indexed_db_messages.h
+++ b/content/common/indexed_db/indexed_db_messages.h
@@ -4,6 +4,7 @@
// Message definition file, included multiple times, hence no include guard.
+#include <utility>
#include <vector>
#include "content/common/indexed_db/indexed_db_key.h"
@@ -25,6 +26,9 @@ IPC_ENUM_TRAITS(blink::WebIDBDatabase::TaskType)
IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal)
+// An index id, and corresponding set of keys to insert.
+typedef std::pair<int64, std::vector<content::IndexedDBKey> > IndexKeys;
+
// Used to enumerate indexed databases.
IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params)
// The response should have these ids.
@@ -130,12 +134,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params)
IPC_STRUCT_MEMBER(content::IndexedDBKey, key)
// Whether this is an add or a put.
IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode)
- // The names of the indexes used below.
- IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
- // The keys for each index, such that each inner vector corresponds
- // to each index named in index_names, respectively.
- IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
- index_keys)
+ // The index ids and the list of keys for each index.
+ IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys)
IPC_STRUCT_END()
// Used to open both cursors and object cursors in IndexedDB.
@@ -201,11 +201,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseSetIndexKeys_Params)
IPC_STRUCT_MEMBER(int64, object_store_id)
// The object store key that we're setting index keys for.
IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key)
- // The indexes that we're setting keys on.
- IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
- // A list of index keys for each index.
- IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
- index_keys)
+ // The index ids and the list of keys for each index.
+ IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys)
IPC_STRUCT_END()
// Used to create an index.
@@ -504,4 +501,3 @@ IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit,
// WebIDBDatabase::~WebIDBCursor() message.
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed,
int32 /* ipc_cursor_id */)
-
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698