[IndexedDB] Add a pre-close task to compact the database.
IndexedDB now generates a lot more data during it's readwrite
transactions during API calls like IDBFactory.deleteDatabase. The system
is designed to clean this up over time, but there are possible worst-
case scenarios where the amount of data being written outstrips the
amount of data being compacted/deleted.
This change makes it so all IndexedDB leveldb databases are compacted
when the backing store is closed. This happens after the normal 2 second
grace period. This should:
1) Make IndexedDB's size smaller for all users.
2) Make IndexedDB's performance and usage more consistent
3) Eliminate the case where uncompacted data from deleting databases is
hogging up the disk.
[email protected], [email protected]
Bug: 1035025
Change-Id: I893743ce0ad5e2b66c1c0ceb5f636b8b424a05c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972910
Reviewed-by: Chase Phillips <[email protected]>
Reviewed-by: Joshua Bell <[email protected]>
Reviewed-by: Victor Costan <[email protected]>
Commit-Queue: Daniel Murphy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#728646}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index b6041fe..93b5f9e 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -971,6 +971,8 @@
"indexed_db/indexed_db_callbacks.h",
"indexed_db/indexed_db_class_factory.cc",
"indexed_db/indexed_db_class_factory.h",
+ "indexed_db/indexed_db_compaction_task.cc",
+ "indexed_db/indexed_db_compaction_task.h",
"indexed_db/indexed_db_connection.cc",
"indexed_db/indexed_db_connection.h",
"indexed_db/indexed_db_connection_coordinator.cc",