summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-25 21:13:13 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-25 21:13:13 +0000
commite7df39152ff45e8abdbfbab57a5dcec0c09ae34f (patch)
tree074b0e4760eceec7b65bbafaf8c82392a733bdbe
parentd6e383d520f631a6fd027e2c1ca4d60b809fee03 (diff)
downloadchromium_src-e7df39152ff45e8abdbfbab57a5dcec0c09ae34f.zip
chromium_src-e7df39152ff45e8abdbfbab57a5dcec0c09ae34f.tar.gz
chromium_src-e7df39152ff45e8abdbfbab57a5dcec0c09ae34f.tar.bz2
IndexedDB: Don't re-send WebIDBDatabase pointer
Originally, the WebIDBDatabase impl pointer was handed off from Chrome to WebKit in an onSuccess() callback. When "upgradeneeded" support was added, which fires earlier and needs to deliver the connection object to script, the same WebIDBDatabase impl pointer was sent in both onUpgradeNeeded() and onSuccess(). This violates the "pointer is a transfer of ownership" contract with the API and required extra plumbing on both sides of the API. The blink public API has been cleaned up so this is no longer necessary; don't re-send the pointer in onSuccess() if it was previously sent in onUpgradeNeeded(). R=alecflett@chromium.org BUG=234277 Review URL: https://codereview.chromium.org/86053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237142 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/child/indexed_db/indexed_db_dispatcher.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index 9c7bcc4..39f1fae 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -458,11 +458,12 @@ void IndexedDBDispatcher::OnSuccessIDBDatabase(
return;
WebIDBMetadata metadata(ConvertMetadata(idb_metadata));
// If an upgrade was performed, count will be non-zero.
+ WebIDBDatabase* database = NULL;
if (!databases_.count(ipc_object_id))
- databases_[ipc_object_id] = new RendererWebIDBDatabaseImpl(
+ database = databases_[ipc_object_id] = new RendererWebIDBDatabaseImpl(
ipc_object_id, ipc_database_callbacks_id, thread_safe_sender_.get());
DCHECK_EQ(databases_.count(ipc_object_id), 1u);
- callbacks->onSuccess(databases_[ipc_object_id], metadata);
+ callbacks->onSuccess(database, metadata);
pending_callbacks_.Remove(ipc_callbacks_id);
}