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

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

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: updated unittests 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_callbacks.cc
diff --git a/content/browser/indexed_db/indexed_db_callbacks.cc b/content/browser/indexed_db/indexed_db_callbacks.cc
index eb639072bfc5c21cde8db2f750a2e322605bb14b..bab94696f3245da9c316925484b01f83273a9b15 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.cc
+++ b/content/browser/indexed_db/indexed_db_callbacks.cc
@@ -21,6 +21,7 @@
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_return_value.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
+#include "content/browser/indexed_db/indexed_db_transaction.h"
#include "content/browser/indexed_db/indexed_db_value.h"
#include "content/common/indexed_db/indexed_db_constants.h"
#include "content/common/indexed_db/indexed_db_messages.h"
@@ -174,6 +175,7 @@ void IndexedDBCallbacks::OnBlocked(int64_t existing_version) {
void IndexedDBCallbacks::OnUpgradeNeeded(
int64_t old_version,
std::unique_ptr<IndexedDBConnection> connection,
+ IndexedDBTransaction* transaction,
const IndexedDBDatabaseMetadata& metadata,
const IndexedDBDataLossInfo& data_loss_info) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -184,7 +186,7 @@ void IndexedDBCallbacks::OnUpgradeNeeded(
DCHECK_EQ(kNoDatabase, ipc_database_id_);
data_loss_ = data_loss_info.status;
- dispatcher_host_->RegisterTransactionId(host_transaction_id_, origin_);
+ transaction->set_origin(origin_);
int32_t ipc_database_id =
dispatcher_host_->Add(connection.release(), origin_);
if (ipc_database_id < 0)
@@ -354,7 +356,7 @@ void IndexedDBCallbacks::RegisterBlobsAndSend(
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback);
}
-void IndexedDBCallbacks::OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
+void IndexedDBCallbacks::OnSuccess(std::unique_ptr<IndexedDBCursor> cursor,
const IndexedDBKey& key,
const IndexedDBKey& primary_key,
IndexedDBValue* value) {
@@ -367,7 +369,7 @@ void IndexedDBCallbacks::OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
DCHECK_EQ(kNoDatabase, ipc_database_id_);
DCHECK_EQ(blink::WebIDBDataLossNone, data_loss_);
- int32_t ipc_object_id = dispatcher_host_->Add(cursor.get());
+ int32_t ipc_object_id = dispatcher_host_->Add(std::move(cursor));
std::unique_ptr<IndexedDBMsg_CallbacksSuccessIDBCursor_Params> params(
new IndexedDBMsg_CallbacksSuccessIDBCursor_Params());
params->ipc_thread_id = ipc_thread_id_;

Powered by Google App Engine
This is Rietveld 408576698