diff options
Diffstat (limited to 'content/renderer/indexed_db_dispatcher.cc')
-rw-r--r-- | content/renderer/indexed_db_dispatcher.cc | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc index 915275f..8b3ddda 100644 --- a/content/renderer/indexed_db_dispatcher.cc +++ b/content/renderer/indexed_db_dispatcher.cc @@ -65,6 +65,10 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { return handled; } +void IndexedDBDispatcher::Send(IPC::Message* msg) { + ChildThread::current()->Send(msg); +} + void IndexedDBDispatcher::RequestIDBCursorUpdate( const content::SerializedScriptValue& value, WebIDBCallbacks* callbacks_ptr, @@ -73,7 +77,7 @@ void IndexedDBDispatcher::RequestIDBCursorUpdate( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( + Send( new IndexedDBHostMsg_CursorUpdate(idb_cursor_id, response_id, value, ec)); if (*ec) pending_callbacks_.Remove(response_id); @@ -87,7 +91,7 @@ void IndexedDBDispatcher::RequestIDBCursorContinue( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( + Send( new IndexedDBHostMsg_CursorContinue(idb_cursor_id, response_id, key, ec)); if (*ec) pending_callbacks_.Remove(response_id); @@ -100,8 +104,7 @@ void IndexedDBDispatcher::RequestIDBCursorDelete( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_CursorDelete(idb_cursor_id, response_id, ec)); + Send(new IndexedDBHostMsg_CursorDelete(idb_cursor_id, response_id, ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -123,7 +126,7 @@ void IndexedDBDispatcher::RequestIDBFactoryOpen( params.response_id = pending_callbacks_.Add(callbacks.release()); params.origin = origin; params.name = name; - RenderThreadImpl::current()->Send(new IndexedDBHostMsg_FactoryOpen(params)); + Send(new IndexedDBHostMsg_FactoryOpen(params)); } void IndexedDBDispatcher::RequestIDBFactoryGetDatabaseNames( @@ -141,8 +144,7 @@ void IndexedDBDispatcher::RequestIDBFactoryGetDatabaseNames( IndexedDBHostMsg_FactoryGetDatabaseNames_Params params; params.response_id = pending_callbacks_.Add(callbacks.release()); params.origin = origin; - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_FactoryGetDatabaseNames(params)); + Send(new IndexedDBHostMsg_FactoryGetDatabaseNames(params)); } void IndexedDBDispatcher::RequestIDBFactoryDeleteDatabase( @@ -162,24 +164,21 @@ void IndexedDBDispatcher::RequestIDBFactoryDeleteDatabase( params.response_id = pending_callbacks_.Add(callbacks.release()); params.origin = origin; params.name = name; - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_FactoryDeleteDatabase(params)); + Send(new IndexedDBHostMsg_FactoryDeleteDatabase(params)); } void IndexedDBDispatcher::RequestIDBDatabaseClose(int32 idb_database_id) { - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_DatabaseClose(idb_database_id)); + Send(new IndexedDBHostMsg_DatabaseClose(idb_database_id)); pending_database_callbacks_.Remove(idb_database_id); } - void IndexedDBDispatcher::RequestIDBDatabaseOpen( +void IndexedDBDispatcher::RequestIDBDatabaseOpen( WebIDBDatabaseCallbacks* callbacks_ptr, int32 idb_database_id) { scoped_ptr<WebIDBDatabaseCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_database_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send(new IndexedDBHostMsg_DatabaseOpen( - response_id, idb_database_id)); + Send(new IndexedDBHostMsg_DatabaseOpen(response_id, idb_database_id)); } void IndexedDBDispatcher::RequestIDBDatabaseSetVersion( @@ -190,9 +189,8 @@ void IndexedDBDispatcher::RequestIDBDatabaseSetVersion( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_DatabaseSetVersion(idb_database_id, response_id, - version, ec)); + Send(new IndexedDBHostMsg_DatabaseSetVersion(idb_database_id, response_id, + version, ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -214,8 +212,7 @@ void IndexedDBDispatcher::RequestIDBIndexOpenObjectCursor( params.direction = direction; params.idb_index_id = idb_index_id; params.transaction_id = TransactionId(transaction); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_IndexOpenObjectCursor(params, ec)); + Send(new IndexedDBHostMsg_IndexOpenObjectCursor(params, ec)); if (*ec) pending_callbacks_.Remove(params.response_id); } @@ -239,8 +236,7 @@ void IndexedDBDispatcher::RequestIDBIndexOpenKeyCursor( params.direction = direction; params.idb_index_id = idb_index_id; params.transaction_id = TransactionId(transaction); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_IndexOpenKeyCursor(params, ec)); + Send(new IndexedDBHostMsg_IndexOpenKeyCursor(params, ec)); if (*ec) pending_callbacks_.Remove(params.response_id); } @@ -253,10 +249,8 @@ void IndexedDBDispatcher::RequestIDBIndexGetObject( WebExceptionCode* ec) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_IndexGetObject( - idb_index_id, response_id, key, - TransactionId(transaction), ec)); + Send(new IndexedDBHostMsg_IndexGetObject(idb_index_id, response_id, key, + TransactionId(transaction), ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -269,10 +263,9 @@ void IndexedDBDispatcher::RequestIDBIndexGetKey( WebExceptionCode* ec) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_IndexGetKey( - idb_index_id, response_id, key, - TransactionId(transaction), ec)); + Send(new IndexedDBHostMsg_IndexGetKey( + idb_index_id, response_id, key, + TransactionId(transaction), ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -286,10 +279,9 @@ void IndexedDBDispatcher::RequestIDBObjectStoreGet( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_ObjectStoreGet( - idb_object_store_id, response_id, - key, TransactionId(transaction), ec)); + Send(new IndexedDBHostMsg_ObjectStoreGet( + idb_object_store_id, response_id, + key, TransactionId(transaction), ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -310,8 +302,7 @@ void IndexedDBDispatcher::RequestIDBObjectStorePut( params.key = key; params.put_mode = put_mode; params.transaction_id = TransactionId(transaction); - RenderThreadImpl::current()->Send(new IndexedDBHostMsg_ObjectStorePut( - params, ec)); + Send(new IndexedDBHostMsg_ObjectStorePut(params, ec)); if (*ec) pending_callbacks_.Remove(params.response_id); } @@ -325,10 +316,8 @@ void IndexedDBDispatcher::RequestIDBObjectStoreDelete( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_ObjectStoreDelete( - idb_object_store_id, response_id, - key, TransactionId(transaction), ec)); + Send(new IndexedDBHostMsg_ObjectStoreDelete( + idb_object_store_id, response_id, key, TransactionId(transaction), ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -341,10 +330,8 @@ void IndexedDBDispatcher::RequestIDBObjectStoreClear( scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); int32 response_id = pending_callbacks_.Add(callbacks.release()); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_ObjectStoreClear( - idb_object_store_id, response_id, - TransactionId(transaction), ec)); + Send(new IndexedDBHostMsg_ObjectStoreClear( + idb_object_store_id, response_id, TransactionId(transaction), ec)); if (*ec) pending_callbacks_.Remove(response_id); } @@ -366,8 +353,7 @@ void IndexedDBDispatcher::RequestIDBObjectStoreOpenCursor( params.direction = direction; params.idb_object_store_id = idb_object_store_id; params.transaction_id = TransactionId(transaction); - RenderThreadImpl::current()->Send( - new IndexedDBHostMsg_ObjectStoreOpenCursor(params, ec)); + Send(new IndexedDBHostMsg_ObjectStoreOpenCursor(params, ec)); if (*ec) pending_callbacks_.Remove(params.response_id); } |