summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------src/3rdparty0
-rw-r--r--src/core/download_manager_delegate_qt.cpp8
2 files changed, 6 insertions, 2 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 493fab1afff5034cb5552455add3af3aaf41f9e
+Subproject b3edbf2a84d96ed1d0307a8ef909b2f1f6c2a97
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 948a62047..f0f0c93b9 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -79,7 +79,7 @@ DownloadManagerDelegateQt::~DownloadManagerDelegateQt()
void DownloadManagerDelegateQt::GetNextId(const content::DownloadIdCallback& callback)
{
- callback.Run(++m_currentId);
+ callback.Run(m_currentId);
}
download::DownloadItem *DownloadManagerDelegateQt::findDownloadById(quint32 downloadId)
@@ -124,6 +124,8 @@ void DownloadManagerDelegateQt::removeDownload(quint32 downloadId)
bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* item,
const content::DownloadTargetCallback& callback)
{
+ m_currentId = item->GetId();
+
// Keep the forced file path if set, also as the temporary file, so the check for existence
// will already return that the file exists. Forced file paths seem to be only used for
// store downloads and other special downloads, so they might never end up here anyway.
@@ -184,6 +186,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
if (webContents)
adapterClient = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate())->adapterClient();
+ Q_ASSERT(m_currentId == item->GetId());
ProfileAdapterClient::DownloadItemInfo info = {
item->GetId(),
toQt(item->GetURL()),
@@ -284,8 +287,9 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
if (web_contents)
adapterClient = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->adapterClient();
+ // Chromium doesn't increase download ID when saving page.
ProfileAdapterClient::DownloadItemInfo info = {
- m_currentId + 1,
+ ++m_currentId,
toQt(web_contents->GetURL()),
download::DownloadItem::IN_PROGRESS,
0, /* totalBytes */