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

Unified Diff: content/browser/indexed_db/indexed_db_transaction.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_transaction.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index 5040dddf49fdcabdb0bc06ff18177f95b312c7a2..a8c6fde0714fdaae339b15223e332532ba8d9331 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -16,8 +16,6 @@
#include "content/browser/indexed_db/indexed_db_cursor.h"
#include "content/browser/indexed_db/indexed_db_database.h"
#include "content/browser/indexed_db/indexed_db_database_callbacks.h"
-#include "content/browser/indexed_db/indexed_db_observation.h"
-#include "content/browser/indexed_db/indexed_db_observer_changes.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
#include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseException.h"
@@ -485,15 +483,15 @@ void IndexedDBTransaction::RemovePendingObservers(
void IndexedDBTransaction::AddObservation(
int32_t connection_id,
- std::unique_ptr<IndexedDBObservation> observation) {
+ ::indexed_db::mojom::ObservationPtr observation) {
auto it = connection_changes_map_.find(connection_id);
if (it == connection_changes_map_.end()) {
it = connection_changes_map_
.insert(std::make_pair(
- connection_id, base::MakeUnique<IndexedDBObserverChanges>()))
+ connection_id, ::indexed_db::mojom::ObserverChanges::New()))
.first;
}
- it->second->AddObservation(std::move(observation));
+ it->second->observations.push_back(std::move(observation));
}
void IndexedDBTransaction::RecordObserverForLastObservation(
@@ -501,7 +499,8 @@ void IndexedDBTransaction::RecordObserverForLastObservation(
int32_t observer_id) {
auto it = connection_changes_map_.find(connection_id);
DCHECK(it != connection_changes_map_.end());
- it->second->RecordObserverForLastObservation(observer_id);
+ it->second->observation_index_map[observer_id].push_back(
+ it->second->observations.size() - 1);
}
} // namespace content
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.h ('k') | content/browser/indexed_db/mock_indexed_db_database_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698