summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 02:21:40 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 02:21:40 +0000
commitc68defa840deedffbd0320e8680060c42655d3eb (patch)
tree3e7f633adeb8ae65dff137eb906bd4aa3df7a55a /content/common
parent852c9286792023f4bc9f7c50d0cc9f65bb36643d (diff)
downloadchromium_src-c68defa840deedffbd0320e8680060c42655d3eb.zip
chromium_src-c68defa840deedffbd0320e8680060c42655d3eb.tar.gz
chromium_src-c68defa840deedffbd0320e8680060c42655d3eb.tar.bz2
Use IndexedDBKeyRange type for IDB IPC.
Older IDB IPC messages broke key ranges down for transmission into two keys and two booleans. Now that there's a Chromium key range type, use it. BUG=none TEST=no new tests; no functional changes Review URL: http://codereview.chromium.org/10180012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/indexed_db/indexed_db_dispatcher.cc27
-rw-r--r--content/common/indexed_db/indexed_db_messages.h40
2 files changed, 13 insertions, 54 deletions
diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc
index cc5d18c..c7df049 100644
--- a/content/common/indexed_db/indexed_db_dispatcher.cc
+++ b/content/common/indexed_db/indexed_db_dispatcher.cc
@@ -312,10 +312,7 @@ void IndexedDBDispatcher::RequestIDBIndexOpenObjectCursor(
IndexedDBHostMsg_IndexOpenCursor_Params params;
params.thread_id = CurrentWorkerId();
params.response_id = pending_callbacks_.Add(callbacks.release());
- params.lower_key.Set(idb_key_range.lower());
- params.upper_key.Set(idb_key_range.upper());
- params.lower_open = idb_key_range.lowerOpen();
- params.upper_open = idb_key_range.upperOpen();
+ params.key_range = IndexedDBKeyRange(idb_key_range);
params.direction = direction;
params.idb_index_id = idb_index_id;
params.transaction_id = TransactionId(transaction);
@@ -336,12 +333,7 @@ void IndexedDBDispatcher::RequestIDBIndexOpenKeyCursor(
IndexedDBHostMsg_IndexOpenCursor_Params params;
params.thread_id = CurrentWorkerId();
params.response_id = pending_callbacks_.Add(callbacks.release());
- // TODO(jorlow): We really should just create a Chromium abstraction for
- // KeyRange rather than doing it ad-hoc like this.
- params.lower_key.Set(idb_key_range.lower());
- params.upper_key.Set(idb_key_range.upper());
- params.lower_open = idb_key_range.lowerOpen();
- params.upper_open = idb_key_range.upperOpen();
+ params.key_range = IndexedDBKeyRange(idb_key_range);
params.direction = direction;
params.idb_index_id = idb_index_id;
params.transaction_id = TransactionId(transaction);
@@ -361,10 +353,7 @@ void IndexedDBDispatcher::RequestIDBIndexCount(
IndexedDBHostMsg_IndexCount_Params params;
params.thread_id = CurrentWorkerId();
params.response_id = pending_callbacks_.Add(callbacks.release());
- params.lower_key.Set(idb_key_range.lower());
- params.upper_key.Set(idb_key_range.upper());
- params.lower_open = idb_key_range.lowerOpen();
- params.upper_open = idb_key_range.upperOpen();
+ params.key_range = IndexedDBKeyRange(idb_key_range);
params.idb_index_id = idb_index_id;
params.transaction_id = TransactionId(transaction);
Send(new IndexedDBHostMsg_IndexCount(params, ec));
@@ -512,10 +501,7 @@ void IndexedDBDispatcher::RequestIDBObjectStoreOpenCursor(
IndexedDBHostMsg_ObjectStoreOpenCursor_Params params;
params.thread_id = CurrentWorkerId();
params.response_id = pending_callbacks_.Add(callbacks.release());
- params.lower_key.Set(idb_key_range.lower());
- params.upper_key.Set(idb_key_range.upper());
- params.lower_open = idb_key_range.lowerOpen();
- params.upper_open = idb_key_range.upperOpen();
+ params.key_range = IndexedDBKeyRange(idb_key_range);
params.direction = direction;
params.idb_object_store_id = idb_object_store_id;
params.transaction_id = TransactionId(transaction);
@@ -535,10 +521,7 @@ void IndexedDBDispatcher::RequestIDBObjectStoreCount(
IndexedDBHostMsg_ObjectStoreCount_Params params;
params.thread_id = CurrentWorkerId();
params.response_id = pending_callbacks_.Add(callbacks.release());
- params.lower_key.Set(idb_key_range.lower());
- params.upper_key.Set(idb_key_range.upper());
- params.lower_open = idb_key_range.lowerOpen();
- params.upper_open = idb_key_range.upperOpen();
+ params.key_range = IndexedDBKeyRange(idb_key_range);
params.idb_object_store_id = idb_object_store_id;
params.transaction_id = TransactionId(transaction);
Send(new IndexedDBHostMsg_ObjectStoreCount(params, ec));
diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h
index b9d294bb..3f0ec5c 100644
--- a/content/common/indexed_db/indexed_db_messages.h
+++ b/content/common/indexed_db/indexed_db_messages.h
@@ -71,14 +71,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexOpenCursor_Params)
// The response should have these ids.
IPC_STRUCT_MEMBER(int32, thread_id)
IPC_STRUCT_MEMBER(int32, response_id)
- // The serialized lower key.
- IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
- // The serialized upper key.
- IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
- // Is the lower bound open?
- IPC_STRUCT_MEMBER(bool, lower_open)
- // Is the upper bound open?
- IPC_STRUCT_MEMBER(bool, upper_open)
+ // The serialized key range.
+ IPC_STRUCT_MEMBER(IndexedDBKeyRange, key_range)
// The direction of this cursor.
IPC_STRUCT_MEMBER(int32, direction)
// The index the index belongs to.
@@ -92,14 +86,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexCount_Params)
// The response should have these ids.
IPC_STRUCT_MEMBER(int32, thread_id)
IPC_STRUCT_MEMBER(int32, response_id)
- // The serialized lower key.
- IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
- // The serialized upper key.
- IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
- // Is the lower bound open?
- IPC_STRUCT_MEMBER(bool, lower_open)
- // Is the upper bound open?
- IPC_STRUCT_MEMBER(bool, upper_open)
+ // The serialized key range.
+ IPC_STRUCT_MEMBER(IndexedDBKeyRange, key_range)
// The index the index belongs to.
IPC_STRUCT_MEMBER(int32, idb_index_id)
// The transaction this request belongs to.
@@ -144,14 +132,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreOpenCursor_Params)
// The response should have these ids.
IPC_STRUCT_MEMBER(int32, thread_id)
IPC_STRUCT_MEMBER(int32, response_id)
- // The serialized lower key.
- IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
- // The serialized upper key.
- IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
- // Is the lower bound open?
- IPC_STRUCT_MEMBER(bool, lower_open)
- // Is the upper bound open?
- IPC_STRUCT_MEMBER(bool, upper_open)
+ // The serialized key range.
+ IPC_STRUCT_MEMBER(IndexedDBKeyRange, key_range)
// The direction of this cursor.
IPC_STRUCT_MEMBER(int32, direction)
// The object store the cursor belongs to.
@@ -193,14 +175,8 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreCount_Params)
// The response should have these ids.
IPC_STRUCT_MEMBER(int32, thread_id)
IPC_STRUCT_MEMBER(int32, response_id)
- // The serialized lower key.
- IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
- // The serialized upper key.
- IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
- // Is the lower bound open?
- IPC_STRUCT_MEMBER(bool, lower_open)
- // Is the upper bound open?
- IPC_STRUCT_MEMBER(bool, upper_open)
+ // The serialized key range.
+ IPC_STRUCT_MEMBER(IndexedDBKeyRange, key_range)
// The object store the cursor belongs to.
IPC_STRUCT_MEMBER(int32, idb_object_store_id)
// The transaction this request belongs to.