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 431eb37ba7507dba003f6933a0711812f5730397..fc73d72b31d597fca01fe260a4fccb2e07e01f96 100644 |
--- a/components/history/core/browser/history_backend.cc |
+++ b/components/history/core/browser/history_backend.cc |
@@ -1179,7 +1179,15 @@ bool HistoryBackend::CreateDownload(const DownloadRow& history_info) { |
if (!db_) |
return false; |
bool success = db_->CreateDownload(history_info); |
+#if defined(OS_ANDROID) |
+ // On android, browser process can get easily killed. Download will no longer |
+ // be able to resume and the temporary file will linger forever if the |
+ // download is not committed before that. Do the commit right away to avoid |
+ // uncommitted download entry if browser is killed. |
+ Commit(); |
+#else |
ScheduleCommit(); |
+#endif |
return success; |
} |