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

Unified Diff: content/browser/indexed_db/indexed_db_database.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.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 5888a4ba3c4c739e6fd361c328346fa55fbb7df1..5ad8e6ca4dba8ac7ec3b14497e3aa348e3b6ebf7 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -25,8 +25,6 @@
#include "content/browser/indexed_db/indexed_db_cursor.h"
#include "content/browser/indexed_db/indexed_db_factory.h"
#include "content/browser/indexed_db/indexed_db_index_writer.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_pending_connection.h"
#include "content/browser/indexed_db/indexed_db_return_value.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
@@ -907,15 +905,12 @@ void IndexedDBDatabase::FilterObservation(IndexedDBTransaction* transaction,
!observer->IsRecordingObjectStore(object_store_id))
continue;
if (!recorded) {
- if (type == blink::WebIDBClear) {
- transaction->AddObservation(
- connection->id(),
- base::MakeUnique<IndexedDBObservation>(object_store_id, type));
- } else {
- transaction->AddObservation(connection->id(),
- base::MakeUnique<IndexedDBObservation>(
- object_store_id, type, key_range));
- }
+ auto observation = ::indexed_db::mojom::Observation::New();
+ observation->object_store_id = object_store_id;
+ observation->type = type;
+ if (type != blink::WebIDBClear)
+ observation->key_range = key_range;
+ transaction->AddObservation(connection->id(), std::move(observation));
recorded = true;
}
transaction->RecordObserverForLastObservation(connection->id(),
@@ -925,7 +920,7 @@ void IndexedDBDatabase::FilterObservation(IndexedDBTransaction* transaction,
}
void IndexedDBDatabase::SendObservations(
- std::map<int32_t, std::unique_ptr<IndexedDBObserverChanges>> changes_map) {
+ std::map<int32_t, ::indexed_db::mojom::ObserverChangesPtr> changes_map) {
for (auto* conn : connections_) {
auto it = changes_map.find(conn->id());
if (it != changes_map.end())
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.h ('k') | content/browser/indexed_db/indexed_db_database_callbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698