summaryrefslogtreecommitdiffstats
path: root/content/child
diff options
context:
space:
mode:
authorcmumford@chromium.org <cmumford@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 17:44:11 +0000
committercmumford@chromium.org <cmumford@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 17:44:11 +0000
commit51ea685f93420be476208abea8484a25e6ea6d73 (patch)
tree4ddc6096c9fb66f8a6d435b2e76f8c7d7617c3fa /content/child
parentbac6ddbb41a551655b8802c2253ed21a0ab9a992 (diff)
downloadchromium_src-51ea685f93420be476208abea8484a25e6ea6d73.zip
chromium_src-51ea685f93420be476208abea8484a25e6ea6d73.tar.gz
chromium_src-51ea685f93420be476208abea8484a25e6ea6d73.tar.bz2
Fixed IndexedDBCursor destruction bug.
IndexedDBCursor's can now be destroyed with cursor messages still in an IPC message queue. Specifically in 368134 IndexedDBCallbacks::OnSuccessWithPrefetch() was called, enqueuing a CallbacksSuccessCursorPrefetch message via IndexedDBDispatcher. Before that message was handled (by IndexedDBDispatcher::OnSuccessCursorPrefetch()) IndexedDBDispatcher::CursorDestroyed() was called which removing the cursor ID from the map. This new behavior started as a result of Blink's r172568 which began deleting cursors earlier than the previous implementation. Also, unrevert's r266866 to re-enable the RenderThreadShutdownTest test. BUG=368134 Review URL: https://codereview.chromium.org/260713009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/child')
-rw-r--r--content/child/indexed_db/indexed_db_dispatcher.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index 9f56e9f..3a66188 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -645,8 +645,8 @@ void IndexedDBDispatcher::OnSuccessCursorContinue(
const IndexedDBKey& primary_key = p.primary_key;
const std::string& value = p.value;
- WebIDBCursorImpl* cursor = cursors_[ipc_cursor_id];
- DCHECK(cursor);
+ if (cursors_.find(ipc_cursor_id) == cursors_.end())
+ return;
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id);
if (!callbacks)
@@ -678,13 +678,16 @@ void IndexedDBDispatcher::OnSuccessCursorPrefetch(
PrepareWebValueAndBlobInfo(
p.values[i], p.blob_or_file_infos[i], &values[i], &blob_infos[i]);
}
- WebIDBCursorImpl* cursor = cursors_[ipc_cursor_id];
- DCHECK(cursor);
- cursor->SetPrefetchData(keys, primary_keys, values, blob_infos);
+ std::map<int32, WebIDBCursorImpl*>::const_iterator cur_iter =
+ cursors_.find(ipc_cursor_id);
+ if (cur_iter == cursors_.end())
+ return;
+
+ cur_iter->second->SetPrefetchData(keys, primary_keys, values, blob_infos);
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id);
DCHECK(callbacks);
- cursor->CachedContinue(callbacks);
+ cur_iter->second->CachedContinue(callbacks);
pending_callbacks_.Remove(ipc_callbacks_id);
}