Index: chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc |
=================================================================== |
--- chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc (revision 68877) |
+++ chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc (working copy) |
@@ -14,10 +14,7 @@ |
#include "chrome/browser/renderer_host/render_view_host_notification_task.h" |
#include "chrome/browser/renderer_host/resource_message_filter.h" |
#include "chrome/common/chrome_switches.h" |
-#include "chrome/common/indexed_db_key.h" |
-#include "chrome/common/render_messages.h" |
-#include "chrome/common/render_messages_params.h" |
-#include "chrome/common/serialized_script_value.h" |
+#include "chrome/common/indexed_db_messages.h" |
#include "googleurl/src/gurl.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebIDBCursor.h" |
@@ -61,10 +58,9 @@ |
} |
-IndexedDBDispatcherHost::IndexedDBDispatcherHost( |
- IPC::Message::Sender* sender, Profile* profile) |
- : sender_(sender), |
- webkit_context_(profile->GetWebKitContext()), |
+IndexedDBDispatcherHost::IndexedDBDispatcherHost(int process_id, |
+ Profile* profile) |
+ : webkit_context_(profile->GetWebKitContext()), |
host_content_settings_map_(profile->GetHostContentSettingsMap()), |
ALLOW_THIS_IN_INITIALIZER_LIST(database_dispatcher_host_( |
new DatabaseDispatcherHost(this))), |
@@ -76,154 +72,60 @@ |
new CursorDispatcherHost(this))), |
ALLOW_THIS_IN_INITIALIZER_LIST(transaction_dispatcher_host_( |
new TransactionDispatcherHost(this))), |
- process_handle_(0) { |
- DCHECK(sender_); |
+ process_id_(process_id) { |
DCHECK(webkit_context_.get()); |
} |
IndexedDBDispatcherHost::~IndexedDBDispatcherHost() { |
} |
-void IndexedDBDispatcherHost::Init(int process_id, |
- base::ProcessHandle process_handle) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- DCHECK(sender_); // Ensure Shutdown() has not been called. |
- DCHECK(!process_handle_); // Make sure Init() has not yet been called. |
- DCHECK(process_handle); |
- process_id_ = process_id; |
- process_handle_ = process_handle; |
-} |
- |
-void IndexedDBDispatcherHost::Shutdown() { |
- if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
- sender_ = NULL; |
- |
- bool success = BrowserThread::PostTask( |
+void IndexedDBDispatcherHost::OnChannelClosing() { |
+ BrowserThread::DeleteSoon( |
+ BrowserThread::WEBKIT, FROM_HERE, database_dispatcher_host_.release()); |
+ BrowserThread::DeleteSoon( |
+ BrowserThread::WEBKIT, FROM_HERE, index_dispatcher_host_.release()); |
+ BrowserThread::DeleteSoon( |
BrowserThread::WEBKIT, FROM_HERE, |
- NewRunnableMethod(this, &IndexedDBDispatcherHost::Shutdown)); |
- if (success) |
- return; |
- } |
- |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT) || |
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); |
- DCHECK(!sender_); |
- |
- database_dispatcher_host_.reset(); |
- index_dispatcher_host_.reset(); |
- object_store_dispatcher_host_.reset(); |
- cursor_dispatcher_host_.reset(); |
- transaction_dispatcher_host_.reset(); |
+ object_store_dispatcher_host_.release()); |
+ BrowserThread::DeleteSoon( |
+ BrowserThread::WEBKIT, FROM_HERE, cursor_dispatcher_host_.release()); |
+ BrowserThread::DeleteSoon( |
+ BrowserThread::WEBKIT, FROM_HERE, |
+ transaction_dispatcher_host_.release()); |
} |
-bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- DCHECK(process_handle_); |
- |
- switch (message.type()) { |
- case ViewHostMsg_IDBCursorDirection::ID: |
- case ViewHostMsg_IDBCursorKey::ID: |
- case ViewHostMsg_IDBCursorValue::ID: |
- case ViewHostMsg_IDBCursorUpdate::ID: |
- case ViewHostMsg_IDBCursorContinue::ID: |
- case ViewHostMsg_IDBCursorDelete::ID: |
- case ViewHostMsg_IDBCursorDestroyed::ID: |
- case ViewHostMsg_IDBFactoryOpen::ID: |
- case ViewHostMsg_IDBDatabaseName::ID: |
- case ViewHostMsg_IDBDatabaseVersion::ID: |
- case ViewHostMsg_IDBDatabaseObjectStoreNames::ID: |
- case ViewHostMsg_IDBDatabaseCreateObjectStore::ID: |
- case ViewHostMsg_IDBDatabaseDeleteObjectStore::ID: |
- case ViewHostMsg_IDBDatabaseSetVersion::ID: |
- case ViewHostMsg_IDBDatabaseTransaction::ID: |
- case ViewHostMsg_IDBDatabaseDestroyed::ID: |
- case ViewHostMsg_IDBIndexName::ID: |
- case ViewHostMsg_IDBIndexStoreName::ID: |
- case ViewHostMsg_IDBIndexKeyPath::ID: |
- case ViewHostMsg_IDBIndexUnique::ID: |
- case ViewHostMsg_IDBIndexDestroyed::ID: |
- case ViewHostMsg_IDBIndexOpenObjectCursor::ID: |
- case ViewHostMsg_IDBIndexOpenKeyCursor::ID: |
- case ViewHostMsg_IDBIndexGetObject::ID: |
- case ViewHostMsg_IDBIndexGetKey::ID: |
- case ViewHostMsg_IDBObjectStoreName::ID: |
- case ViewHostMsg_IDBObjectStoreKeyPath::ID: |
- case ViewHostMsg_IDBObjectStoreIndexNames::ID: |
- case ViewHostMsg_IDBObjectStoreGet::ID: |
- case ViewHostMsg_IDBObjectStorePut::ID: |
- case ViewHostMsg_IDBObjectStoreDelete::ID: |
- case ViewHostMsg_IDBObjectStoreCreateIndex::ID: |
- case ViewHostMsg_IDBObjectStoreIndex::ID: |
- case ViewHostMsg_IDBObjectStoreDeleteIndex::ID: |
- case ViewHostMsg_IDBObjectStoreOpenCursor::ID: |
- case ViewHostMsg_IDBObjectStoreDestroyed::ID: |
- case ViewHostMsg_IDBTransactionAbort::ID: |
- case ViewHostMsg_IDBTransactionMode::ID: |
- case ViewHostMsg_IDBTransactionDestroyed::ID: |
- case ViewHostMsg_IDBTransactionDidCompleteTaskEvents::ID: |
- case ViewHostMsg_IDBTransactionObjectStore::ID: |
- break; |
- default: |
- return false; |
- } |
- |
- bool success = BrowserThread::PostTask( |
- BrowserThread::WEBKIT, FROM_HERE, NewRunnableMethod( |
- this, &IndexedDBDispatcherHost::OnMessageReceivedWebKit, message)); |
- DCHECK(success); |
- return true; |
+void IndexedDBDispatcherHost::OverrideThreadForMessage( |
+ const IPC::Message& message, |
+ BrowserThread::ID* thread) { |
+ if (IPC_MESSAGE_CLASS(message) == IndexedDBMsgStart) |
+ *thread = BrowserThread::WEBKIT; |
} |
-void IndexedDBDispatcherHost::Send(IPC::Message* message) { |
- if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
- // TODO(jorlow): Even if we successfully post, I believe it's possible for |
- // the task to never run (if the IO thread is already shutting |
- // down). We may want to handle this case, though |
- // realistically it probably doesn't matter. |
- if (!BrowserThread::PostTask( |
- BrowserThread::IO, FROM_HERE, NewRunnableMethod( |
- this, &IndexedDBDispatcherHost::Send, message))) { |
- // The IO thread is dead. |
- delete message; |
- } |
- return; |
- } |
+bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, |
+ bool* message_was_ok) { |
+ if (IPC_MESSAGE_CLASS(message) != IndexedDBMsgStart) |
+ return false; |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- if (!sender_) |
- delete message; |
- else |
- sender_->Send(message); |
-} |
- |
-void IndexedDBDispatcherHost::OnMessageReceivedWebKit( |
- const IPC::Message& message) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
- DCHECK(process_handle_); |
bool msg_is_ok = true; |
jorlow
2010/12/13 18:24:04
What if it's not OK?
jam
2010/12/13 20:41:05
oops, this was unused, removed
|
bool handled = |
- database_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
- index_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
- object_store_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
- cursor_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
- transaction_dispatcher_host_->OnMessageReceived(message, &msg_is_ok); |
+ 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) || |
jorlow
2010/12/13 18:24:04
>80
jam
2010/12/13 20:41:05
Done.
|
+ cursor_dispatcher_host_->OnMessageReceived(message, message_was_ok) || |
+ transaction_dispatcher_host_->OnMessageReceived(message, message_was_ok); |
if (!handled) { |
handled = true; |
DCHECK(msg_is_ok); |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, msg_is_ok) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBFactoryOpen, |
- OnIDBFactoryOpen) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpen, OnIDBFactoryOpen) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
} |
- DCHECK(handled); |
- if (!msg_is_ok) { |
- BrowserRenderProcessHost::BadMessageTerminateProcess(message.type(), |
- process_handle_); |
- } |
+ return handled; |
} |
int32 IndexedDBDispatcherHost::Add(WebIDBCursor* idb_cursor) { |
@@ -253,7 +155,7 @@ |
} |
void IndexedDBDispatcherHost::OnIDBFactoryOpen( |
- const ViewHostMsg_IDBFactoryOpen_Params& params) { |
+ const IndexedDBHostMsg_FactoryOpen_Params& params) { |
FilePath base_path = webkit_context_->data_path(); |
FilePath indexed_db_path; |
if (!base_path.empty()) { |
@@ -263,16 +165,16 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
GURL host(string16(WebSecurityOrigin::createFromDatabaseIdentifier( |
- params.origin_).toString())); |
+ params.origin).toString())); |
ContentSetting content_setting = |
host_content_settings_map_->GetContentSetting( |
host, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
CallRenderViewHostContentSettingsDelegate( |
- process_id_, params.routing_id_, |
+ process_id_, params.routing_id, |
&RenderViewHostDelegate::ContentSettings::OnIndexedDBAccessed, |
- host, params.name_, content_setting == CONTENT_SETTING_BLOCK); |
+ host, params.name, content_setting == CONTENT_SETTING_BLOCK); |
if (content_setting == CONTENT_SETTING_BLOCK) { |
// TODO(jorlow): Change this to the proper error code once we figure out |
@@ -280,12 +182,12 @@ |
int error_code = 0; // Defined by the IndexedDB spec. |
static string16 error_message = ASCIIToUTF16( |
"The user denied permission to open the database."); |
- Send(new ViewMsg_IDBCallbacksError(params.response_id_, error_code, |
- error_message)); |
+ Send(new IndexedDBMsg_CallbacksError(params.response_id, error_code, |
+ error_message)); |
return; |
} |
- DCHECK(kDefaultQuota == params.maximum_size_); |
+ DCHECK(kDefaultQuota == params.maximum_size); |
uint64 quota = kDefaultQuota; |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
@@ -294,9 +196,9 @@ |
} |
Context()->GetIDBFactory()->open( |
- params.name_, |
- new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id_), |
- WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL, |
+ params.name, |
+ new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id), |
+ WebSecurityOrigin::createFromDatabaseIdentifier(params.origin), NULL, |
webkit_glue::FilePathToWebString(indexed_db_path), quota); |
} |
@@ -311,8 +213,7 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
ObjectType* return_object = map->Lookup(return_object_id); |
if (!return_object) { |
- BrowserRenderProcessHost::BadMessageTerminateProcess(message_type, |
- process_handle_); |
+ BadMessageReceived(message_type); |
delete reply_msg; |
} |
return return_object; |
@@ -360,19 +261,19 @@ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::DatabaseDispatcherHost, |
message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseName, OnName) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseVersion, OnVersion) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseObjectStoreNames, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseName, OnName) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseVersion, OnVersion) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseObjectStoreNames, |
OnObjectStoreNames) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseCreateObjectStore, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseCreateObjectStore, |
OnCreateObjectStore) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseDeleteObjectStore, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseDeleteObjectStore, |
OnDeleteObjectStore) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseSetVersion, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseSetVersion, |
OnSetVersion) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseTransaction, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_DatabaseTransaction, |
OnTransaction) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseDestroyed, OnDestroyed) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -388,13 +289,13 @@ |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnName( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<string16, ViewHostMsg_IDBDatabaseName>( |
+ parent_->SyncGetter<string16, IndexedDBHostMsg_DatabaseName>( |
&map_, object_id, reply_msg, &WebIDBDatabase::name); |
} |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnVersion( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<string16, ViewHostMsg_IDBDatabaseVersion>( |
+ parent_->SyncGetter<string16, IndexedDBHostMsg_DatabaseVersion>( |
&map_, object_id, reply_msg, &WebIDBDatabase::version); |
} |
@@ -402,7 +303,7 @@ |
int32 idb_database_id, IPC::Message* reply_msg) { |
WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
&map_, idb_database_id, reply_msg, |
- ViewHostMsg_IDBDatabaseObjectStoreNames::ID); |
+ IndexedDBHostMsg_DatabaseObjectStoreNames::ID); |
if (!idb_database) |
return; |
@@ -411,29 +312,29 @@ |
object_stores.reserve(web_object_stores.length()); |
for (unsigned i = 0; i < web_object_stores.length(); ++i) |
object_stores.push_back(web_object_stores.item(i)); |
- ViewHostMsg_IDBDatabaseObjectStoreNames::WriteReplyParams(reply_msg, |
- object_stores); |
+ IndexedDBHostMsg_DatabaseObjectStoreNames::WriteReplyParams(reply_msg, |
+ object_stores); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( |
- const ViewHostMsg_IDBDatabaseCreateObjectStore_Params& params, |
+ const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
- &map_, params.idb_database_id_, NULL, |
- ViewHostMsg_IDBDatabaseCreateObjectStore::ID); |
+ &map_, params.idb_database_id, NULL, |
+ IndexedDBHostMsg_DatabaseCreateObjectStore::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, |
- NULL, ViewHostMsg_IDBDatabaseCreateObjectStore::ID); |
+ &parent_->transaction_dispatcher_host_->map_, params.transaction_id, |
+ NULL, IndexedDBHostMsg_DatabaseCreateObjectStore::ID); |
if (!idb_database || !idb_transaction) |
return; |
WebExceptionCode ec = 0; |
WebIDBObjectStore* object_store = idb_database->createObjectStore( |
- params.name_, params.key_path_, params.auto_increment_, |
+ params.name, params.key_path, params.auto_increment, |
*idb_transaction, ec); |
- ViewHostMsg_IDBDatabaseCreateObjectStore::WriteReplyParams( |
+ IndexedDBHostMsg_DatabaseCreateObjectStore::WriteReplyParams( |
reply_msg, ec ? 0 : parent_->Add(object_store), ec); |
parent_->Send(reply_msg); |
} |
@@ -446,16 +347,16 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
&map_, idb_database_id, NULL, |
- ViewHostMsg_IDBDatabaseDeleteObjectStore::ID); |
+ IndexedDBHostMsg_DatabaseDeleteObjectStore::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBDatabaseDeleteObjectStore::ID); |
+ IndexedDBHostMsg_DatabaseDeleteObjectStore::ID); |
if (!idb_database || !idb_transaction) |
return; |
WebExceptionCode ec = 0; |
idb_database->deleteObjectStore(name, *idb_transaction, ec); |
- ViewHostMsg_IDBDatabaseDeleteObjectStore::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_DatabaseDeleteObjectStore::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -467,7 +368,7 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
&map_, idb_database_id, NULL, |
- ViewHostMsg_IDBDatabaseSetVersion::ID); |
+ IndexedDBHostMsg_DatabaseSetVersion::ID); |
if (!idb_database) |
return; |
@@ -476,7 +377,7 @@ |
version, |
new IndexedDBCallbacks<WebIDBTransaction>(parent_, response_id), |
ec); |
- ViewHostMsg_IDBDatabaseSetVersion::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_DatabaseSetVersion::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -488,7 +389,7 @@ |
IPC::Message* reply_msg) { |
WebIDBDatabase* database = parent_->GetOrTerminateProcess( |
&map_, idb_database_id, reply_msg, |
- ViewHostMsg_IDBDatabaseTransaction::ID); |
+ IndexedDBHostMsg_DatabaseTransaction::ID); |
if (!database) |
return; |
@@ -503,14 +404,14 @@ |
object_stores, mode, timeout, ec); |
DCHECK(!transaction != !ec); |
int32 id = ec ? 0 : parent_->Add(transaction); |
- ViewHostMsg_IDBDatabaseTransaction::WriteReplyParams(reply_msg, id, ec); |
+ IndexedDBHostMsg_DatabaseTransaction::WriteReplyParams(reply_msg, id, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( |
int32 object_id) { |
parent_->DestroyObject(&map_, object_id, |
- ViewHostMsg_IDBDatabaseDestroyed::ID); |
+ IndexedDBHostMsg_DatabaseDestroyed::ID); |
} |
@@ -532,17 +433,18 @@ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::IndexDispatcherHost, |
message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexName, OnName) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexStoreName, OnStoreName) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexKeyPath, OnKeyPath) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexUnique, OnUnique) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexOpenObjectCursor, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexName, OnName) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexStoreName, OnStoreName) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexKeyPath, OnKeyPath) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexUnique, OnUnique) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexOpenObjectCursor, |
OnOpenObjectCursor) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexOpenKeyCursor, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexOpenKeyCursor, |
OnOpenKeyCursor) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexGetObject, OnGetObject) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBIndexGetKey, OnGetKey) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBIndexDestroyed, OnDestroyed) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexGetObject, |
+ OnGetObject) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_IndexGetKey, OnGetKey) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexDestroyed, OnDestroyed) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -558,72 +460,73 @@ |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnName( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<string16, ViewHostMsg_IDBIndexName>( |
+ parent_->SyncGetter<string16, IndexedDBHostMsg_IndexName>( |
&map_, object_id, reply_msg, &WebIDBIndex::name); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnStoreName( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<string16, ViewHostMsg_IDBIndexStoreName>( |
+ parent_->SyncGetter<string16, IndexedDBHostMsg_IndexStoreName>( |
&map_, object_id, reply_msg, &WebIDBIndex::storeName); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnKeyPath( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<NullableString16, ViewHostMsg_IDBIndexKeyPath>( |
+ parent_->SyncGetter<NullableString16, IndexedDBHostMsg_IndexKeyPath>( |
&map_, object_id, reply_msg, &WebIDBIndex::keyPath); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<bool, ViewHostMsg_IDBIndexUnique>( |
+ parent_->SyncGetter<bool, IndexedDBHostMsg_IndexUnique>( |
&map_, object_id, reply_msg, &WebIDBIndex::unique); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor( |
- const ViewHostMsg_IDBIndexOpenCursor_Params& params, |
+ const IndexedDBHostMsg_IndexOpenCursor_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, params.idb_index_id_, NULL, |
- ViewHostMsg_IDBIndexOpenObjectCursor::ID); |
+ &map_, params.idb_index_id, NULL, |
+ IndexedDBHostMsg_IndexOpenObjectCursor::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, |
- params.transaction_id_, NULL, ViewHostMsg_IDBIndexOpenObjectCursor::ID); |
+ params.transaction_id, NULL, IndexedDBHostMsg_IndexOpenObjectCursor::ID); |
if (!idb_transaction || !idb_index) |
return; |
scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); |
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id)); |
WebExceptionCode ec = 0; |
idb_index->openObjectCursor( |
- WebIDBKeyRange(params.lower_key_, params.upper_key_, params.lower_open_, |
- params.upper_open_), |
- params.direction_, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBIndexOpenObjectCursor::WriteReplyParams(reply_msg, ec); |
+ WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open, |
+ params.upper_open), |
+ params.direction, callbacks.release(), *idb_transaction, ec); |
+ IndexedDBHostMsg_IndexOpenObjectCursor::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenKeyCursor( |
- const ViewHostMsg_IDBIndexOpenCursor_Params& params, |
+ const IndexedDBHostMsg_IndexOpenCursor_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, params.idb_index_id_, NULL, ViewHostMsg_IDBIndexOpenKeyCursor::ID); |
+ &map_, params.idb_index_id, NULL, |
+ IndexedDBHostMsg_IndexOpenKeyCursor::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, |
- NULL, ViewHostMsg_IDBIndexOpenKeyCursor::ID); |
+ &parent_->transaction_dispatcher_host_->map_, params.transaction_id, |
+ NULL, IndexedDBHostMsg_IndexOpenKeyCursor::ID); |
if (!idb_transaction || !idb_index) |
return; |
scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); |
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id)); |
WebExceptionCode ec = 0; |
idb_index->openKeyCursor( |
- WebIDBKeyRange(params.lower_key_, params.upper_key_, params.lower_open_, |
- params.upper_open_), |
- params.direction_, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBIndexOpenKeyCursor::WriteReplyParams(reply_msg, ec); |
+ WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open, |
+ params.upper_open), |
+ params.direction, callbacks.release(), *idb_transaction, ec); |
+ IndexedDBHostMsg_IndexOpenKeyCursor::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -635,10 +538,10 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, idb_index_id, NULL, ViewHostMsg_IDBIndexGetObject::ID); |
+ &map_, idb_index_id, NULL, IndexedDBHostMsg_IndexGetObject::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBIndexGetObject::ID); |
+ IndexedDBHostMsg_IndexGetObject::ID); |
if (!idb_transaction || !idb_index) |
return; |
@@ -646,7 +549,7 @@ |
new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, response_id)); |
WebExceptionCode ec = 0; |
idb_index->getObject(key, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBIndexGetObject::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_IndexGetObject::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -658,10 +561,10 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( |
- &map_, idb_index_id, NULL, ViewHostMsg_IDBIndexGetKey::ID); |
+ &map_, idb_index_id, NULL, IndexedDBHostMsg_IndexGetKey::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBIndexGetKey::ID); |
+ IndexedDBHostMsg_IndexGetKey::ID); |
if (!idb_transaction || !idb_index) |
return; |
@@ -669,13 +572,13 @@ |
new IndexedDBCallbacks<WebIDBKey>(parent_, response_id)); |
WebExceptionCode ec = 0; |
idb_index->getKey(key, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBIndexGetKey::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_IndexGetKey::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed( |
int32 object_id) { |
- parent_->DestroyObject(&map_, object_id, ViewHostMsg_IDBIndexDestroyed::ID); |
+ parent_->DestroyObject(&map_, object_id, IndexedDBHostMsg_IndexDestroyed::ID); |
} |
////////////////////////////////////////////////////////////////////// |
@@ -697,22 +600,23 @@ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, |
message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreName, OnName) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreKeyPath, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreName, OnName) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreKeyPath, |
OnKeyPath) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreIndexNames, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreIndexNames, |
OnIndexNames) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreGet, OnGet); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStorePut, OnPut); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreDelete, OnDelete); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreCreateIndex, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreGet, OnGet); |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStorePut, OnPut); |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreDelete, |
+ OnDelete); |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreCreateIndex, |
OnCreateIndex); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreIndex, OnIndex); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreDeleteIndex, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreIndex, OnIndex) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreDeleteIndex, |
OnDeleteIndex); |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreOpenCursor, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_ObjectStoreOpenCursor, |
OnOpenCursor) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBObjectStoreDestroyed, OnDestroyed) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDestroyed, OnDestroyed) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -728,13 +632,13 @@ |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnName( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<string16, ViewHostMsg_IDBObjectStoreName>( |
+ parent_->SyncGetter<string16, IndexedDBHostMsg_ObjectStoreName>( |
&map_, object_id, reply_msg, &WebIDBObjectStore::name); |
} |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnKeyPath( |
int32 object_id, IPC::Message* reply_msg) { |
- parent_->SyncGetter<NullableString16, ViewHostMsg_IDBObjectStoreKeyPath>( |
+ parent_->SyncGetter<NullableString16, IndexedDBHostMsg_ObjectStoreKeyPath>( |
&map_, object_id, reply_msg, &WebIDBObjectStore::keyPath); |
} |
@@ -742,7 +646,7 @@ |
int32 idb_object_store_id, IPC::Message* reply_msg) { |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
&map_, idb_object_store_id, reply_msg, |
- ViewHostMsg_IDBObjectStoreIndexNames::ID); |
+ IndexedDBHostMsg_ObjectStoreIndexNames::ID); |
if (!idb_object_store) |
return; |
@@ -751,8 +655,8 @@ |
index_names.reserve(web_index_names.length()); |
for (unsigned i = 0; i < web_index_names.length(); ++i) |
index_names.push_back(web_index_names.item(i)); |
- ViewHostMsg_IDBObjectStoreIndexNames::WriteReplyParams(reply_msg, |
- index_names); |
+ IndexedDBHostMsg_ObjectStoreIndexNames::WriteReplyParams(reply_msg, |
+ index_names); |
parent_->Send(reply_msg); |
} |
@@ -764,10 +668,10 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, idb_object_store_id, NULL, ViewHostMsg_IDBObjectStoreGet::ID); |
+ &map_, idb_object_store_id, NULL, IndexedDBHostMsg_ObjectStoreGet::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBObjectStoreGet::ID); |
+ IndexedDBHostMsg_ObjectStoreGet::ID); |
if (!idb_transaction || !idb_object_store) |
return; |
@@ -775,29 +679,29 @@ |
new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, response_id)); |
WebExceptionCode ec = 0; |
idb_object_store->get(key, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStoreGet::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_ObjectStoreGet::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( |
- const ViewHostMsg_IDBObjectStorePut_Params& params, |
+ const IndexedDBHostMsg_ObjectStorePut_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, params.idb_object_store_id_, NULL, |
- ViewHostMsg_IDBObjectStorePut::ID); |
+ &map_, params.idb_object_store_id, NULL, |
+ IndexedDBHostMsg_ObjectStorePut::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, |
- NULL, ViewHostMsg_IDBObjectStorePut::ID); |
+ &parent_->transaction_dispatcher_host_->map_, params.transaction_id, |
+ NULL, IndexedDBHostMsg_ObjectStorePut::ID); |
if (!idb_transaction || !idb_object_store) |
return; |
scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBKey>(parent_, params.response_id_)); |
+ new IndexedDBCallbacks<WebIDBKey>(parent_, params.response_id)); |
WebExceptionCode ec = 0; |
- idb_object_store->put(params.serialized_value_, params.key_, params.add_only_, |
+ idb_object_store->put(params.serialized_value, params.key, params.add_only, |
callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStorePut::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_ObjectStorePut::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -809,38 +713,39 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, idb_object_store_id, NULL, ViewHostMsg_IDBObjectStoreDelete::ID); |
+ &map_, idb_object_store_id, NULL, IndexedDBHostMsg_ObjectStoreDelete::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBObjectStoreDelete::ID); |
+ IndexedDBHostMsg_ObjectStoreDelete::ID); |
if (!idb_transaction || !idb_object_store) |
return; |
scoped_ptr<WebIDBCallbacks> callbacks( |
new IndexedDBCallbacks<void>(parent_, response_id)); |
WebExceptionCode ec = 0; |
- idb_object_store->deleteFunction(key, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStoreDelete::WriteReplyParams(reply_msg, ec); |
+ idb_object_store->deleteFunction( |
+ key, callbacks.release(), *idb_transaction, ec); |
+ IndexedDBHostMsg_ObjectStoreDelete::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( |
- const ViewHostMsg_IDBObjectStoreCreateIndex_Params& params, |
+ const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
- &map_, params.idb_object_store_id_, NULL, |
- ViewHostMsg_IDBObjectStoreCreateIndex::ID); |
+ &map_, params.idb_object_store_id, NULL, |
+ IndexedDBHostMsg_ObjectStoreCreateIndex::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, |
- NULL, ViewHostMsg_IDBObjectStoreCreateIndex::ID); |
+ &parent_->transaction_dispatcher_host_->map_, params.transaction_id, |
+ NULL, IndexedDBHostMsg_ObjectStoreCreateIndex::ID); |
if (!idb_object_store || !idb_transaction) |
return; |
WebExceptionCode ec = 0; |
WebIDBIndex* index = idb_object_store->createIndex( |
- params.name_, params.key_path_, params.unique_, *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStoreCreateIndex::WriteReplyParams( |
+ params.name, params.key_path, params.unique, *idb_transaction, ec); |
+ IndexedDBHostMsg_ObjectStoreCreateIndex::WriteReplyParams( |
reply_msg, ec ? 0 : parent_->Add(index), ec); |
parent_->Send(reply_msg); |
} |
@@ -851,14 +756,14 @@ |
IPC::Message* reply_msg) { |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
&map_, idb_object_store_id, reply_msg, |
- ViewHostMsg_IDBObjectStoreIndex::ID); |
+ IndexedDBHostMsg_ObjectStoreIndex::ID); |
if (!idb_object_store) |
return; |
WebExceptionCode ec = 0; |
WebIDBIndex* index = idb_object_store->index(name, ec); |
int32 object_id = parent_->Add(index); |
- ViewHostMsg_IDBObjectStoreIndex::WriteReplyParams(reply_msg, object_id, ec); |
+ IndexedDBHostMsg_ObjectStoreIndex::WriteReplyParams(reply_msg, object_id, ec); |
parent_->Send(reply_msg); |
} |
@@ -870,48 +775,48 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
&map_, idb_object_store_id, NULL, |
- ViewHostMsg_IDBObjectStoreDeleteIndex::ID); |
+ IndexedDBHostMsg_ObjectStoreDeleteIndex::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, |
- ViewHostMsg_IDBObjectStoreDeleteIndex::ID); |
+ IndexedDBHostMsg_ObjectStoreDeleteIndex::ID); |
if (!idb_object_store || !idb_transaction) |
return; |
WebExceptionCode ec = 0; |
idb_object_store->deleteIndex(name, *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStoreDeleteIndex::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_ObjectStoreDeleteIndex::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor( |
- const ViewHostMsg_IDBObjectStoreOpenCursor_Params& params, |
+ const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params, |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
&parent_->object_store_dispatcher_host_->map_, |
- params.idb_object_store_id_, NULL, |
- ViewHostMsg_IDBObjectStoreOpenCursor::ID); |
+ params.idb_object_store_id, NULL, |
+ IndexedDBHostMsg_ObjectStoreOpenCursor::ID); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, |
- NULL, ViewHostMsg_IDBObjectStoreOpenCursor::ID); |
+ &parent_->transaction_dispatcher_host_->map_, params.transaction_id, |
+ NULL, IndexedDBHostMsg_ObjectStoreOpenCursor::ID); |
if (!idb_transaction || !idb_object_store) |
return; |
scoped_ptr<WebIDBCallbacks> callbacks( |
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); |
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id)); |
WebExceptionCode ec = 0; |
idb_object_store->openCursor( |
- WebIDBKeyRange(params.lower_key_, params.upper_key_, params.lower_open_, |
- params.upper_open_), |
- params.direction_, callbacks.release(), *idb_transaction, ec); |
- ViewHostMsg_IDBObjectStoreOpenCursor::WriteReplyParams(reply_msg, ec); |
+ WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open, |
+ params.upper_open), |
+ params.direction, callbacks.release(), *idb_transaction, ec); |
+ IndexedDBHostMsg_ObjectStoreOpenCursor::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed( |
int32 object_id) { |
parent_->DestroyObject( |
- &map_, object_id, ViewHostMsg_IDBObjectStoreDestroyed::ID); |
+ &map_, object_id, IndexedDBHostMsg_ObjectStoreDestroyed::ID); |
} |
////////////////////////////////////////////////////////////////////// |
@@ -932,14 +837,14 @@ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost, |
message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorDirection, |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorDirection, |
OnDirection) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorKey, OnKey) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorValue, OnValue) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorUpdate, OnUpdate) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorContinue, OnContinue) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorDelete, OnDelete) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBCursorDestroyed, OnDestroyed) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorKey, OnKey) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorValue, OnValue) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorUpdate, OnUpdate) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorContinue, OnContinue) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_CursorDelete, OnDelete) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -957,41 +862,38 @@ |
void IndexedDBDispatcherHost::CursorDispatcherHost::OnDirection( |
int32 object_id, IPC::Message* reply_msg) { |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, object_id, reply_msg, |
- ViewHostMsg_IDBCursorDirection::ID); |
+ &map_, object_id, reply_msg, IndexedDBHostMsg_CursorDirection::ID); |
if (!idb_cursor) |
return; |
int direction = idb_cursor->direction(); |
- ViewHostMsg_IDBCursorDirection::WriteReplyParams(reply_msg, direction); |
+ IndexedDBHostMsg_CursorDirection::WriteReplyParams(reply_msg, direction); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::CursorDispatcherHost::OnKey( |
int32 object_id, IPC::Message* reply_msg) { |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, object_id, reply_msg, |
- ViewHostMsg_IDBCursorKey::ID); |
+ &map_, object_id, reply_msg, IndexedDBHostMsg_CursorKey::ID); |
if (!idb_cursor) |
return; |
IndexedDBKey key(idb_cursor->key()); |
- ViewHostMsg_IDBCursorKey::WriteReplyParams(reply_msg, key); |
+ IndexedDBHostMsg_CursorKey::WriteReplyParams(reply_msg, key); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue( |
int32 object_id, IPC::Message* reply_msg) { |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, object_id, reply_msg, |
- ViewHostMsg_IDBCursorValue::ID); |
+ &map_, object_id, reply_msg, IndexedDBHostMsg_CursorValue::ID); |
if (!idb_cursor) |
return; |
WebSerializedScriptValue scriptValue; |
WebIDBKey key; |
idb_cursor->value(scriptValue, key); |
- ViewHostMsg_IDBCursorValue::WriteReplyParams( |
+ IndexedDBHostMsg_CursorValue::WriteReplyParams( |
reply_msg, SerializedScriptValue(scriptValue), IndexedDBKey(key)); |
parent_->Send(reply_msg); |
} |
@@ -1003,14 +905,14 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, cursor_id, NULL, ViewHostMsg_IDBCursorUpdate::ID); |
+ &map_, cursor_id, NULL, IndexedDBHostMsg_CursorUpdate::ID); |
if (!idb_cursor) |
return; |
WebExceptionCode ec = 0; |
idb_cursor->update( |
value, new IndexedDBCallbacks<void>(parent_, response_id), ec); |
- ViewHostMsg_IDBCursorUpdate::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_CursorUpdate::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -1021,14 +923,14 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, cursor_id, NULL, ViewHostMsg_IDBCursorContinue::ID); |
+ &map_, cursor_id, NULL, IndexedDBHostMsg_CursorContinue::ID); |
if (!idb_cursor) |
return; |
WebExceptionCode ec = 0; |
idb_cursor->continueFunction( |
key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id), ec); |
- ViewHostMsg_IDBCursorContinue::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_CursorContinue::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
@@ -1038,21 +940,21 @@ |
IPC::Message* reply_msg) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( |
- &map_, cursor_id, NULL, ViewHostMsg_IDBCursorUpdate::ID); |
+ &map_, cursor_id, NULL, IndexedDBHostMsg_CursorUpdate::ID); |
if (!idb_cursor) |
return; |
WebExceptionCode ec = 0; |
// TODO(jorlow): This should be delete. |
idb_cursor->remove(new IndexedDBCallbacks<void>(parent_, response_id), ec); |
- ViewHostMsg_IDBCursorUpdate::WriteReplyParams(reply_msg, ec); |
+ IndexedDBHostMsg_CursorUpdate::WriteReplyParams(reply_msg, ec); |
parent_->Send(reply_msg); |
} |
void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
int32 object_id) { |
parent_->DestroyObject( |
- &map_, object_id, ViewHostMsg_IDBCursorDestroyed::ID); |
+ &map_, object_id, IndexedDBHostMsg_CursorDestroyed::ID); |
} |
////////////////////////////////////////////////////////////////////// |
@@ -1079,13 +981,13 @@ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, |
message, *msg_is_ok) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionAbort, OnAbort) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBTransactionMode, OnMode) |
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBTransactionObjectStore, |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_TransactionMode, OnMode) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(IndexedDBHostMsg_TransactionObjectStore, |
OnObjectStore) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionDidCompleteTaskEvents, |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, |
OnDidCompleteTaskEvents) |
- IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionDestroyed, OnDestroyed) |
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDestroyed, OnDestroyed) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -1102,7 +1004,7 @@ |
void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( |
int32 transaction_id) { |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &map_, transaction_id, 0, ViewHostMsg_IDBTransactionAbort::ID); |
+ &map_, transaction_id, 0, IndexedDBHostMsg_TransactionAbort::ID); |
if (!idb_transaction) |
return; |
@@ -1113,12 +1015,12 @@ |
int32 transaction_id, |
IPC::Message* reply_msg) { |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
- &map_, transaction_id, 0, ViewHostMsg_IDBTransactionMode::ID); |
+ &map_, transaction_id, 0, IndexedDBHostMsg_TransactionMode::ID); |
if (!idb_transaction) |
return; |
int mode = idb_transaction->mode(); |
- ViewHostMsg_IDBTransactionMode::WriteReplyParams(reply_msg, mode); |
+ IndexedDBHostMsg_TransactionMode::WriteReplyParams(reply_msg, mode); |
parent_->Send(reply_msg); |
} |
@@ -1126,14 +1028,14 @@ |
int32 transaction_id, const string16& name, IPC::Message* reply_msg) { |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&map_, transaction_id, reply_msg, |
- ViewHostMsg_IDBTransactionObjectStore::ID); |
+ IndexedDBHostMsg_TransactionObjectStore::ID); |
if (!idb_transaction) |
return; |
WebExceptionCode ec = 0; |
WebIDBObjectStore* object_store = idb_transaction->objectStore(name, ec); |
int32 object_id = object_store ? parent_->Add(object_store) : 0; |
- ViewHostMsg_IDBTransactionObjectStore::WriteReplyParams( |
+ IndexedDBHostMsg_TransactionObjectStore::WriteReplyParams( |
reply_msg, object_id, ec); |
parent_->Send(reply_msg); |
} |
@@ -1143,7 +1045,7 @@ |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
&map_, transaction_id, 0, |
- ViewHostMsg_IDBTransactionDidCompleteTaskEvents::ID); |
+ IndexedDBHostMsg_TransactionDidCompleteTaskEvents::ID); |
if (!idb_transaction) |
return; |
@@ -1153,5 +1055,5 @@ |
void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
int32 object_id) { |
parent_->DestroyObject( |
- &map_, object_id, ViewHostMsg_IDBTransactionDestroyed::ID); |
+ &map_, object_id, IndexedDBHostMsg_TransactionDestroyed::ID); |
} |