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

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

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. 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 85b6f9d6911e032eca78054e44ad448925585203..46a0b772c32f65e1b3060a74ccddaddfe0427d27 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"
@@ -908,15 +906,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(),
@@ -926,7 +921,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())

Powered by Google App Engine
This is Rietveld 408576698