WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
112155
[Qt][WK2] Don't require a callback from the application to start a download
https://bugs.webkit.org/show_bug.cgi?id=112155
Summary
[Qt][WK2] Don't require a callback from the application to start a download
Jocelyn Turcotte
Reported
2013-03-12 08:26:21 PDT
[Qt][WK2] Don't require a callback from the application to start a download
Attachments
Patch
(32.41 KB, patch)
2013-03-12 09:09 PDT
,
Jocelyn Turcotte
no flags
Details
Formatted Diff
Diff
Patch
(32.46 KB, patch)
2013-03-19 11:59 PDT
,
Jocelyn Turcotte
no flags
Details
Formatted Diff
Diff
Patch
(32.44 KB, patch)
2013-03-21 05:02 PDT
,
Jocelyn Turcotte
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Jocelyn Turcotte
Comment 1
2013-03-12 09:09:56 PDT
Created
attachment 192748
[details]
Patch
Simon Hausmann
Comment 2
2013-03-13 14:18:53 PDT
Comment on
attachment 192748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=192748&action=review
Looks pretty sensible! Less ifdefs again :)
> Source/WebKit2/Shared/Downloads/qt/QtFileDownloader.cpp:175 > + bool dummy; > + String destination = m_download->decideDestinationWithSuggestedFilename(filename, dummy);
What was the dummy here again? bool overwrite?
> Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h:36 > + WKDownloadRef download;
Shouldn't this be a WKRetainPtr<WKDownloadRef> ?
> Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:149 > + QString requestURL = WKURLCopyQString(adoptWK(WKURLRequestCopyURL(request)).get());
adoptToQString?
Jesus Sanchez-Palencia
Comment 3
2013-03-14 07:37:17 PDT
(In reply to
comment #1
)
> Created an attachment (id=192748) [details] > Patch
LGTM as well.
Jocelyn Turcotte
Comment 4
2013-03-19 11:59:02 PDT
Created
attachment 193890
[details]
Patch Address Simon's comment.
Benjamin Poulain
Comment 5
2013-03-19 15:01:14 PDT
Comment on
attachment 193890
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=193890&action=review
Looks like plenty of good stuff. Signed off for WebKit2.
> Source/WebKit2/Shared/Downloads/qt/QtFileDownloader.cpp:107 > + // Queue the call since we might still be in our Download's constructor.
It is unclear from the comment why being in Download's constructor would be a problem when emitting "onFinished".
> Source/WebKit2/Shared/Downloads/qt/QtFileDownloader.cpp:174 > + bool allowOverwrite; // dummy
I am going to hell for this: WebKit comment style :-D
> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1062 > +bool QQuickWebViewExperimental::downloadUnsupportedContent() const > +{ > + Q_D(const QQuickWebView); > + return d->m_downloadUnsupportedContent; > +} > + > +void QQuickWebViewExperimental::setDownloadUnsupportedContent(bool enable) > +{ > + Q_D(QQuickWebView); > + if (d->m_downloadUnsupportedContent != enable) { > + d->m_downloadUnsupportedContent = enable; > + emit downloadUnsupportedContentChanged(); > + } > +} > +
Just a generic idea: maybe providing a list of mimetypes of interest would be more interesting than a boolean? It depends on what people use this code for obviously :)
> Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp:125 > + for (int i = 1; i < 100; ++i) {
Could the limit of 100 be a problem? Is it covered by a test?
> Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:147 > + // If we can't use (show) it then we might have to download it.
I don't think the comment add anything anymore.
Jocelyn Turcotte
Comment 6
2013-03-21 05:02:44 PDT
Created
attachment 194233
[details]
Patch (In reply to
comment #5
)
> > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1062 > > +bool QQuickWebViewExperimental::downloadUnsupportedContent() const > > Just a generic idea: maybe providing a list of mimetypes of interest would be more interesting than a boolean? > > It depends on what people use this code for obviously :)
The current call is to remain similar to QWebPage::forwardUnsupportedContent, but I can carry this idea to the API review.
> > Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp:125 > > + for (int i = 1; i < 100; ++i) { > > Could the limit of 100 be a problem? > Is it covered by a test?
Right now it is going to fail the download if all of them are taken. I've increased it to 10000 to make it very unlikely that a user will face this limitation while keeping the number readable in the file name. The goal is to let the application handle extreme use cases by moving/renaming the file once the download is finished. There is no test but I'm adding a download UI to MiniBrowser to be able to test the general download code manually at least. Having an automated test to cover the 10000 limit wouldn't be profitable I think (long execution time and potential flackiness).
Anders Carlsson
Comment 7
2013-10-02 21:27:09 PDT
Comment on
attachment 194233
[details]
Patch Qt has been removed, clearing review flags.
Jocelyn Turcotte
Comment 8
2014-02-03 03:25:18 PST
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at
https://bugreports.qt-project.org
and add a link to this issue. See
http://qt-project.org/wiki/ReportingBugsInQt
for additional guidelines.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug