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

Unified Diff: content/browser/indexed_db/indexed_db_database_callbacks.cc

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Remove unnecessary forward declaration. Created 4 years, 1 month 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/browser/indexed_db/indexed_db_database_callbacks.cc
diff --git a/content/browser/indexed_db/indexed_db_database_callbacks.cc b/content/browser/indexed_db/indexed_db_database_callbacks.cc
index d9aa90af00b717db771ab452b0f5fd32797e6c62..90daa5ff7e092259902e1bfe2243d4231acef8aa 100644
--- a/content/browser/indexed_db/indexed_db_database_callbacks.cc
+++ b/content/browser/indexed_db/indexed_db_database_callbacks.cc
@@ -7,8 +7,6 @@
#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
-#include "content/browser/indexed_db/indexed_db_observer_changes.h"
-#include "content/common/indexed_db/indexed_db_messages.h"
using ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo;
@@ -23,6 +21,7 @@ class IndexedDBDatabaseCallbacks::IOThreadHelper {
void SendVersionChange(int64_t old_version, int64_t new_version);
void SendAbort(int64_t transaction_id, const IndexedDBDatabaseError& error);
void SendComplete(int64_t transaction_id);
+ void SendChanges(::indexed_db::mojom::ObserverChangesPtr changes);
private:
::indexed_db::mojom::DatabaseCallbacksAssociatedPtr callbacks_;
@@ -32,10 +31,8 @@ class IndexedDBDatabaseCallbacks::IOThreadHelper {
IndexedDBDatabaseCallbacks::IndexedDBDatabaseCallbacks(
scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
- int32_t ipc_thread_id,
DatabaseCallbacksAssociatedPtrInfo callbacks_info)
: dispatcher_host_(std::move(dispatcher_host)),
- ipc_thread_id_(ipc_thread_id),
io_helper_(new IOThreadHelper(std::move(callbacks_info))) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
thread_checker_.DetachFromThread();
@@ -100,12 +97,13 @@ void IndexedDBDatabaseCallbacks::OnComplete(int64_t host_transaction_id) {
}
void IndexedDBDatabaseCallbacks::OnDatabaseChange(
- std::unique_ptr<IndexedDBObserverChanges> changes) {
+ ::indexed_db::mojom::ObserverChangesPtr changes) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(io_helper_);
- dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksChanges(
- ipc_thread_id_,
- IndexedDBDispatcherHost::ConvertObserverChanges(std::move(changes))));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&IOThreadHelper::SendChanges,
+ base::Unretained(io_helper_.get()), base::Passed(&changes)));
}
IndexedDBDatabaseCallbacks::IOThreadHelper::IOThreadHelper(
@@ -136,4 +134,9 @@ void IndexedDBDatabaseCallbacks::IOThreadHelper::SendComplete(
callbacks_->Complete(transaction_id);
}
+void IndexedDBDatabaseCallbacks::IOThreadHelper::SendChanges(
+ ::indexed_db::mojom::ObserverChangesPtr changes) {
+ callbacks_->Changes(std::move(changes));
+}
+
} // namespace content
« no previous file with comments | « content/browser/indexed_db/indexed_db_database_callbacks.h ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698