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

Unified Diff: content/child/indexed_db/proxy_webidbcursor_impl.cc

Issue 17955002: Fix IndexedDB after r208777. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unittests Created 7 years, 6 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/child/indexed_db/proxy_webidbcursor_impl.cc
===================================================================
--- content/child/indexed_db/proxy_webidbcursor_impl.cc (revision 208777)
+++ content/child/indexed_db/proxy_webidbcursor_impl.cc (working copy)
@@ -6,7 +6,7 @@
#include <vector>
-#include "content/child/child_thread.h"
+#include "content/child/thread_safe_sender.h"
#include "content/child/indexed_db/indexed_db_dispatcher.h"
#include "content/common/indexed_db/indexed_db_messages.h"
@@ -16,12 +16,15 @@
namespace content {
-RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 ipc_cursor_id)
+RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(
+ int32 ipc_cursor_id,
+ ThreadSafeSender* thread_safe_sender)
: ipc_cursor_id_(ipc_cursor_id),
continue_count_(0),
used_prefetches_(0),
pending_onsuccess_callbacks_(0),
- prefetch_amount_(kMinPrefetchAmount) {}
+ prefetch_amount_(kMinPrefetchAmount),
+ thread_safe_sender_(thread_safe_sender) {}
RendererWebIDBCursorImpl::~RendererWebIDBCursorImpl() {
// It's not possible for there to be pending callbacks that address this
@@ -31,18 +34,18 @@
if (ipc_cursor_id_ != kInvalidCursorId) {
// Invalid ID used in tests to avoid really sending this message.
- IndexedDBDispatcher::Send(
+ thread_safe_sender_->Send(
new IndexedDBHostMsg_CursorDestroyed(ipc_cursor_id_));
}
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->CursorDestroyed(ipc_cursor_id_);
}
void RendererWebIDBCursorImpl::advance(unsigned long count,
WebIDBCallbacks* callbacks_ptr) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
ResetPrefetchCache();
dispatcher->RequestIDBCursorAdvance(
@@ -53,7 +56,7 @@
const WebIDBKey& key,
WebIDBCallbacks* callbacks_ptr) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
if (key.type() == WebIDBKey::NullType) {
@@ -144,7 +147,7 @@
}
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBCursorPrefetchReset(
used_prefetches_, prefetch_keys_.size(), ipc_cursor_id_);
prefetch_keys_.clear();
« no previous file with comments | « content/child/indexed_db/proxy_webidbcursor_impl.h ('k') | content/child/indexed_db/proxy_webidbcursor_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698