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 a4ec82d52528ac436577342885182675f248da76..df5314921d214c4b77ffe755cc3d8be6205fee8b 100644 |
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc |
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc |
@@ -28,9 +28,7 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBIndex.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h" |
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
#include "webkit/base/file_path_string_conversions.h" |
@@ -67,10 +65,6 @@ IndexedDBDispatcherHost::IndexedDBDispatcherHost( |
: indexed_db_context_(indexed_db_context), |
ALLOW_THIS_IN_INITIALIZER_LIST(database_dispatcher_host_( |
new DatabaseDispatcherHost(this))), |
- ALLOW_THIS_IN_INITIALIZER_LIST(index_dispatcher_host_( |
- new IndexDispatcherHost(this))), |
- ALLOW_THIS_IN_INITIALIZER_LIST(object_store_dispatcher_host_( |
- new ObjectStoreDispatcherHost(this))), |
ALLOW_THIS_IN_INITIALIZER_LIST(cursor_dispatcher_host_( |
new CursorDispatcherHost(this))), |
ALLOW_THIS_IN_INITIALIZER_LIST(transaction_dispatcher_host_( |
@@ -102,8 +96,6 @@ void IndexedDBDispatcherHost::ResetDispatcherHosts() { |
CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); |
database_dispatcher_host_.reset(); |
- index_dispatcher_host_.reset(); |
- object_store_dispatcher_host_.reset(); |
cursor_dispatcher_host_.reset(); |
transaction_dispatcher_host_.reset(); |
} |
@@ -124,9 +116,6 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, |
bool handled = |
database_dispatcher_host_->OnMessageReceived(message, message_was_ok) || |
- index_dispatcher_host_->OnMessageReceived(message, message_was_ok) || |
- object_store_dispatcher_host_->OnMessageReceived( |
- message, message_was_ok) || |
cursor_dispatcher_host_->OnMessageReceived(message, message_was_ok) || |
transaction_dispatcher_host_->OnMessageReceived(message, message_was_ok); |
@@ -136,7 +125,6 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryGetDatabaseNames, |
OnIDBFactoryGetDatabaseNames) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpen, OnIDBFactoryOpen) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpenOld, OnIDBFactoryOpenOld) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryDeleteDatabase, |
OnIDBFactoryDeleteDatabase) |
IPC_MESSAGE_UNHANDLED(handled = false) |
@@ -166,26 +154,6 @@ int32 IndexedDBDispatcherHost::Add(WebIDBDatabase* idb_database, |
return ipc_database_id; |
} |
-int32 IndexedDBDispatcherHost::Add(WebIDBIndex* idb_index) { |
- if (!index_dispatcher_host_.get()) { |
- delete idb_index; |
- return 0; |
- } |
- if (!idb_index) |
- return 0; |
- return index_dispatcher_host_->map_.Add(idb_index); |
-} |
- |
-int32 IndexedDBDispatcherHost::Add(WebIDBObjectStore* idb_object_store) { |
- if (!object_store_dispatcher_host_.get()) { |
- delete idb_object_store; |
- return 0; |
- } |
- if (!idb_object_store) |
- return 0; |
- return object_store_dispatcher_host_->map_.Add(idb_object_store); |
-} |
- |
int32 IndexedDBDispatcherHost::Add(WebIDBTransaction* idb_transaction, |
int32 ipc_thread_id, |
const GURL& url) { |
@@ -232,29 +200,6 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( |
webkit_base::FilePathToWebString(indexed_db_path)); |
} |
-void IndexedDBDispatcherHost::OnIDBFactoryOpenOld( |
- const IndexedDBHostMsg_FactoryOpen_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- FilePath indexed_db_path = indexed_db_context_->data_path(); |
- |
- GURL origin_url = DatabaseUtil::GetOriginFromIdentifier(params.origin); |
- WebSecurityOrigin origin( |
- WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); |
- |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- |
- // TODO(dgrogan): Don't let a non-existing database be opened (and therefore |
- // created) if this origin is already over quota. |
- Context()->GetIDBFactory()->open( |
- params.name, |
- params.version, |
- new IndexedDBCallbacksDatabase(this, params.ipc_thread_id, |
- params.ipc_response_id, origin_url), |
- new IndexedDBDatabaseCallbacks(this, params.ipc_thread_id, |
- params.ipc_database_response_id), |
- origin, NULL, webkit_base::FilePathToWebString(indexed_db_path)); |
-} |
- |
void IndexedDBDispatcherHost::OnIDBFactoryOpen( |
const IndexedDBHostMsg_FactoryOpen_Params& params) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
@@ -353,14 +298,10 @@ bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::DatabaseDispatcherHost, |
message, *msg_is_ok) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseMetadata, OnMetadata) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateObjectStoreOld, |
- OnCreateObjectStoreOld) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateObjectStore, |
OnCreateObjectStore) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStore, |
OnDeleteObjectStore) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStoreOld, |
- OnDeleteObjectStoreOld) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateTransaction, |
OnCreateTransaction) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClose, OnClose) |
@@ -428,28 +369,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMetadata( |
} |
} |
-void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStoreOld( |
- const IndexedDBHostMsg_DatabaseCreateObjectStoreOld_Params& params, |
- int32* object_store_id, WebKit::WebExceptionCode* ec) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_database_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_database || !idb_transaction) |
- return; |
- |
- *ec = 0; |
- WebIDBObjectStore* object_store = idb_database->createObjectStore( |
- params.id, params.name, params.key_path, params.auto_increment, |
- *idb_transaction, *ec); |
- *object_store_id = *ec ? 0 : parent_->Add(object_store); |
- if (parent_->Context()->IsOverQuota( |
- database_url_map_[params.ipc_database_id])) { |
- idb_transaction->abort(); |
- } |
-} |
- |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( |
const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
@@ -468,23 +387,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( |
} |
} |
-void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteObjectStoreOld( |
- int32 ipc_database_id, |
- int64 object_store_id, |
- int32 ipc_transaction_id, |
- WebKit::WebExceptionCode* ec) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
- &map_, ipc_database_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_database || !idb_transaction) |
- return; |
- |
- *ec = 0; |
- idb_database->deleteObjectStore(object_store_id, *idb_transaction, *ec); |
-} |
- |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteObjectStore( |
int32 ipc_database_id, |
int64 transaction_id, |
@@ -727,419 +629,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteIndex( |
object_store_id, index_id); |
} |
- |
-////////////////////////////////////////////////////////////////////// |
-// IndexedDBDispatcherHost::IndexDispatcherHost |
-// |
- |
-IndexedDBDispatcherHost::IndexDispatcherHost::IndexDispatcherHost( |
- IndexedDBDispatcherHost* parent) |
- : parent_(parent) { |
- map_.set_check_on_null_data(true); |
-} |
- |
-IndexedDBDispatcherHost::IndexDispatcherHost::~IndexDispatcherHost() { |
-} |
- |
-bool IndexedDBDispatcherHost::IndexDispatcherHost::OnMessageReceived( |
- const IPC::Message& message, bool* msg_is_ok) { |
- bool handled = true; |
- IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::IndexDispatcherHost, |
- message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenObjectCursor, |
- OnOpenObjectCursor) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenKeyCursor, OnOpenKeyCursor) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexCount, OnCount) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetObject, OnGetObject) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetKey, OnGetKey) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexDestroyed, OnDestroyed) |
- IPC_MESSAGE_UNHANDLED(handled = false) |
- IPC_END_MESSAGE_MAP() |
- return handled; |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::Send( |
- IPC::Message* message) { |
- parent_->Send(message); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor( |
- const IndexedDBHostMsg_IndexOpenCursor_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_index_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_index) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.ipc_thread_id, |
- params.ipc_response_id, -1)); |
- idb_index->openObjectCursor( |
- params.key_range, params.direction, callbacks.release(), |
- *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenKeyCursor( |
- const IndexedDBHostMsg_IndexOpenCursor_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_index_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_index) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.ipc_thread_id, |
- params.ipc_response_id, -1)); |
- idb_index->openKeyCursor( |
- params.key_range, params.direction, callbacks.release(), |
- *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnCount( |
- const IndexedDBHostMsg_IndexCount_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_index_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_index) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, |
- params.ipc_thread_id, |
- params.ipc_response_id)); |
- idb_index->count( |
- params.key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetObject( |
- int ipc_index_id, |
- int32 ipc_thread_id, |
- int32 ipc_response_id, |
- const IndexedDBKeyRange& key_range, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, ipc_index_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_index) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, ipc_thread_id, |
- ipc_response_id)); |
- idb_index->getObject(key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetKey( |
- int ipc_index_id, |
- int32 ipc_thread_id, |
- int32 ipc_response_id, |
- const IndexedDBKeyRange& key_range, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, ipc_index_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_index) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBKey>(parent_, ipc_thread_id, |
- ipc_response_id)); |
- idb_index->getKey(key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed( |
- int32 ipc_object_id) { |
- parent_->DestroyObject(&map_, ipc_object_id); |
-} |
- |
-////////////////////////////////////////////////////////////////////// |
-// IndexedDBDispatcherHost::ObjectStoreDispatcherHost |
-// |
- |
-IndexedDBDispatcherHost::ObjectStoreDispatcherHost::ObjectStoreDispatcherHost( |
- IndexedDBDispatcherHost* parent) |
- : parent_(parent) { |
- map_.set_check_on_null_data(true); |
-} |
- |
-IndexedDBDispatcherHost:: |
-ObjectStoreDispatcherHost::~ObjectStoreDispatcherHost() { |
-} |
- |
-bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( |
- const IPC::Message& message, bool* msg_is_ok) { |
- bool handled = true; |
- IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, |
- message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexKeys, |
- OnSetIndexKeys) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexesReady, |
- OnSetIndexesReady) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreClear, OnClear) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCreateIndex, OnCreateIndex) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndex, OnIndex) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteIndex, OnDeleteIndex) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreOpenCursor, OnOpenCursor) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCount, OnCount) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDestroyed, OnDestroyed) |
- IPC_MESSAGE_UNHANDLED(handled = false) |
- IPC_END_MESSAGE_MAP() |
- return handled; |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::Send( |
- IPC::Message* message) { |
- parent_->Send(message); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( |
- int ipc_object_store_id, |
- int32 ipc_thread_id, |
- int32 ipc_response_id, |
- const IndexedDBKeyRange& key_range, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, ipc_thread_id, |
- ipc_response_id)); |
- idb_object_store->get(key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( |
- const IndexedDBHostMsg_ObjectStorePut_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBKey>(parent_, params.ipc_thread_id, |
- params.ipc_response_id)); |
- idb_object_store->put(params.serialized_value, params.key, |
- params.put_mode, callbacks.release(), |
- *idb_transaction, params.index_ids, |
- params.index_keys); |
- int64 size = UTF16ToUTF8(params.serialized_value.data()).size(); |
- WebIDBTransactionIPCIDToSizeMap* map = |
- &parent_->transaction_dispatcher_host_->transaction_ipc_size_map_; |
- (*map)[params.ipc_transaction_id] += size; |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexKeys( |
- int32 ipc_object_store_id, |
- const IndexedDBKey& primary_key, |
- const std::vector<int64>& index_names, |
- const std::vector<std::vector<IndexedDBKey> >& index_keys, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- idb_object_store->setIndexKeys(primary_key, |
- WebVector<long long>(index_names), |
- index_keys, *idb_transaction); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexesReady( |
- int32 ipc_object_store_id, |
- const std::vector<int64>& index_ids, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- idb_object_store->setIndexesReady(WebVector<long long>(index_ids), |
- *idb_transaction); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDelete( |
- int ipc_object_store_id, |
- int32 ipc_thread_id, |
- int32 ipc_response_id, |
- const IndexedDBKeyRange& key_range, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, ipc_thread_id, |
- ipc_response_id)); |
- idb_object_store->deleteFunction( |
- key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear( |
- int ipc_object_store_id, |
- int32 ipc_thread_id, |
- int32 ipc_response_id, |
- int32 ipc_transaction_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, ipc_thread_id, |
- ipc_response_id)); |
- idb_object_store->clear(callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( |
- const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, |
- int32* index_id, WebKit::WebExceptionCode* ec) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, params.ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_object_store || !idb_transaction) |
- return; |
- |
- *ec = 0; |
- WebIDBIndex* index = idb_object_store->createIndex( |
- params.id, params.name, params.key_path, params.unique, |
- params.multi_entry, *idb_transaction, *ec); |
- *index_id = *ec ? 0 : parent_->Add(index); |
- WebIDBObjectIDToURLMap* transaction_url_map = |
- &parent_->transaction_dispatcher_host_->transaction_url_map_; |
- if (parent_->Context()->IsOverQuota( |
- (*transaction_url_map)[params.ipc_transaction_id])) { |
- idb_transaction->abort(); |
- } |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndex( |
- int32 ipc_object_store_id, |
- int64 index_id, |
- int32* ipc_index_id) { |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- if (!idb_object_store) |
- return; |
- |
- WebIDBIndex* index = idb_object_store->index(index_id); |
- *ipc_index_id = parent_->Add(index); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDeleteIndex( |
- int32 ipc_object_store_id, |
- int64 index_id, |
- int32 ipc_transaction_id, |
- WebKit::WebExceptionCode* ec) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, ipc_transaction_id); |
- if (!idb_object_store || !idb_transaction) |
- return; |
- |
- *ec = 0; |
- idb_object_store->deleteIndex(index_id, *idb_transaction, *ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor( |
- const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &parent_->object_store_dispatcher_host_->map_, |
- params.ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.ipc_thread_id, |
- params.ipc_response_id, -1)); |
- idb_object_store->openCursor( |
- params.key_range, params.direction, callbacks.release(), |
- params.task_type, |
- *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCount( |
- const IndexedDBHostMsg_ObjectStoreCount_Params& params) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
- WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &parent_->object_store_dispatcher_host_->map_, |
- params.ipc_object_store_id); |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.ipc_transaction_id); |
- if (!idb_transaction || !idb_object_store) |
- return; |
- |
- WebKit::WebExceptionCode ec = 0; |
- scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, |
- params.ipc_thread_id, |
- params.ipc_response_id)); |
- idb_object_store->count( |
- params.key_range, callbacks.release(), *idb_transaction, ec); |
- DCHECK(!ec); |
-} |
- |
-void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed( |
- int32 ipc_object_id) { |
- parent_->DestroyObject(&map_, ipc_object_id); |
-} |
- |
////////////////////////////////////////////////////////////////////// |
// IndexedDBDispatcherHost::CursorDispatcherHost |
// |
@@ -1294,7 +783,6 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( |
message, *msg_is_ok) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) |
- IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, |
OnDidCompleteTaskEvents) |
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDestroyed, OnDestroyed) |
@@ -1337,20 +825,6 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( |
idb_transaction->abort(); |
} |
-void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore( |
- int32 ipc_transaction_id, int64 object_store_id, int32* ipc_object_store_id, |
- WebKit::WebExceptionCode* ec) { |
- WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &map_, ipc_transaction_id); |
- if (!idb_transaction) |
- return; |
- |
- *ec = 0; |
- WebIDBObjectStore* object_store = |
- idb_transaction->objectStore(object_store_id, *ec); |
- *ipc_object_store_id = object_store ? parent_->Add(object_store) : 0; |
-} |
- |
void IndexedDBDispatcherHost:: |
TransactionDispatcherHost::OnDidCompleteTaskEvents(int ipc_transaction_id) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |