diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-11 09:08:50 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-11-11 12:05:38 +0100 |
commit | 39f7ce19dbce34dfa7e730d6fa743d88109c3369 (patch) | |
tree | 8b99513fe8a906807a0e3fac2780b9d1e6a63827 /src/core/web_contents_adapter.cpp | |
parent | 6c941affb2dd263d929b69afae3a0b9664869a9d (diff) | |
parent | 2d49b1b20f3275316310df599f1363ac86b8f078 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/core/content_browser_client_qt.cpp
src/core/content_browser_client_qt.h
src/core/gl_surface_qt.cpp
src/core/print_view_manager_qt.cpp
src/core/web_contents_delegate_qt.cpp
src/core/web_engine_context.cpp
src/webengine/doc/src/qtwebengine-overview.qdoc
src/webengine/doc/src/qtwebengine-platform-notes.qdoc
src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
src/webenginewidgets/webenginewidgets.pro
sync.profile
Change-Id: I44495f4d899580c882d6b86d68d7f6b77c8e91f6
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c8d93b3f0..03b62d190 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1114,18 +1114,12 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId) static QMimeData *mimeDataFromDropData(const content::DropData &dropData) { QMimeData *mimeData = new QMimeData(); - if (!dropData.text.is_null()) { + if (!dropData.text.is_null()) mimeData->setText(toQt(dropData.text.string())); - return mimeData; - } - if (!dropData.html.is_null()) { + if (!dropData.html.is_null()) mimeData->setHtml(toQt(dropData.html.string())); - return mimeData; - } - if (dropData.url.is_valid()) { + if (dropData.url.is_valid()) mimeData->setUrls(QList<QUrl>() << toQt(dropData.url)); - return mimeData; - } return mimeData; } @@ -1220,6 +1214,16 @@ Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const Q rvh->DragTargetDragOver(toGfx(e->pos()), toGfx(screenPos), toWeb(e->possibleActions()), blink::WebInputEvent::LeftButtonDown); + base::MessageLoop *currentMessageLoop = base::MessageLoop::current(); + DCHECK(currentMessageLoop); + if (!currentMessageLoop->NestableTasksAllowed()) { + // We're already inside a MessageLoop::RunTask call, and scheduled tasks will not be + // executed. That means, updateDragAction will never be called, and the RunLoop below will + // remain blocked forever. + qWarning("WebContentsAdapter::updateDragPosition called from MessageLoop::RunTask."); + return Qt::IgnoreAction; + } + // Wait until we get notified via RenderViewHostDelegateView::UpdateDragCursor. This calls // WebContentsAdapter::updateDragAction that will eventually quit the nested loop. base::RunLoop loop; |