From 9e44ef9432d44cbd326557124036976b056d7868 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Mon, 18 Jan 2016 12:58:04 +0100 Subject: Correct QWebEngineUrlRequestInterceptor documentation. The documentation was still based on the initial version of the method, where it had to return a boolean value. This is no longer the case and hence removed from the doc. Change-Id: Ica1e4a769631c0169bc5e59abd54c25a416cf4a9 Task-number: QTBUG-50513 Reviewed-by: Joerg Bornemann --- src/core/api/qwebengineurlrequestinfo.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index db5627acb..e53d9afb6 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -101,13 +101,11 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q */ /*! - \fn bool QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) + \fn void QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) Reimplementing this virtual function and setting the interceptor on a profile makes it possible to intercept URL requests. This function is executed on the IO thread, and therefore running long tasks here will block networking. - If this function is only used for inspection, it should return \c false, in which - case any modification to \a info will be ignored. \sa QWebEngineProfile::setRequestInterceptor */ -- cgit v1.2.3 From 3763ca87176c86091a75b3b66dd75a45fc5809c5 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 19 Jan 2016 12:10:58 +0300 Subject: Use QFileInfo::exist(f) instead of QFileInfo(f).exists() and QFile::exist(f) instead of QFile(f).exists(). It's faster. Change-Id: I2d5ffb2e64a547d3c703ad048ef0c75a7ccfe0d3 Reviewed-by: Allan Sandfeld Jensen --- src/core/content_client_qt.cpp | 4 ++-- src/core/web_engine_library_info.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index ccc97517e..c8b23efab 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -123,7 +123,7 @@ void AddPepperFlashFromSystem(std::vector* plugins) << "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so"; // OpenSuSE #endif for (auto it = pluginPaths.constBegin(); it != pluginPaths.constEnd(); ++it) { - if (!QFile(*it).exists()) + if (!QFile::exists(*it)) continue; plugins->push_back(CreatePepperFlashInfo(QtWebEngineCore::toFilePath(*it), std::string())); } @@ -132,7 +132,7 @@ void AddPepperFlashFromSystem(std::vector* plugins) void AddPepperFlashFromCommandLine(std::vector* plugins) { const base::CommandLine::StringType flash_path = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kPpapiFlashPath); - if (flash_path.empty() || !QFile(QtWebEngineCore::toQt(flash_path)).exists()) + if (flash_path.empty() || !QFile::exists(QtWebEngineCore::toQt(flash_path))) return; // Read pepper flash plugin version from command-line. (e.g. 16.0.0.235) diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 8ec18c87d..cfe5556de 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -137,7 +137,7 @@ QString subProcessPath() } Q_FOREACH (const QString &candidate, candidatePaths) { - if (QFileInfo(candidate).exists()) { + if (QFileInfo::exists(candidate)) { processPath = candidate; break; } @@ -164,7 +164,7 @@ QString pluginsPath() const QStringList directories = QCoreApplication::libraryPaths(); Q_FOREACH (const QString &dir, directories) { const QString candidate = dir % "/" % QLatin1String("qtwebengine"); - if (QFileInfo(candidate).exists()) { + if (QFileInfo::exists(candidate)) { pluginsPath = candidate; break; } -- cgit v1.2.3 From e7f4ddebc3f1a857b81d3468119cda9236513bf4 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 19 Jan 2016 15:59:48 +0100 Subject: Doc: remove docs for QWebEngineCookieStore::FilterRequest class The class and its members were removed. Change-Id: Ib8e892da1f9e10ffcf9861f75615ef48d3697886 Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qwebenginecookiestore.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src') diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp index c0a3f3208..5220073f3 100644 --- a/src/core/api/qwebenginecookiestore.cpp +++ b/src/core/api/qwebenginecookiestore.cpp @@ -190,38 +190,6 @@ void QWebEngineCookieStorePrivate::onCookieChanged(const QNetworkCookie &cookie, because they might block the IO thread in case of a blocking connection. */ -/*! - \class QWebEngineCookieStore::FilterRequest - \inmodule QtWebEngineCore - \since 5.6 - \brief The FilterRequest class specifies the properties of a cookie. - - The class specifies the properties of a cookie and determines whether the cookie should be - accepted. The class is used as an argument to a filter installed via setCookieFilter(). -*/ - -/*! - \variable QWebEngineCookieStore::FilterRequest::accepted - \brief Whether the cookie shall be accepted. - - The default is \c true. -*/ - -/*! - \variable QWebEngineCookieStore::FilterRequest::firstPartyUrl - \brief The URL of the page that triggered the setting of the cookie. -*/ - -/*! - \variable QWebEngineCookieStore::FilterRequest::cookieLine - \brief The content of the cookie. -*/ - -/*! - \variable QWebEngineCookieStore::FilterRequest::cookieSource - \brief The URL of the site that sets the cookie. -*/ - /*! \fn void QWebEngineCookieStore::cookieAdded(const QNetworkCookie &cookie) -- cgit v1.2.3 From f8ac9f0eb1745648750493cfbb16eed0d859b212 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 11 Jan 2016 10:37:31 +0100 Subject: Doc: link capturing methods Task-number: QTBUG-48435 Change-Id: If7117ecb11a0f06df1204dc91757a29c5444e189 Reviewed-by: Leena Miettinen --- src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc | 7 +++++++ src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc index ca1309718..065e5a18b 100644 --- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc +++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc @@ -279,5 +279,12 @@ \li In the latest HTML standard, any document element can be made editable through the \c contentEditable attribute. So \c runJavaScript is all that is needed: \c{page->runJavascript("document.documentElement.contentEditable = true")} + \row + \li QWebPage::setLinkDelegationPolicy + \li There is no way to connect a signal to run C++ code when a link is clicked. However, + link clicks can be delegated to the Qt application instead of having the HTML handler + engine process them by overloading the QWebEnginePage::acceptNavigationRequest() + function. This is necessary when an HTML document is used as part of the user interface, + and not to display external data, for example, when displaying a list of results. \endtable */ diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index a6f015434..22eacfda9 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -275,8 +275,17 @@ the specified navigation type \a type. \a isMainFrame indicates whether the request corresponds to the main frame or a sub frame. If the function returns \c true, the navigation request is accepted and \c url is loaded. The default implementation accepts all navigation requests. -*/ + This function is called for absolute URLs that are prefixed with \c {http://} or \c {https://} + and for unrecognized schemes, such as \c {mailto:}, which will be handled by QDesktopServices + if accepted. To have this function called also upon receiving navigation requests to local URLs, + prefix the URLs with \c {http://}. + + Navigation requests can be delegated to the Qt application instead of having the HTML handler + engine process them by overloading this function. This is necessary when an HTML document is + used as part of the user interface, and not to display external data, for example, when + displaying a list of results. +*/ /*! \fn void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString& msg) -- cgit v1.2.3 From 39b3cf19539e24c9186b2729893e3e2a503a33ee Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Thu, 7 Jan 2016 06:46:15 -0800 Subject: Widgets: Improve geometryChangeRequested signal Use this signal to notify the user on JavaScript window move/resize requests. It works only for windows opened by JavaScript (according to the Chromium browser's behavior). Change-Id: I7fdeda4c252cc4badb36b74ed61d947be690f45a Reviewed-by: Allan Sandfeld Jensen --- src/core/web_contents_adapter_client.h | 2 +- src/core/web_contents_delegate_qt.cpp | 11 +++++++++++ src/core/web_contents_delegate_qt.h | 2 ++ src/webengine/api/qquickwebengineview_p_p.h | 1 + src/webenginewidgets/api/qwebenginepage.cpp | 6 ++++++ src/webenginewidgets/api/qwebenginepage_p.h | 1 + 6 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 117e21e25..6902a202f 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -237,7 +237,7 @@ public: virtual void moveValidationMessage(const QRect &anchor) = 0; RenderProcessTerminationStatus renderProcessExitStatus(int); virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) = 0; - + virtual void requestGeometryChange(const QRect &geometry) = 0; virtual void allowCertificateError(const QSharedPointer &errorController) = 0; virtual BrowserContextAdapter* browserContextAdapter() = 0; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 59fa0a9a8..81f16970d 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -304,6 +304,17 @@ void WebContentsDelegateQt::RequestMediaAccessPermission(content::WebContents *w MediaCaptureDevicesDispatcher::GetInstance()->processMediaAccessRequest(m_viewClient, web_contents, request, callback); } +void WebContentsDelegateQt::MoveContents(content::WebContents *source, const gfx::Rect &pos) +{ + Q_UNUSED(source) + m_viewClient->requestGeometryChange(toQt(pos)); +} + +bool WebContentsDelegateQt::IsPopupOrPanel(const content::WebContents *source) const +{ + return source->HasOpener(); +} + void WebContentsDelegateQt::UpdateTargetURL(content::WebContents* source, const GURL& url) { Q_UNUSED(source) diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index d3075cfbf..356b2df88 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -87,6 +87,8 @@ public: virtual bool AddMessageToConsole(content::WebContents* source, int32 level, const base::string16& message, int32 line_no, const base::string16& source_id) Q_DECL_OVERRIDE; virtual void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) Q_DECL_OVERRIDE; virtual void RequestMediaAccessPermission(content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) Q_DECL_OVERRIDE; + virtual void MoveContents(content::WebContents *source, const gfx::Rect &pos) Q_DECL_OVERRIDE; + virtual bool IsPopupOrPanel(const content::WebContents *source) const Q_DECL_OVERRIDE; virtual void UpdateTargetURL(content::WebContents* source, const GURL& url) Q_DECL_OVERRIDE; virtual void RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) Q_DECL_OVERRIDE; virtual void ShowValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view, const base::string16 &main_text, const base::string16 &sub_text) Q_DECL_OVERRIDE; diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index 5d3be5216..dbbbf9168 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -171,6 +171,7 @@ public: virtual void moveValidationMessage(const QRect &anchor) Q_DECL_OVERRIDE; virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) Q_DECL_OVERRIDE; + virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE { Q_UNUSED(geometry); } virtual QtWebEngineCore::BrowserContextAdapter *browserContextAdapter() Q_DECL_OVERRIDE; diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index c2314a1ef..aacf6c455 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -1037,6 +1037,12 @@ void QWebEnginePagePrivate::renderProcessTerminated(RenderProcessTerminationStat terminationStatus), exitCode); } +void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry) +{ + Q_Q(QWebEnginePage); + Q_EMIT q->geometryChangeRequested(geometry); +} + QMenu *QWebEnginePage::createStandardContextMenu() { Q_D(QWebEnginePage); diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 01f7ce42f..9cc4553d1 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -123,6 +123,7 @@ public: virtual void moveValidationMessage(const QRect &anchor) Q_DECL_OVERRIDE; virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) Q_DECL_OVERRIDE; + virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE; virtual QtWebEngineCore::BrowserContextAdapter *browserContextAdapter() Q_DECL_OVERRIDE; -- cgit v1.2.3 From bbf1d3d981da0a12a0ad610b17e365ccddf58c6c Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Mon, 18 Jan 2016 02:26:49 -0800 Subject: Widgets: Add example names to documentation Change-Id: I73f6e944e3a64b948b86882e951f85593fdb800f Reviewed-by: Leena Miettinen --- src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc index 9d03527e1..397b9f51b 100644 --- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc @@ -75,9 +75,9 @@ If you want to provide support for web sites that allow the user to open new windows, such as pop-up windows, you can subclass QWebEngineView and reimplement the createWindow() function. + + \sa {WebEngine Demo Browser Example}, {WebEngine Content Manipulation Example}, {Markdown Editor Example} */ -// FIXME: reintroduce the following when we have proper names for the examples. -// \sa {WebEngine Tab Browser Example}, {WebEngine Fancy Browser Example} /*! -- cgit v1.2.3 From 07b431f20f2d6827f944087775f3dd1bd3f69aea Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 19 Jan 2016 16:31:49 +0100 Subject: Avoid full storage update on installing URL scheme handlers When installing/removing URL scheme handlers, do not update the full URLRequestContextStorage. Only update the job factory. This avoids calling the - potentially expensive - generateStorage() method superfluously often. Change-Id: I99c4ec479fcfdee4e97d86b858ea42f3cdccfec4 Task-number: QTBUG-50160 Reviewed-by: Allan Sandfeld Jensen --- src/core/browser_context_adapter.cpp | 2 +- src/core/url_request_context_getter_qt.cpp | 10 ++++++++-- src/core/url_request_context_getter_qt.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index 4aa34e5d6..52674e8bd 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -354,7 +354,7 @@ QHash &BrowserContextAdapter::customUr void BrowserContextAdapter::updateCustomUrlSchemeHandlers() { if (m_browserContext->url_request_getter_.get()) - m_browserContext->url_request_getter_->updateStorageSettings(); + m_browserContext->url_request_getter_->updateJobFactory(); } bool BrowserContextAdapter::removeCustomUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler) diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 26e2633d8..618354d1c 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -294,6 +294,13 @@ void URLRequestContextGetterQt::updateHttpCache() } } +void URLRequestContextGetterQt::updateJobFactory() +{ + Q_ASSERT(m_jobFactory); + + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestContextGetterQt::generateJobFactory, this)); +} + static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &first, const net::HttpNetworkSession::Params &second) { if (first.transport_security_state != second.transport_security_state) @@ -389,8 +396,8 @@ void URLRequestContextGetterQt::generateHttpCache() void URLRequestContextGetterQt::generateJobFactory() { Q_ASSERT(m_urlRequestContext); - Q_ASSERT(!m_jobFactory); + m_jobFactory.reset(); scoped_ptr jobFactory(new net::URLRequestJobFactoryImpl()); { @@ -398,7 +405,6 @@ void URLRequestContextGetterQt::generateJobFactory() content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme); Q_ASSERT(it != m_protocolHandlers.end()); jobFactory->SetProtocolHandler(it->first, it->second.release()); - m_protocolHandlers.clear(); } jobFactory->SetProtocolHandler(url::kDataScheme, new net::DataProtocolHandler()); diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index f61e4f09b..8740c65a2 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -77,6 +77,7 @@ public: void updateUserAgent(); void updateCookieStore(); void updateHttpCache(); + void updateJobFactory(); private: virtual ~URLRequestContextGetterQt(); -- cgit v1.2.3 From 52d9eeab53b5cfd92c15c9a25894991f84cd827e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 12 Jan 2016 13:10:44 +0100 Subject: Doc: warn about heavy routines blocking content rendering Task-number: QTBUG-50092 Change-Id: I1f3bbcab3b1999b9ecc86660ff9fef8330775cb4 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/doc/src/webengineview.qdoc | 3 +++ src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index bfdeab984..a8cd1eb56 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -251,6 +251,9 @@ The script will run in the same \e world as other scripts that are part of the loaded site. + \warning Do not execute lengthy routines in the callback function, because it might block the + rendering of the web content. + See WebEngineView::userScripts for an alternative API to inject scripts. */ diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index 22eacfda9..aac5228d6 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -635,6 +635,9 @@ page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); }); \endcode + \warning Do not execute lengthy routines in the callback function, because it might block the + rendering of the web engine page. + See scripts() for an alternative API to inject scripts. */ -- cgit v1.2.3 From 3b55e720a52ffbf0a00433d0016f759eef50be77 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 22 Jan 2016 14:16:32 +0100 Subject: Doc: Corrected reference to BrowserWindow.qml Change-Id: Ie6da4f94233a336c497074a5a9a83d27a86329ae Task-number: QTBUG-43810 Reviewed-by: Martin Smith --- src/webengine/api/qquickwebenginehistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp index 050833b28..d56dbc7a7 100644 --- a/src/webengine/api/qquickwebenginehistory.cpp +++ b/src/webengine/api/qquickwebenginehistory.cpp @@ -258,7 +258,7 @@ QQuickWebEngineHistoryPrivate::~QQuickWebEngineHistoryPrivate() The data models can also be used to create a menu, as illustrated by the following code snippet: - \quotefromfile webengine/quicknanobrowser/browserwindow.qml + \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml \skipto ToolBar \printuntil onObjectRemoved \printuntil } -- cgit v1.2.3 From 003e02b4c4047cc590701caf72241892688da82e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Jan 2016 14:07:03 +0100 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulls in the fixes for public CVEs fixed in Chromium 48. Change-Id: I8738c7d0631e2e42ad844ada2b43dd614b4518c8 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 4cb3a5a4f..b93352c98 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 4cb3a5a4f03774ae47d69a84a3423d14e59a2d2e +Subproject commit b93352c98510fef629d11e8dda91e14aac855f62 -- cgit v1.2.3 From 4fa6a7a7c7e15a560bd8503fb5c0dc2e6d1024c1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 21 Jan 2016 18:38:47 +0100 Subject: Fix deadlock on QWebEngineUrlRequestJob::fail URLRequestCustomJob::notifyFailure calls NotifyStartError(status), which in turn will result in a call to URLRequestCustomJob::Kill. We must release the lock of m_mutex before calling NotifyStartError, otherwise m_mutex.lock() will wait forever in Kill. Change-Id: I319e45049766c2192dfc46a91b352b92ec677bc6 Task-number: QTBUG-50160 Reviewed-by: Allan Sandfeld Jensen --- src/core/url_request_custom_job.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp index 1b6f1c767..907f71c2e 100644 --- a/src/core/url_request_custom_job.cpp +++ b/src/core/url_request_custom_job.cpp @@ -222,13 +222,17 @@ void URLRequestCustomJob::fail(int error) void URLRequestCustomJob::notifyFailure() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - QMutexLocker lock(&m_mutex); + m_mutex.lock(); if (m_device) m_device->close(); - if (m_started) - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, m_error)); + const URLRequestStatus status(URLRequestStatus::FAILED, m_error); + const bool started = m_started; + m_mutex.unlock(); + + if (started) + NotifyDone(status); else - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, m_error)); + NotifyStartError(status); } void URLRequestCustomJob::startAsync() -- cgit v1.2.3 From bf614638ed278a41573eb0987dd65f91a004e04a Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 19 Jan 2016 05:58:28 -0500 Subject: Add the Google Chrome path for pepper Flash on Linux This is the path used when installing the official Chrome deb packages on Ubuntu. Change-Id: Iaa30c1df17ba2c6d069d17f828ecbbd26d16237b Reviewed-by: Kai Koehne --- src/core/content_client_qt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index c8b23efab..3e5b96b41 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -118,7 +118,8 @@ void AddPepperFlashFromSystem(std::vector* plugins) pluginPaths << "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"; // Mac OS X #endif #if defined(Q_OS_LINUX) - pluginPaths << "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" // Ubuntu + pluginPaths << "/opt/google/chrome/PepperFlash/libpepflashplayer.so" // Google Chrome + << "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" // Ubuntu << "/usr/lib/PepperFlash/libpepflashplayer.so" // Arch << "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so"; // OpenSuSE #endif -- cgit v1.2.3 From d7cdbe5596bc51d7628d0f566730d4b2d09e462e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 20 Jan 2016 16:03:13 +0100 Subject: Document OS X 10.9 dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-48779 Change-Id: Iaf189f69a9c4434a9417d482e63b83d8fc2f58b1 Reviewed-by: Michael Brüning Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index 555db2a2d..3e30e9606 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -47,7 +47,7 @@ \list \li Windows: Visual Studio 2013 or Visual Studio 2015 \li Linux: Clang or GCC version 4.7 or later - \li OS X: Xcode version 5.1 or later + \li OS X: Xcode version 5.1 or later on OS X 10.9 or later \endlist \section1 Pepper Plugin API Support -- cgit v1.2.3 From 9cd2cd641cde4fd958150a6ee20645e7125580ed Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 20 Jan 2016 14:14:24 +0100 Subject: Fix asserts in touch handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate touch events with the "causesScrollingIfUncanceled" property set to true. This is checked by TouchEventQueue::TouchMoveSlopSuppressor Task-number: QTBUG-50511 Change-Id: I5260100db75ed7afdd7afeff8f530221c22090b0 Reviewed-by: Michael Brüning --- src/core/render_widget_host_view_qt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index fbfa12e91..4a773bc19 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -839,7 +839,9 @@ void RenderWidgetHostViewQt::processMotionEvent(const ui::MotionEvent &motionEve if (!m_gestureProvider.OnTouchEvent(motionEvent).succeeded) return; - blink::WebTouchEvent touchEvent = ui::CreateWebTouchEventFromMotionEvent(motionEvent, false); + bool causesScrollingIfUncancelled = true; + blink::WebTouchEvent touchEvent = ui::CreateWebTouchEventFromMotionEvent(motionEvent, + causesScrollingIfUncancelled); m_host->ForwardTouchEventWithLatencyInfo(touchEvent, CreateLatencyInfo(touchEvent)); } -- cgit v1.2.3 From 4acae115d5fc0177f0fdb1af969dbc5ed501b659 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 21 Jan 2016 12:41:41 +0100 Subject: Copy all resource files to build directory Change-Id: I1a4b96a2a695b4be4e936275c59f939b887098d1 Reviewed-by: Allan Sandfeld Jensen --- src/core/core_module.pro | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core/core_module.pro b/src/core/core_module.pro index b001fef06..5300fdbbc 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -77,13 +77,22 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat } !contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) { - ICU_TARGET = $$shell_path($$[QT_INSTALL_DATA/get]/resources/icudtl.dat) - ICU_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/icudtl.dat) - icu_rule.target = $$ICU_TARGET - unix: icu_rule.commands = if [ -e $$ICU_FILE ] ; then $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ; fi - win32: icu_rule.commands = if exist $$ICU_FILE ( $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ) - - QMAKE_EXTRA_TARGETS += icu_rule - PRE_TARGETDEPS += $$ICU_TARGET + # + # Copy essential files to the qtbase build directory (for non-installed developer builds) + # + + icudt2build.input = icu.files + icudt2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} + icudt2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + icudt2build.name = COPY ${QMAKE_FILE_IN} + icudt2build.CONFIG = no_link no_clean target_predeps + + resources2build.input = resources.files + resources2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} + resources2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + resources2build.name = COPY ${QMAKE_FILE_IN} + resources2build.CONFIG = no_link no_clean target_predeps + + QMAKE_EXTRA_COMPILERS += icudt2build resources2build } } -- cgit v1.2.3 From eeb18149fa6d796dd5202f080b828099a9187046 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 26 Jan 2016 17:35:06 +0100 Subject: Fix occasional "WeakPtrs must be checked on the same sequenced thread." Revert 7c7ee9a9, and fix the issue by passing a raw this pointer to startAsync. Bind will take care of calling AddRef/Release for us. Otherwise the WeakPtr would get assigned to the UI thread and must be invalidated in the same. Change-Id: Iee741dde521cf085a086e397a8154fa1384d58d1 Task-number: QTBUG-49670 Reviewed-by: Allan Sandfeld Jensen --- src/core/url_request_custom_job.cpp | 17 ++++++++--------- src/core/url_request_custom_job.h | 3 +-- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp index 907f71c2e..84c898c3a 100644 --- a/src/core/url_request_custom_job.cpp +++ b/src/core/url_request_custom_job.cpp @@ -60,8 +60,7 @@ URLRequestCustomJob::URLRequestCustomJob(URLRequest *request, NetworkDelegate *n , m_schemeHandler(schemeHandler) , m_error(0) , m_started(false) - , m_weakFactoryIO(this) - , m_weakFactoryUI(this) + , m_weakFactory(this) { } @@ -79,7 +78,8 @@ URLRequestCustomJob::~URLRequestCustomJob() void URLRequestCustomJob::Start() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, base::Bind(&URLRequestCustomJob::startAsync, m_weakFactoryIO.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, + base::Bind(&URLRequestCustomJob::startAsync, this)); } void URLRequestCustomJob::Kill() @@ -94,8 +94,7 @@ void URLRequestCustomJob::Kill() if (m_device && m_device->isOpen()) m_device->close(); m_device = 0; - m_weakFactoryIO.InvalidateWeakPtrs(); - m_weakFactoryUI.InvalidateWeakPtrs(); + m_weakFactory.InvalidateWeakPtrs(); URLRequestJob::Kill(); } @@ -153,7 +152,7 @@ void URLRequestCustomJob::setReplyDevice(QIODevice *device) m_device->open(QIODevice::ReadOnly); if (m_device && m_device->isReadable()) - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactoryUI.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactory.GetWeakPtr())); else fail(ERR_INVALID_URL); } @@ -181,7 +180,7 @@ void URLRequestCustomJob::redirect(const GURL &url) QMutexLocker lock(&m_mutex); m_redirect = url; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactoryUI.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactory.GetWeakPtr())); } void URLRequestCustomJob::abort() @@ -191,7 +190,7 @@ void URLRequestCustomJob::abort() if (m_device && m_device->isOpen()) m_device->close(); m_device = 0; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyCanceled, m_weakFactoryUI.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyCanceled, m_weakFactory.GetWeakPtr())); } void URLRequestCustomJob::notifyCanceled() @@ -216,7 +215,7 @@ void URLRequestCustomJob::fail(int error) DCHECK_CURRENTLY_ON(content::BrowserThread::UI); QMutexLocker lock(&m_mutex); m_error = error; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyFailure, m_weakFactoryUI.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyFailure, m_weakFactory.GetWeakPtr())); } void URLRequestCustomJob::notifyFailure() diff --git a/src/core/url_request_custom_job.h b/src/core/url_request_custom_job.h index be5cae43c..a994c467a 100644 --- a/src/core/url_request_custom_job.h +++ b/src/core/url_request_custom_job.h @@ -87,8 +87,7 @@ private: int m_error; GURL m_redirect; bool m_started; - base::WeakPtrFactory m_weakFactoryIO; - base::WeakPtrFactory m_weakFactoryUI; + base::WeakPtrFactory m_weakFactory; friend class URLRequestCustomJobDelegate; -- cgit v1.2.3 From fd7f2367515bd243a171ae1234b3443d6f24955d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 27 Jan 2016 11:21:53 +0100 Subject: Fix multi-thread protection in custom url handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The classes were not properly protected against race conditions. To solve this there is now a class shared between the two thread that is not deleted until the classes on both threads have been deleted. Change-Id: I499bd98805ae7a195aca42f30610eb6c2b0fd0f7 Reviewed-by: Michael Brüning Reviewed-by: Joerg Bornemann --- src/core/api/qwebengineurlrequestjob.h | 4 +- src/core/url_request_custom_job.cpp | 231 +++++++++++++++++++-------- src/core/url_request_custom_job.h | 40 +++-- src/core/url_request_custom_job_delegate.cpp | 19 +-- src/core/url_request_custom_job_delegate.h | 8 +- 5 files changed, 206 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h index 922299fd9..84741b791 100644 --- a/src/core/api/qwebengineurlrequestjob.h +++ b/src/core/api/qwebengineurlrequestjob.h @@ -44,8 +44,8 @@ #include namespace QtWebEngineCore { -class URLRequestCustomJob; class URLRequestCustomJobDelegate; +class URLRequestCustomJobShared; } // namespace QT_BEGIN_NAMESPACE @@ -76,7 +76,7 @@ public: private: QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *); - friend class QtWebEngineCore::URLRequestCustomJob; + friend class QtWebEngineCore::URLRequestCustomJobShared; QtWebEngineCore::URLRequestCustomJobDelegate* d_ptr; }; diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp index 84c898c3a..07087c247 100644 --- a/src/core/url_request_custom_job.cpp +++ b/src/core/url_request_custom_job.cpp @@ -56,45 +56,33 @@ namespace QtWebEngineCore { URLRequestCustomJob::URLRequestCustomJob(URLRequest *request, NetworkDelegate *networkDelegate, QWebEngineUrlSchemeHandler *schemeHandler) : URLRequestJob(request, networkDelegate) - , m_device(0) , m_schemeHandler(schemeHandler) - , m_error(0) - , m_started(false) - , m_weakFactory(this) + , m_shared(new URLRequestCustomJobShared(this)) { } URLRequestCustomJob::~URLRequestCustomJob() { - QMutexLocker lock(&m_mutex); - if (m_delegate) { - m_delegate->m_job = 0; - m_delegate->deleteLater(); - } - if (m_device && m_device->isOpen()) - m_device->close(); + if (m_shared) + m_shared->killJob(); +} + +static void startAsync(URLRequestCustomJobShared *shared) +{ + shared->startAsync(); } void URLRequestCustomJob::Start() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - base::Bind(&URLRequestCustomJob::startAsync, this)); + content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, base::Bind(&startAsync, m_shared)); } void URLRequestCustomJob::Kill() { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - QMutexLocker lock(&m_mutex); - if (m_delegate) { - m_delegate->m_job = 0; - m_delegate->deleteLater(); - } - m_delegate = 0; - if (m_device && m_device->isOpen()) - m_device->close(); - m_device = 0; - m_weakFactory.InvalidateWeakPtrs(); + if (m_shared) + m_shared->killJob(); + m_shared = 0; URLRequestJob::Kill(); } @@ -102,8 +90,11 @@ void URLRequestCustomJob::Kill() bool URLRequestCustomJob::GetMimeType(std::string *mimeType) const { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - if (m_mimeType.size() > 0) { - *mimeType = m_mimeType; + if (!m_shared) + return false; + QMutexLocker lock(&m_shared->m_mutex); + if (m_shared->m_mimeType.size() > 0) { + *mimeType = m_shared->m_mimeType; return true; } return false; @@ -112,8 +103,11 @@ bool URLRequestCustomJob::GetMimeType(std::string *mimeType) const bool URLRequestCustomJob::GetCharset(std::string* charset) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - if (m_charset.size() > 0) { - *charset = m_charset; + if (!m_shared) + return false; + QMutexLocker lock(&m_shared->m_mutex); + if (m_shared->m_charset.size() > 0) { + *charset = m_shared->m_charset; return true; } return false; @@ -122,128 +116,223 @@ bool URLRequestCustomJob::GetCharset(std::string* charset) bool URLRequestCustomJob::IsRedirectResponse(GURL* location, int* http_status_code) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - QMutexLocker lock(&m_mutex); - if (m_redirect.is_valid()) { - *location = m_redirect; + if (!m_shared) + return false; + QMutexLocker lock(&m_shared->m_mutex); + if (m_shared->m_redirect.is_valid()) { + *location = m_shared->m_redirect; *http_status_code = 303; return true; } return false; } -void URLRequestCustomJob::setReplyMimeType(const std::string &mimeType) +bool URLRequestCustomJob::ReadRawData(IOBuffer *buf, int bufSize, int *bytesRead) +{ + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + Q_ASSERT(bytesRead); + Q_ASSERT(m_shared); + QMutexLocker lock(&m_shared->m_mutex); + qint64 rv = m_shared->m_device ? m_shared->m_device->read(buf->data(), bufSize) : -1; + if (rv >= 0) { + *bytesRead = static_cast(rv); + return true; + } else { + NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, ERR_FAILED)); + } + return false; +} + +URLRequestCustomJobShared::URLRequestCustomJobShared(URLRequestCustomJob *job) + : m_mutex(QMutex::Recursive) + , m_job(job) + , m_delegate(0) + , m_error(0) + , m_started(false) + , m_asyncInitialized(false) + , m_weakFactory(this) +{ +} + +URLRequestCustomJobShared::~URLRequestCustomJobShared() +{ + Q_ASSERT(!m_job); + Q_ASSERT(!m_delegate); +} + +void URLRequestCustomJobShared::killJob() +{ + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + QMutexLocker lock(&m_mutex); + m_job = 0; + bool doDelete = false; + if (m_delegate) { + m_delegate->deleteLater(); + } else { + // Do not delete yet if startAsync has not yet run. + doDelete = m_asyncInitialized; + } + if (m_device && m_device->isOpen()) + m_device->close(); + m_device = 0; + m_weakFactory.InvalidateWeakPtrs(); + lock.unlock(); + if (doDelete) + delete this; +} + +void URLRequestCustomJobShared::unsetJobDelegate() +{ + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + QMutexLocker lock(&m_mutex); + m_delegate = 0; + bool doDelete = false; + if (m_job) + abort(); + else + doDelete = true; + lock.unlock(); + if (doDelete) + delete this; +} + +void URLRequestCustomJobShared::setReplyMimeType(const std::string &mimeType) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + QMutexLocker lock(&m_mutex); m_mimeType = mimeType; } -void URLRequestCustomJob::setReplyCharset(const std::string &charset) +void URLRequestCustomJobShared::setReplyCharset(const std::string &charset) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + QMutexLocker lock(&m_mutex); m_charset = charset; } -void URLRequestCustomJob::setReplyDevice(QIODevice *device) +void URLRequestCustomJobShared::setReplyDevice(QIODevice *device) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); QMutexLocker lock(&m_mutex); + if (!m_job) + return; m_device = device; if (m_device && !m_device->isReadable()) m_device->open(QIODevice::ReadOnly); if (m_device && m_device->isReadable()) - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactory.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyStarted, m_weakFactory.GetWeakPtr())); else fail(ERR_INVALID_URL); } -bool URLRequestCustomJob::ReadRawData(IOBuffer *buf, int bufSize, int *bytesRead) -{ - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - Q_ASSERT(bytesRead); - QMutexLocker lock(&m_mutex); - qint64 rv = m_device ? m_device->read(buf->data(), bufSize) : -1; - if (rv >= 0) { - *bytesRead = static_cast(rv); - return true; - } else { - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, ERR_FAILED)); - } - return false; -} - -void URLRequestCustomJob::redirect(const GURL &url) +void URLRequestCustomJobShared::redirect(const GURL &url) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (m_device || m_error) - return; QMutexLocker lock(&m_mutex); + if (m_device || m_error) + return; + if (!m_job) + return; m_redirect = url; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyStarted, m_weakFactory.GetWeakPtr())); + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyStarted, m_weakFactory.GetWeakPtr())); } -void URLRequestCustomJob::abort() +void URLRequestCustomJobShared::abort() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); QMutexLocker lock(&m_mutex); if (m_device && m_device->isOpen()) m_device->close(); m_device = 0; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyCanceled, m_weakFactory.GetWeakPtr())); + if (!m_job) + return; + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyCanceled, m_weakFactory.GetWeakPtr())); } -void URLRequestCustomJob::notifyCanceled() +void URLRequestCustomJobShared::notifyCanceled() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + QMutexLocker lock(&m_mutex); + if (!m_job) + return; if (m_started) - NotifyDone(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED)); + m_job->NotifyDone(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED)); else - NotifyStartError(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED)); + m_job->NotifyStartError(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED)); } -void URLRequestCustomJob::notifyStarted() +void URLRequestCustomJobShared::notifyStarted() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + QMutexLocker lock(&m_mutex); + if (!m_job) + return; Q_ASSERT(!m_started); m_started = true; - NotifyHeadersComplete(); + m_job->NotifyHeadersComplete(); } -void URLRequestCustomJob::fail(int error) +void URLRequestCustomJobShared::fail(int error) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); QMutexLocker lock(&m_mutex); m_error = error; - content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJob::notifyFailure, m_weakFactory.GetWeakPtr())); + if (!m_job) + return; + content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyFailure, m_weakFactory.GetWeakPtr())); } -void URLRequestCustomJob::notifyFailure() +void URLRequestCustomJobShared::notifyFailure() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - m_mutex.lock(); + QMutexLocker lock(&m_mutex); + if (!m_job) + return; if (m_device) m_device->close(); const URLRequestStatus status(URLRequestStatus::FAILED, m_error); const bool started = m_started; - m_mutex.unlock(); if (started) - NotifyDone(status); + m_job->NotifyDone(status); else - NotifyStartError(status); + m_job->NotifyStartError(status); } -void URLRequestCustomJob::startAsync() +GURL URLRequestCustomJobShared::requestUrl() +{ + QMutexLocker lock(&m_mutex); + if (!m_job) + return GURL(); + return m_job->request()->url(); +} + +std::string URLRequestCustomJobShared::requestMethod() +{ + QMutexLocker lock(&m_mutex); + if (!m_job) + return std::string(); + return m_job->request()->method(); +} + +void URLRequestCustomJobShared::startAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); Q_ASSERT(!m_started); Q_ASSERT(!m_delegate); QMutexLocker lock(&m_mutex); + if (!m_job) { + lock.unlock(); + delete this; + return; + } m_delegate = new URLRequestCustomJobDelegate(this); - lock.unlock(); + m_asyncInitialized = true; QWebEngineUrlRequestJob *requestJob = new QWebEngineUrlRequestJob(m_delegate); - m_schemeHandler->requestStarted(requestJob); + if (m_job) + m_job->m_schemeHandler->requestStarted(requestJob); } } // namespace diff --git a/src/core/url_request_custom_job.h b/src/core/url_request_custom_job.h index a994c467a..eedb41814 100644 --- a/src/core/url_request_custom_job.h +++ b/src/core/url_request_custom_job.h @@ -50,6 +50,7 @@ QT_FORWARD_DECLARE_CLASS(QWebEngineUrlSchemeHandler) namespace QtWebEngineCore { class URLRequestCustomJobDelegate; +class URLRequestCustomJobShared; // A request job that handles reading custom URL schemes class URLRequestCustomJob : public net::URLRequestJob { @@ -62,6 +63,25 @@ public: virtual bool GetCharset(std::string *charset) Q_DECL_OVERRIDE; virtual bool IsRedirectResponse(GURL* location, int* http_status_code) Q_DECL_OVERRIDE; +protected: + virtual ~URLRequestCustomJob(); + +private: + QWebEngineUrlSchemeHandler *m_schemeHandler; + URLRequestCustomJobShared *m_shared; + + friend class URLRequestCustomJobShared; + + DISALLOW_COPY_AND_ASSIGN(URLRequestCustomJob); +}; + +// A shared state between URLRequestCustomJob living on the IO thread +// and URLRequestCustomJobDelegate living on the UI thread. +class URLRequestCustomJobShared { +public: + URLRequestCustomJobShared(URLRequestCustomJob *job); + ~URLRequestCustomJobShared(); + void setReplyMimeType(const std::string &); void setReplyCharset(const std::string &); void setReplyDevice(QIODevice *); @@ -70,28 +90,28 @@ public: void fail(int); void abort(); -protected: - virtual ~URLRequestCustomJob(); + void killJob(); + void unsetJobDelegate(); + void startAsync(); void notifyStarted(); void notifyFailure(); void notifyCanceled(); -private: + GURL requestUrl(); + std::string requestMethod(); + QMutex m_mutex; QPointer m_device; - QPointer m_delegate; - QWebEngineUrlSchemeHandler *m_schemeHandler; + URLRequestCustomJob *m_job; + URLRequestCustomJobDelegate *m_delegate; std::string m_mimeType; std::string m_charset; int m_error; GURL m_redirect; bool m_started; - base::WeakPtrFactory m_weakFactory; - - friend class URLRequestCustomJobDelegate; - - DISALLOW_COPY_AND_ASSIGN(URLRequestCustomJob); + bool m_asyncInitialized; + base::WeakPtrFactory m_weakFactory; }; } // namespace QtWebEngineCore diff --git a/src/core/url_request_custom_job_delegate.cpp b/src/core/url_request_custom_job_delegate.cpp index 0650242c8..1a3e08e52 100644 --- a/src/core/url_request_custom_job_delegate.cpp +++ b/src/core/url_request_custom_job_delegate.cpp @@ -44,39 +44,40 @@ namespace QtWebEngineCore { -URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(URLRequestCustomJob *job) - : m_job(job) +URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(URLRequestCustomJobShared *shared) + : m_shared(shared) { } URLRequestCustomJobDelegate::~URLRequestCustomJobDelegate() { + m_shared->unsetJobDelegate(); } QUrl URLRequestCustomJobDelegate::url() const { - return toQt(m_job->request()->url()); + return toQt(m_shared->requestUrl()); } QByteArray URLRequestCustomJobDelegate::method() const { - return QByteArray::fromStdString(m_job->request()->method()); + return QByteArray::fromStdString(m_shared->requestMethod()); } void URLRequestCustomJobDelegate::setReply(const QByteArray &contentType, QIODevice *device) { - m_job->setReplyMimeType(contentType.toStdString()); - m_job->setReplyDevice(device); + m_shared->setReplyMimeType(contentType.toStdString()); + m_shared->setReplyDevice(device); } void URLRequestCustomJobDelegate::abort() { - m_job->abort(); + m_shared->abort(); } void URLRequestCustomJobDelegate::redirect(const QUrl &url) { - m_job->redirect(toGurl(url)); + m_shared->redirect(toGurl(url)); } void URLRequestCustomJobDelegate::fail(Error error) @@ -102,7 +103,7 @@ void URLRequestCustomJobDelegate::fail(Error error) break; } if (net_error) - m_job->fail(net_error); + m_shared->fail(net_error); } } // namespace diff --git a/src/core/url_request_custom_job_delegate.h b/src/core/url_request_custom_job_delegate.h index 5b6137820..e066e85cc 100644 --- a/src/core/url_request_custom_job_delegate.h +++ b/src/core/url_request_custom_job_delegate.h @@ -46,7 +46,7 @@ QT_FORWARD_DECLARE_CLASS(QIODevice) namespace QtWebEngineCore { -class URLRequestCustomJob; +class URLRequestCustomJobShared; class QWEBENGINE_EXPORT URLRequestCustomJobDelegate : public QObject { Q_OBJECT @@ -72,10 +72,10 @@ public: void fail(Error); private: - URLRequestCustomJobDelegate(URLRequestCustomJob *job); + URLRequestCustomJobDelegate(URLRequestCustomJobShared *shared); - friend class URLRequestCustomJob; - URLRequestCustomJob *m_job; + friend class URLRequestCustomJobShared; + URLRequestCustomJobShared *m_shared; }; } // namespace -- cgit v1.2.3 From ae4b0583e4d62b6fe660b316e8a9c117c8b85881 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 22 Jan 2016 16:45:09 +0100 Subject: Doc: rendering to OpenGL Surface Task-number: QTBUG-50037 Change-Id: I9c7a09824172a09d8b454bf8ff5d358c00ce6b88 Reviewed-by: Joerg Bornemann --- src/webengine/doc/src/webengineview.qdoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc index a8cd1eb56..1d71a9cd9 100644 --- a/src/webengine/doc/src/webengineview.qdoc +++ b/src/webengine/doc/src/webengineview.qdoc @@ -29,6 +29,22 @@ \inqmlmodule QtWebEngine \since QtWebEngine 1.0 \brief A WebEngineView renders web content within a QML application. + + The WebEngineView type enables QML applications to render regions of dynamic web content. It + may share the screen with other QML types, such as a TabView, or fill the screen, as specified + within the QML application. + + \section1 Rendering to OpenGL Surface + + When using a QQuickRenderControl to render a Qt Quick user interface to an OpenGL surface, the + WebEngineView type is not rendered correctly. The web engine view attempts to use a global + OpenGL context created by \l QtWebEngine::initialize(), but there is no public API for accessing + that context in order to share it with the \c QQuickRenderControl context. + + To have the web engine view rendered correctly, it is possible to manually create a new + offscreen context that is shared with the \c QQuickRenderControl and to call the non-public + function \c qt_gl_set_global_share_context(), rather than calling \c initialize(). + If \c initialize() is called after setting a global context, it will do nothing. */ /*! -- cgit v1.2.3 From 64da0f73b2f8a2f936113fd556c9477cea441ded Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 15 Jan 2016 16:47:06 +0100 Subject: Fix crash on exit for view-owned QWebEngineUrlSchemeHandler objects For view-owned URL scheme handlers the destructor would remove the handler and then trigger URLRequestContextGetterQt::generateStorage. This would access the browser context from the IO thread while it already has been destroyed on the browser thread. Increment the ref count for the browser context before every call of generateStorage, and decrement it when generateStorage is finished. Task-number: QTBUG-50160 Change-Id: Id8b1505891ec56e93bf9d47f33bb8bc3304eb55a Reviewed-by: Kai Koehne --- src/core/url_request_context_getter_qt.cpp | 5 +++-- src/core/url_request_context_getter_qt.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 618354d1c..20efec295 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -127,8 +127,9 @@ void URLRequestContextGetterQt::updateStorageSettings() content::BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), content::BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) )); - if (m_storage) + if (m_storage) { content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestContextGetterQt::generateStorage, this)); + } } } @@ -283,7 +284,7 @@ void URLRequestContextGetterQt::generateUserAgent() Q_ASSERT(m_urlRequestContext); Q_ASSERT(m_storage); - m_storage->set_http_user_agent_settings(new HttpUserAgentSettingsQt(m_browserContext)); + m_storage->set_http_user_agent_settings(new HttpUserAgentSettingsQt(m_browserContext.constData())); } void URLRequestContextGetterQt::updateHttpCache() diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index 8740c65a2..555d56784 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -94,7 +94,7 @@ private: bool m_ignoreCertificateErrors; QAtomicInt m_updateCookieStore; QAtomicInt m_updateHttpCache; - BrowserContextAdapter *m_browserContext; + QExplicitlySharedDataPointer m_browserContext; content::ProtocolHandlerMap m_protocolHandlers; QAtomicPointer m_proxyConfigService; -- cgit v1.2.3 From 52f039fe09d0c0cfd9e988b8b15293a9b5d7583d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 Jan 2016 11:10:51 +0100 Subject: Fix crash on open link in new window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default implementation of QWebEngineView::createWindow returns a null pointer. Add missing null pointer check in adoptNewWindow. Change-Id: Ia6138f372ff169b9d32764b15550939adc247a1c Task-number: QTBUG-50718 Reviewed-by: Michael Brüning --- src/webenginewidgets/api/qwebenginepage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index aacf6c455..511ddfb0f 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -227,6 +227,8 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W Q_UNUSED(userGesture); QWebEnginePage *newPage = q->createWindow(toWindowType(disposition)); + if (!newPage) + return; // Mark the new page as being in the process of being adopted, so that a second mouse move event // sent by newWebContents->initialize() gets filtered in RenderWidgetHostViewQt::forwardEvent. @@ -240,7 +242,7 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W newPage->d_func()->m_isBeingAdopted = true; // Overwrite the new page's WebContents with ours. - if (newPage && newPage->d_func() != this) { + if (newPage->d_func() != this) { newPage->d_func()->adapter = newWebContents; newWebContents->initialize(newPage->d_func()); if (!initialGeometry.isEmpty()) -- cgit v1.2.3 From 23c652c3c1680f42adfd5c6500280b103ce1d095 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 29 Jan 2016 13:10:59 +0100 Subject: Disable printing in Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disabling printing saves us compiling those files and files off a megabyte on the debug binary. To keep all the configure options in config, the common options are moved to a shared common.pri. Change-Id: Ieffdf9eb7dca58cfdafadd85bd24ea9c2be55ece Reviewed-by: Michael Brüning --- src/core/config/common.pri | 8 ++++++++ src/core/config/embedded_qnx.pri | 2 ++ src/core/config/linux.pri | 2 ++ src/core/config/mac_osx.pri | 2 ++ src/core/config/windows.pri | 2 ++ 5 files changed, 16 insertions(+) create mode 100644 src/core/config/common.pri (limited to 'src') diff --git a/src/core/config/common.pri b/src/core/config/common.pri new file mode 100644 index 000000000..793e26a61 --- /dev/null +++ b/src/core/config/common.pri @@ -0,0 +1,8 @@ +# Shared configuration for all our supported platforms + +# Trigger Qt-specific build conditions. +GYP_CONFIG += use_qt=1 +# We do not want to ship more external binary blobs, so let v8 embed its startup data. +GYP_CONFIG += v8_use_external_startup_data=0 +# Disable printing since we don't support it yet +GYP_CONFIG += enable_basic_printing=0 enable_print_preview=0 diff --git a/src/core/config/embedded_qnx.pri b/src/core/config/embedded_qnx.pri index 7fd35c976..34470d2d8 100644 --- a/src/core/config/embedded_qnx.pri +++ b/src/core/config/embedded_qnx.pri @@ -1,5 +1,7 @@ GYP_ARGS += "-D qt_os=\"embedded_qnx\" -I config/embedded_qnx.gypi" +include(common.pri) + GYP_CONFIG += \ disable_nacl=1 \ enable_plugins=0 \ diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 9868d6848..1035e950e 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -1,3 +1,5 @@ +include(common.pri) + # linux_use_bundled_gold currently relies on a hardcoded relative path from chromium/src/out/(Release|Debug) # Disable it along with the -Wl,--threads flag just in case gold isn't installed on the system. GYP_CONFIG += \ diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri index 93c77623c..940b47982 100644 --- a/src/core/config/mac_osx.pri +++ b/src/core/config/mac_osx.pri @@ -1,3 +1,5 @@ +include(common.pri) + QMAKE_CLANG_DIR = "/usr" QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX) !isEmpty(QMAKE_CLANG_PATH) { diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri index 1e875f308..760ed5b6f 100644 --- a/src/core/config/windows.pri +++ b/src/core/config/windows.pri @@ -1,5 +1,7 @@ GYP_ARGS += "-D qt_os=\"win32\" -I config/windows.gypi" +include(common.pri) + GYP_CONFIG += \ disable_nacl=1 \ remoting=0 \ -- cgit v1.2.3 From ef1f608f76f02f11b4bdcc8d52fa41cdf4cdf5c3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 29 Jan 2016 15:57:18 +0100 Subject: Preserve webchannel and userscripts when restoring history Most page-state is set in webcontentsadapter::initialize except user scripts and webchannel. This patch ensures those are initialized too when changing to a new adapter during history restore. Change-Id: I4dca23ddab50480b1a72252a038834ce1802ad77 Task-number: QTBUG-50751 Reviewed-by: Kai Koehne Reviewed-by: David Rosca --- src/webenginewidgets/api/qwebenginepage.cpp | 14 ++++++++++++-- src/webenginewidgets/api/qwebenginepage_p.h | 1 + src/webenginewidgets/api/qwebenginescriptcollection.cpp | 12 ++++++++++++ src/webenginewidgets/api/qwebenginescriptcollection_p.h | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 511ddfb0f..b1bf33067 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -107,6 +107,7 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) , m_isBeingAdopted(false) , m_backgroundColor(Qt::white) , fullscreenMode(false) + , webChannel(nullptr) { memset(actions, 0, sizeof(actions)); } @@ -407,8 +408,14 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) { QExplicitlySharedDataPointer newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); if (newWebContents) { + // Keep the old adapter referenced so the user-scripts are not + // unregistered immediately. + QExplicitlySharedDataPointer oldWebContents = adapter; adapter = newWebContents.data(); adapter->initialize(this); + if (webChannel) + adapter->setWebChannel(webChannel); + scriptCollection.d->rebindToContents(adapter.data()); } } @@ -519,7 +526,7 @@ QWebEngineSettings *QWebEnginePage::settings() const QWebChannel *QWebEnginePage::webChannel() const { Q_D(const QWebEnginePage); - return d->adapter->webChannel(); + return d->webChannel; } /*! @@ -536,7 +543,10 @@ QWebChannel *QWebEnginePage::webChannel() const void QWebEnginePage::setWebChannel(QWebChannel *channel) { Q_D(QWebEnginePage); - d->adapter->setWebChannel(channel); + if (d->webChannel != channel) { + d->webChannel = channel; + d->adapter->setWebChannel(channel); + } } /*! diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 9cc4553d1..18110d923 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -151,6 +151,7 @@ public: bool m_isBeingAdopted; QColor m_backgroundColor; bool fullscreenMode; + QWebChannel *webChannel; mutable QtWebEngineCore::CallbackDirectory m_callbacks; mutable QAction *actions[QWebEnginePage::WebActionCount]; diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index 9967cde85..117c35b5a 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -220,3 +220,15 @@ void QWebEngineScriptCollectionPrivate::reserve(int capacity) { m_scriptController->reserve(m_contents, capacity); } + +void QWebEngineScriptCollectionPrivate::rebindToContents(QtWebEngineCore::WebContentsAdapter *page) +{ + Q_ASSERT(m_contents); + Q_ASSERT(page); + Q_ASSERT(m_contents != page); + + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) { + m_scriptController->addUserScript(script, page); + } + m_contents = page; +} diff --git a/src/webenginewidgets/api/qwebenginescriptcollection_p.h b/src/webenginewidgets/api/qwebenginescriptcollection_p.h index cc6e88445..b5ae60a2c 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection_p.h +++ b/src/webenginewidgets/api/qwebenginescriptcollection_p.h @@ -69,6 +69,8 @@ public: QList toList(const QString &scriptName = QString()) const; QWebEngineScript find(const QString & name) const; + void rebindToContents(QtWebEngineCore::WebContentsAdapter *contents); + void insert(const QWebEngineScript &); bool remove(const QWebEngineScript &); void clear(); -- cgit v1.2.3 From ed5b65c70397f3ea9fa524e7f0b98a48a70ddc88 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 29 Jan 2016 14:46:13 +0100 Subject: Disable WebSpeech Also allows us to remove code handling libFLAC and libspeex since we no longer depend on those. Change-Id: Ifedc19b3c958215d298edd11f9126ea5b9cc09fa Reviewed-by: Joerg Bornemann --- src/3rdparty | 2 +- src/core/config/common.pri | 2 ++ src/core/config/linux.pri | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index b93352c98..3f655a31b 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit b93352c98510fef629d11e8dda91e14aac855f62 +Subproject commit 3f655a31b4979b0862e5aec1c8f47b597464749f diff --git a/src/core/config/common.pri b/src/core/config/common.pri index 793e26a61..c5921a573 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -6,3 +6,5 @@ GYP_CONFIG += use_qt=1 GYP_CONFIG += v8_use_external_startup_data=0 # Disable printing since we don't support it yet GYP_CONFIG += enable_basic_printing=0 enable_print_preview=0 +# WebSpeech requires Google API keys and adds dependencies on speex and flac. +GYP_CONFIG += enable_web_speech=0 diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 1035e950e..00e25ec58 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -36,11 +36,9 @@ use?(system_libevent): GYP_CONFIG += use_system_libevent=1 use?(system_libwebp): GYP_CONFIG += use_system_libwebp=1 use?(system_libsrtp): GYP_CONFIG += use_system_libsrtp=1 use?(system_libxslt): GYP_CONFIG += use_system_libxml=1 -use?(system_flac): GYP_CONFIG += use_system_flac=1 use?(system_jsoncpp): GYP_CONFIG += use_system_jsoncpp=1 use?(system_opus): GYP_CONFIG += use_system_opus=1 use?(system_snappy): GYP_CONFIG += use_system_snappy=1 -use?(system_speex): GYP_CONFIG += use_system_speex=1 use?(system_vpx): GYP_CONFIG += use_system_libvpx=1 use?(system_icu): GYP_CONFIG += use_system_icu=1 use?(system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1 -- cgit v1.2.3