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

Unified Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 10083053: IndexedDB: Support get/getKey(keyRange) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address nits Created 8 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
Index: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index 38f94fa714fe58301fa3bf6b9e8dff83c893b2a2..4c5bee6ac0c998aaffb48139a5cb87d8c3cfaf2c 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -506,7 +506,10 @@ bool IndexedDBDispatcherHost::IndexDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenKeyCursor, OnOpenKeyCursor)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexCount, OnCount)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetObject, OnGetObject)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetObjectByRange,
+ OnGetObjectByRange)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetKey, OnGetKey)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetKeyByRange, OnGetKeyByRange)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexDestroyed, OnDestroyed)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -632,6 +635,28 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetObject(
idb_index->getObject(key, callbacks.release(), *idb_transaction, *ec);
}
+void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetObjectByRange(
+ int idb_index_id,
+ int32 thread_id,
+ int32 response_id,
+ const IndexedDBKeyRange& key_range,
+ int32 transaction_id,
+ WebKit::WebExceptionCode* ec) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
+ WebIDBIndex* idb_index = parent_->GetOrTerminateProcess(
+ &map_, idb_index_id);
+ WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess(
+ &parent_->transaction_dispatcher_host_->map_, transaction_id);
+ if (!idb_transaction || !idb_index)
+ return;
+
+ *ec = 0;
+ scoped_ptr<WebIDBCallbacks> callbacks(
+ new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, thread_id,
+ response_id));
+ idb_index->getObject(key_range, callbacks.release(), *idb_transaction, *ec);
+}
+
void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetKey(
int idb_index_id,
int32 thread_id,
@@ -653,6 +678,27 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetKey(
idb_index->getKey(key, callbacks.release(), *idb_transaction, *ec);
}
+void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetKeyByRange(
+ int idb_index_id,
+ int32 thread_id,
+ int32 response_id,
+ const IndexedDBKeyRange& key_range,
+ int32 transaction_id,
+ WebKit::WebExceptionCode* ec) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
+ WebIDBIndex* idb_index = parent_->GetOrTerminateProcess(
+ &map_, idb_index_id);
+ WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess(
+ &parent_->transaction_dispatcher_host_->map_, transaction_id);
+ if (!idb_transaction || !idb_index)
+ return;
+
+ *ec = 0;
+ scoped_ptr<WebIDBCallbacks> callbacks(
+ new IndexedDBCallbacks<WebIDBKey>(parent_, thread_id, response_id));
+ idb_index->getKey(key_range, callbacks.release(), *idb_transaction, *ec);
+}
+
void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed(
int32 object_id) {
parent_->DestroyObject(&map_, object_id);
@@ -681,6 +727,7 @@ bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGetByRange, OnGetByRange)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteRange, OnDeleteRange)
@@ -748,6 +795,28 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet(
idb_object_store->get(key, callbacks.release(), *idb_transaction, *ec);
}
+void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGetByRange(
+ int idb_object_store_id,
+ int32 thread_id,
+ int32 response_id,
+ const IndexedDBKeyRange& key_range,
+ int32 transaction_id,
+ WebKit::WebExceptionCode* ec) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
+ WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess(
+ &map_, idb_object_store_id);
+ WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess(
+ &parent_->transaction_dispatcher_host_->map_, transaction_id);
+ if (!idb_transaction || !idb_object_store)
+ return;
+
+ *ec = 0;
+ scoped_ptr<WebIDBCallbacks> callbacks(
+ new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, thread_id,
+ response_id));
+ idb_object_store->get(key_range, callbacks.release(), *idb_transaction, *ec);
+}
+
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut(
const IndexedDBHostMsg_ObjectStorePut_Params& params,
WebKit::WebExceptionCode* ec) {
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_dispatcher_host.h ('k') | content/common/indexed_db/indexed_db_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698