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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 2508503002: Fix an issue that temp files are left permanently on storage after chrome crash (Closed)
Patch Set: rebase 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: components/history/core/browser/history_backend.cc
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index 1565486d534978c740ea47500ad2129eb2daae66..08cacf54212abaa3b3639e655f75878563e0b986 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -1168,11 +1168,16 @@ void HistoryBackend::QueryDownloads(std::vector<DownloadRow>* rows) {
}
// Update a particular download entry.
-void HistoryBackend::UpdateDownload(const DownloadRow& data) {
+void HistoryBackend::UpdateDownload(
+ const DownloadRow& data,
+ bool should_commit_immediately) {
if (!db_)
return;
db_->UpdateDownload(data);
- ScheduleCommit();
+ if (should_commit_immediately)
+ Commit();
+ else
+ ScheduleCommit();
}
bool HistoryBackend::CreateDownload(const DownloadRow& history_info) {
« no previous file with comments | « components/history/core/browser/history_backend.h ('k') | components/history/core/browser/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698