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

Unified Diff: content/child/indexed_db/proxy_webidbdatabase_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_webidbdatabase_impl.cc
===================================================================
--- content/child/indexed_db/proxy_webidbdatabase_impl.cc (revision 208777)
+++ content/child/indexed_db/proxy_webidbdatabase_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"
#include "third_party/WebKit/public/platform/WebIDBKeyPath.h"
@@ -26,9 +26,12 @@
namespace content {
RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(
- int32 ipc_database_id, int32 ipc_database_callbacks_id)
+ int32 ipc_database_id,
+ int32 ipc_database_callbacks_id,
+ ThreadSafeSender* thread_safe_sender)
: ipc_database_id_(ipc_database_id),
- ipc_database_callbacks_id_(ipc_database_callbacks_id) {
+ ipc_database_callbacks_id_(ipc_database_callbacks_id),
+ thread_safe_sender_(thread_safe_sender) {
}
RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() {
@@ -36,10 +39,10 @@
// object since inside WebKit, they hold a reference to the object which owns
// this object. But, if that ever changed, then we'd need to invalidate
// any such pointers.
- IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseDestroyed(
+ thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDestroyed(
ipc_database_id_));
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->DatabaseDestroyed(ipc_database_id_);
}
@@ -57,14 +60,14 @@
params.key_path = IndexedDBKeyPath(key_path);
params.auto_increment = auto_increment;
- IndexedDBDispatcher::Send(
+ thread_safe_sender_->Send(
new IndexedDBHostMsg_DatabaseCreateObjectStore(params));
}
void RendererWebIDBDatabaseImpl::deleteObjectStore(
long long transaction_id,
long long object_store_id) {
- IndexedDBDispatcher::Send(
+ thread_safe_sender_->Send(
new IndexedDBHostMsg_DatabaseDeleteObjectStore(
ipc_database_id_,
transaction_id,
@@ -78,7 +81,7 @@
unsigned short mode)
{
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseCreateTransaction(ipc_database_id_,
transaction_id,
callbacks,
@@ -88,7 +91,7 @@
void RendererWebIDBDatabaseImpl::close() {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseClose(ipc_database_id_,
ipc_database_callbacks_id_);
}
@@ -101,7 +104,7 @@
bool key_only,
WebIDBCallbacks* callbacks) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseGet(
ipc_database_id_, transaction_id, object_store_id, index_id,
IndexedDBKeyRange(key_range), key_only, callbacks);
@@ -117,7 +120,7 @@
const WebVector<long long>& web_index_ids,
const WebVector<WebIndexKeys>& web_index_keys) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabasePut(
ipc_database_id_, transaction_id, object_store_id,
value, IndexedDBKey(key), put_mode, callbacks,
@@ -147,7 +150,7 @@
params.index_keys[i][j] = content::IndexedDBKey(index_keys[i][j]);
}
}
- IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseSetIndexKeys(
+ thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseSetIndexKeys(
params));
}
@@ -157,7 +160,7 @@
const WebVector<long long>& web_index_ids) {
std::vector<int64> index_ids(web_index_ids.data(),
web_index_ids.data() + web_index_ids.size());
- IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseSetIndexesReady(
+ thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseSetIndexesReady(
ipc_database_id_, transaction_id, object_store_id, index_ids));
}
@@ -171,7 +174,7 @@
TaskType task_type,
WebIDBCallbacks* callbacks) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseOpenCursor(
ipc_database_id_,
transaction_id, object_store_id, index_id,
@@ -185,7 +188,7 @@
const WebKit::WebIDBKeyRange& key_range,
WebIDBCallbacks* callbacks) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseCount(
ipc_database_id_,
transaction_id, object_store_id, index_id,
@@ -198,7 +201,7 @@
const WebKit::WebIDBKeyRange& key_range,
WebIDBCallbacks* callbacks) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseDeleteRange(
ipc_database_id_,
transaction_id, object_store_id,
@@ -210,7 +213,7 @@
long long object_store_id,
WebIDBCallbacks* callbacks) {
IndexedDBDispatcher* dispatcher =
- IndexedDBDispatcher::ThreadSpecificInstance();
+ IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_);
dispatcher->RequestIDBDatabaseClear(
ipc_database_id_,
transaction_id, object_store_id, callbacks);
@@ -235,7 +238,7 @@
params.unique = unique;
params.multi_entry = multi_entry;
- IndexedDBDispatcher::Send(
+ thread_safe_sender_->Send(
new IndexedDBHostMsg_DatabaseCreateIndex(params));
}
@@ -244,7 +247,7 @@
long long object_store_id,
long long index_id)
{
- IndexedDBDispatcher::Send(
+ thread_safe_sender_->Send(
new IndexedDBHostMsg_DatabaseDeleteIndex(
ipc_database_id_,
transaction_id,
@@ -252,12 +255,12 @@
}
void RendererWebIDBDatabaseImpl::abort(long long transaction_id) {
- IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseAbort(
+ thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseAbort(
ipc_database_id_, transaction_id));
}
void RendererWebIDBDatabaseImpl::commit(long long transaction_id) {
- IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseCommit(
+ thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseCommit(
ipc_database_id_, transaction_id));
}
« no previous file with comments | « content/child/indexed_db/proxy_webidbdatabase_impl.h ('k') | content/child/indexed_db/proxy_webidbfactory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698