summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-12 01:11:43 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-12 01:11:43 +0000
commitdcafaefb3097412bacafb3c248149f427e6b0fcc (patch)
treedd021843865b6ffe4bfb113d6343891c913e1ba4
parentbadcca35cb7b4ec55b30c50f36ed4ee6496221ae (diff)
downloadchromium_src-dcafaefb3097412bacafb3c248149f427e6b0fcc.zip
chromium_src-dcafaefb3097412bacafb3c248149f427e6b0fcc.tar.gz
chromium_src-dcafaefb3097412bacafb3c248149f427e6b0fcc.tar.bz2
indexeddb: make setVersion fire blocked event if other connections are open
BUG=64049 TEST= Review URL: http://codereview.chromium.org/6513002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74711 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/in_process_webkit/indexed_db_callbacks.cc4
-rw-r--r--chrome/browser/in_process_webkit/indexed_db_callbacks.h1
-rw-r--r--chrome/common/indexed_db_messages.h6
-rw-r--r--chrome/renderer/indexed_db_dispatcher.cc6
-rw-r--r--chrome/renderer/indexed_db_dispatcher.h1
5 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_callbacks.cc b/chrome/browser/in_process_webkit/indexed_db_callbacks.cc
index 395919d..c4584c6a 100644
--- a/chrome/browser/in_process_webkit/indexed_db_callbacks.cc
+++ b/chrome/browser/in_process_webkit/indexed_db_callbacks.cc
@@ -29,6 +29,10 @@ void IndexedDBCallbacksBase::onError(const WebKit::WebIDBDatabaseError& error) {
response_id_, error.code(), error.message()));
}
+void IndexedDBCallbacksBase::onBlocked() {
+ dispatcher_host_->Send(new IndexedDBMsg_CallbacksBlocked(response_id_));
+}
+
void IndexedDBTransactionCallbacks::onAbort() {
dispatcher_host_->Send(
new IndexedDBMsg_TransactionCallbacksAbort(transaction_id_));
diff --git a/chrome/browser/in_process_webkit/indexed_db_callbacks.h b/chrome/browser/in_process_webkit/indexed_db_callbacks.h
index 5ac6592..b900d15 100644
--- a/chrome/browser/in_process_webkit/indexed_db_callbacks.h
+++ b/chrome/browser/in_process_webkit/indexed_db_callbacks.h
@@ -45,6 +45,7 @@ class IndexedDBCallbacksBase : public WebKit::WebIDBCallbacks {
virtual ~IndexedDBCallbacksBase();
virtual void onError(const WebKit::WebIDBDatabaseError& error);
+ virtual void onBlocked();
protected:
IndexedDBDispatcherHost* dispatcher_host() const {
diff --git a/chrome/common/indexed_db_messages.h b/chrome/common/indexed_db_messages.h
index 6852cfb..002a9c1 100644
--- a/chrome/common/indexed_db_messages.h
+++ b/chrome/common/indexed_db_messages.h
@@ -250,6 +250,8 @@ IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksError,
int32 /* response_id */,
int /* code */,
string16 /* message */)
+IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksBlocked,
+ int32 /* response_id */)
// IDBTransactionCallback message handlers.
IPC_MESSAGE_CONTROL1(IndexedDBMsg_TransactionCallbacksAbort,
@@ -351,6 +353,10 @@ IPC_SYNC_MESSAGE_CONTROL4_2(IndexedDBHostMsg_DatabaseTransaction,
WebKit::WebExceptionCode /* ec */)
// WebIDBDatabase::close() message.
+IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseOpen,
+ int32 /* idb_database_id */)
+
+// WebIDBDatabase::close() message.
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseClose,
int32 /* idb_database_id */)
diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc
index 8863b9a..f612dc7 100644
--- a/chrome/renderer/indexed_db_dispatcher.cc
+++ b/chrome/renderer/indexed_db_dispatcher.cc
@@ -52,6 +52,7 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue,
OnSuccessSerializedScriptValue)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError)
+ IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksBlocked, OnBlocked)
IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksAbort, OnAbort)
IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksComplete, OnComplete)
IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksTimeout, OnTimeout)
@@ -377,6 +378,11 @@ void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id,
pending_callbacks_.Remove(repsonse_id);
}
+void IndexedDBDispatcher::OnBlocked(int32 response_id) {
+ WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
+ callbacks->onBlocked();
+}
+
void IndexedDBDispatcher::OnError(int32 response_id, int code,
const string16& message) {
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
diff --git a/chrome/renderer/indexed_db_dispatcher.h b/chrome/renderer/indexed_db_dispatcher.h
index f7eac21..42bd0e9 100644
--- a/chrome/renderer/indexed_db_dispatcher.h
+++ b/chrome/renderer/indexed_db_dispatcher.h
@@ -144,6 +144,7 @@ class IndexedDBDispatcher : public IPC::Channel::Listener {
void OnSuccessSerializedScriptValue(int32 response_id,
const SerializedScriptValue& value);
void OnError(int32 response_id, int code, const string16& message);
+ void OnBlocked(int32 response_id);
void OnAbort(int32 transaction_id);
void OnComplete(int32 transaction_id);
void OnTimeout(int32 transaction_id);