Skip to content

Commit 7a4324f

Browse files
author
Allan Sandfeld Jensen
committed
Pass size to URLRequestJob
If QIODevice has a size we can pass that on as expected size. This fixes media playback where Chromium does not always support streaming outside of HTTP or HTTPS. Task-number: QTBUG-57139 Change-Id: Ie8bf96b1f7f6af80fe707936055620d154c3ef2d Reviewed-by: Michal Klocek <[email protected]> Reviewed-by: Milian Wolff <[email protected]>
1 parent 2d49b1b commit 7a4324f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/url_request_custom_job.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ void URLRequestCustomJobShared::setReplyDevice(QIODevice *device)
229229
if (m_device && !m_device->isReadable())
230230
m_device->open(QIODevice::ReadOnly);
231231

232+
qint64 size = m_device ? m_device->size() : -1;
233+
if (size > 0)
234+
m_job->set_expected_content_size(size);
232235
if (m_device && m_device->isReadable())
233236
content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyStarted, m_weakFactory.GetWeakPtr()));
234237
else

0 commit comments

Comments
 (0)