[Qt][Wk2] Assertion Failure and crash on file upload
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 16:16:25 +0000 (16:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 16:16:25 +0000 (16:16 +0000)
commit91d671160eeb24df13b02eed2f819840640056da
treeac4968f9b6cc3a701eb05a760d5da475604f6d8c
parent01d501033b00fa413b2fe7129d1edff3b5f07b1f
[Qt][Wk2] Assertion Failure and crash on file upload
https://bugs.webkit.org/show_bug.cgi?id=80854

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-03-16
Reviewed by Simon Hausmann.

Source/WebKit2:

Crash resulted from attempting to create QFileDialog, a QtWidget based dialog from a
QGuiApplication. Replace QFileDialog with a QML implementable component.
Added a new property 'filePicker' to WebView experimental to set the QML component for
file upload triggered by an input file element.

Co-authored with Kasthuri Nallappasoundararajan <kasthuri.n-s@nokia.com>

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewPrivate::chooseFiles):
(QQuickWebViewExperimental::filePicker):
(QQuickWebViewExperimental::setFilePicker):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
* UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro:
* UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_singleFileUpload.qml: Added.
* UIProcess/API/qt/tests/qmltests/common/singlefileupload.html: Added.
* UIProcess/qt/QtDialogRunner.cpp:
(FilePickerContextObject):
(FilePickerContextObject::FilePickerContextObject):
(FilePickerContextObject::fileList):
(FilePickerContextObject::reject):
(FilePickerContextObject::accept):
(QtDialogRunner::initForFilePicker):
* UIProcess/qt/QtDialogRunner.h:
(QtDialogRunner):
(QtDialogRunner::filePaths):
(QtDialogRunner::onFileSelected):

Tools:

Added filePicker to WebView using experimental API.

* MiniBrowser/qt/MiniBrowser.qrc:
* MiniBrowser/qt/icons/folder.png: Added.
* MiniBrowser/qt/icons/titlebar.png: Added.
* MiniBrowser/qt/icons/up.png: Added.
* MiniBrowser/qt/qml/BrowserWindow.qml:
* MiniBrowser/qt/qml/FilePicker.qml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro
Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_singleFileUpload.qml [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/singlefileupload.html [new file with mode: 0644]
Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
Source/WebKit2/UIProcess/qt/QtDialogRunner.h
Tools/ChangeLog
Tools/MiniBrowser/qt/MiniBrowser.qrc
Tools/MiniBrowser/qt/icons/folder.png [new file with mode: 0644]
Tools/MiniBrowser/qt/icons/titlebar.png [new file with mode: 0644]
Tools/MiniBrowser/qt/icons/up.png [new file with mode: 0644]
Tools/MiniBrowser/qt/qml/BrowserWindow.qml
Tools/MiniBrowser/qt/qml/FilePicker.qml [new file with mode: 0644]