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

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

Issue 1996443003: Return number of values deleted by IDBObjectStore.delete(range) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 c686ae87ad3aaa4a86d13e948f644c1f0c8265ba..ae3fec0191e4c61a75b68077602d716aa9b2fca5 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1410,13 +1410,12 @@ void IndexedDBDatabase::DeleteRangeOperation(
std::unique_ptr<IndexedDBKeyRange> key_range,
scoped_refptr<IndexedDBCallbacks> callbacks,
IndexedDBTransaction* transaction) {
- IDB_TRACE1(
- "IndexedDBDatabase::DeleteRangeOperation", "txn.id", transaction->id());
+ IDB_TRACE1("IndexedDBDatabase::DeleteRangeOperation", "txn.id",
+ transaction->id());
+ size_t delete_count = 0;
leveldb::Status s =
- backing_store_->DeleteRange(transaction->BackingStoreTransaction(),
- id(),
- object_store_id,
- *key_range);
+ backing_store_->DeleteRange(transaction->BackingStoreTransaction(), id(),
+ object_store_id, *key_range, &delete_count);
if (!s.ok()) {
base::string16 error_string =
ASCIIToUTF16("Internal error deleting data in range");
@@ -1428,7 +1427,7 @@ void IndexedDBDatabase::DeleteRangeOperation(
}
return;
}
- callbacks->OnSuccess();
+ callbacks->OnSuccess(delete_count);
cmumford 2016/05/19 17:07:16 You now need to move the "IndexedDBDatabase::Delet
}
void IndexedDBDatabase::Clear(int64_t transaction_id,

Powered by Google App Engine
This is Rietveld 408576698