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

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

Issue 10917099: Chromium side of "consolidate two-phase connection to avoid race conditions". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Backwards compatible with current WK API Created 8 years, 3 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 fd8f318e1c1901f4d97fd7a84259bc0f445621dc..417ad84b8cc84fbce136b35ba71716d0610f47d2 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -139,6 +139,8 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryGetDatabaseNames,
OnIDBFactoryGetDatabaseNames)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpen, OnIDBFactoryOpen)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpenLegacy,
+ OnIDBFactoryOpenLegacy)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryDeleteDatabase,
OnIDBFactoryDeleteDatabase)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -222,6 +224,28 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
webkit_glue::FilePathToWebString(indexed_db_path));
}
+// TODO(jsbell): Remove once WK90411 has rolled.
+void IndexedDBDispatcherHost::OnIDBFactoryOpenLegacy(
+ 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.thread_id,
+ params.response_id, origin_url),
+ origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path));
+}
+
void IndexedDBDispatcherHost::OnIDBFactoryOpen(
const IndexedDBHostMsg_FactoryOpen_Params& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
@@ -240,6 +264,8 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen(
params.version,
new IndexedDBCallbacksDatabase(this, params.thread_id,
params.response_id, origin_url),
+ new IndexedDBDatabaseCallbacks(this, params.thread_id,
+ params.database_response_id),
origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path));
}
@@ -452,6 +478,7 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction(
database_url_map_[idb_database_id]);
}
+// TODO(jsbell): Remove once WK90411 has rolled.
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnOpen(
int32 idb_database_id, int32 thread_id, int32 response_id) {
WebIDBDatabase* database = parent_->GetOrTerminateProcess(
« 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