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..047323edb0d9ab243ed95b36d054bf8ceb1210e8 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 before browser kill. |
sky
2016/08/30 03:21:21
'before browser kill' -> 'if browser is killed'
qinmin
2016/08/30 16:31:32
Done.
|
+ Commit(); |
+#else |
ScheduleCommit(); |
+#endif |
return success; |
} |