From e561b9a645a7f9f67f1c2cf3d267b27d66529eb9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 14 Sep 2015 17:17:47 +0200 Subject: Signal that no positioning backend is available So far we didn't gave any hint that no positioning backend is available. This patch adds a qWarning(), and also signals the JS side that no positioning data is available. While at it, the unused bool return value of start() is removed. Change-Id: I9e3c21a9ea5c6ab94d230507fe7418fb01c7b86c Reviewed-by: Allan Sandfeld Jensen --- src/core/location_provider_qt.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp index d17fc3d21..e3be01b36 100644 --- a/src/core/location_provider_qt.cpp +++ b/src/core/location_provider_qt.cpp @@ -60,7 +60,7 @@ public: QtPositioningHelper(LocationProviderQt *provider); ~QtPositioningHelper(); - bool start(bool highAccuracy); + void start(bool highAccuracy); void stop(); void refresh(); @@ -88,15 +88,20 @@ QtPositioningHelper::~QtPositioningHelper() m_locationProvider->m_positioningHelper = 0; } -bool QtPositioningHelper::start(bool highAccuracy) +void QtPositioningHelper::start(bool highAccuracy) { DCHECK_CURRENTLY_ON(BrowserThread::UI); Q_UNUSED(highAccuracy); // FIXME: go through availableSources until one supports QGeoPositionInfoSource::SatellitePositioningMethods // for the highAccuracy case. m_positionInfoSource = QGeoPositionInfoSource::createDefaultSource(this); - if (!m_positionInfoSource) - return false; + if (!m_positionInfoSource) { + qWarning("Failed to initialize location provider: The system either has no default " + "position source, no valid plugins could be found or the user does not have " + "the right permissions."); + error(QGeoPositionInfoSource::UnknownSourceError); + return; + } connect(m_positionInfoSource, &QGeoPositionInfoSource::positionUpdated, this, &QtPositioningHelper::updatePosition); // disambiguate the error getter and the signal in QGeoPositionInfoSource. @@ -105,7 +110,7 @@ bool QtPositioningHelper::start(bool highAccuracy) connect(m_positionInfoSource, &QGeoPositionInfoSource::updateTimeout, this, &QtPositioningHelper::timeout); m_positionInfoSource->startUpdates(); - return true; + return; } void QtPositioningHelper::stop() @@ -208,7 +213,7 @@ bool LocationProviderQt::StartProvider(bool highAccuracy) m_positioningHelper = new QtPositioningHelper(this); m_positioningHelper->moveToThread(guiThread); } - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(base::IgnoreResult(&QtPositioningHelper::start) + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&QtPositioningHelper::start , base::Unretained(m_positioningHelper), highAccuracy)); return true; } -- cgit v1.2.1 From 2080ac3ad0878dc04865bf957c84f8f0b5b551ac Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Thu, 24 Sep 2015 06:20:22 -0700 Subject: Implement unload dialogs This fixes the assertion that occurs when the application should show "Are you sure you want to leave this page?" dialog. We can reuse the already existing confirm dialog implementations. Change-Id: I22466d450f39b54d9becbb69e1ecadb3b98697b0 Reviewed-by: Joerg Bornemann --- src/core/javascript_dialog_manager_qt.cpp | 6 ++++++ src/core/javascript_dialog_manager_qt.h | 2 +- src/core/web_contents_adapter_client.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp index fdcd7bdbc..24d426098 100644 --- a/src/core/javascript_dialog_manager_qt.cpp +++ b/src/core/javascript_dialog_manager_qt.cpp @@ -67,6 +67,12 @@ void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webCon runDialogForContents(webContents, dialogType, toQt(messageText).toHtmlEscaped(), toQt(defaultPromptText).toHtmlEscaped(), toQt(originUrl), callback); } +void JavaScriptDialogManagerQt::RunBeforeUnloadDialog(content::WebContents *webContents, const base::string16 &messageText, + bool isReload, const content::JavaScriptDialogManager::DialogClosedCallback &callback) { + Q_UNUSED(isReload); + runDialogForContents(webContents, WebContentsAdapterClient::UnloadDialog, toQt(messageText).toHtmlEscaped(), QString() , QUrl(), callback); +} + bool JavaScriptDialogManagerQt::HandleJavaScriptDialog(content::WebContents *contents, bool accept, const base::string16 *promptOverride) { QSharedPointer dialog = m_activeDialogs.value(contents); diff --git a/src/core/javascript_dialog_manager_qt.h b/src/core/javascript_dialog_manager_qt.h index 8bf7ac6b9..fb47166c1 100644 --- a/src/core/javascript_dialog_manager_qt.h +++ b/src/core/javascript_dialog_manager_qt.h @@ -63,7 +63,7 @@ public: const content::JavaScriptDialogManager::DialogClosedCallback &callback, bool *didSuppressMessage) Q_DECL_OVERRIDE; virtual void RunBeforeUnloadDialog(content::WebContents *, const base::string16 &messageText, bool isReload, - const content::JavaScriptDialogManager::DialogClosedCallback &callback) Q_DECL_OVERRIDE { Q_UNUSED(messageText); Q_UNUSED(isReload); Q_UNUSED(callback); } + const content::JavaScriptDialogManager::DialogClosedCallback &callback) Q_DECL_OVERRIDE; virtual bool HandleJavaScriptDialog(content::WebContents *, bool accept, const base::string16 *promptOverride) Q_DECL_OVERRIDE; virtual void CancelActiveAndPendingDialogs(content::WebContents *contents) Q_DECL_OVERRIDE { takeDialogForContents(contents); } virtual void ResetDialogState(content::WebContents *contents) Q_DECL_OVERRIDE { takeDialogForContents(contents); } diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 3ae84f9c8..2b9b62229 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -147,6 +147,7 @@ public: AlertDialog, ConfirmDialog, PromptDialog, + UnloadDialog, // Leave room for potential new specs InternalAuthorizationDialog = 0x10, }; -- cgit v1.2.1 From 708b852a1b587e68e0ccc6999d4e04fa830689e3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 22 Sep 2015 16:14:58 +0200 Subject: External URL support Support for launching external URLs such as mailto: They are also routed through navigationRequested like they would have been in QtWebKit. [ChangeLog][QtWebEngineCore] External links such as mailto: are now handled. By default they launch using QDesktopServices. Change-Id: I83ed96e2330d54cae57f03648d471a8da9a82a30 Task-number: QTBUG-47143 Reviewed-by: Kai Koehne --- src/core/network_delegate_qt.cpp | 2 +- src/core/resource_dispatcher_host_delegate_qt.cpp | 29 +++++++++++++++++++++++ src/core/resource_dispatcher_host_delegate_qt.h | 3 +++ src/core/web_contents_delegate_qt.cpp | 15 ++++++++++++ src/core/web_contents_delegate_qt.h | 1 + 5 files changed, 49 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp index 38fd3c710..b8f1b68d0 100644 --- a/src/core/network_delegate_qt.cpp +++ b/src/core/network_delegate_qt.cpp @@ -55,7 +55,7 @@ namespace QtWebEngineCore { -static int pageTransitionToNavigationType(ui::PageTransition transition) +int pageTransitionToNavigationType(ui::PageTransition transition) { int32 qualifier = ui::PageTransitionGetQualifier(transition); diff --git a/src/core/resource_dispatcher_host_delegate_qt.cpp b/src/core/resource_dispatcher_host_delegate_qt.cpp index b63ecd5c7..e6c513bf6 100644 --- a/src/core/resource_dispatcher_host_delegate_qt.cpp +++ b/src/core/resource_dispatcher_host_delegate_qt.cpp @@ -130,6 +130,35 @@ void ResourceDispatcherHostLoginDelegateQt::destroy() m_request = 0; } +static void LaunchURL(const GURL& url, int render_process_id, int render_view_id, + ui::PageTransition page_transition, bool is_main_frame) +{ + Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + content::RenderViewHost *render_view_host = content::RenderViewHost::FromID(render_process_id, render_view_id); + if (!render_view_host) + return; + content::WebContents* webContents = content::WebContents::FromRenderViewHost(render_view_host); + if (!webContents) + return; + WebContentsDelegateQt *contentsDelegate = static_cast(webContents->GetDelegate()); + contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame); +} + +bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, int child_id, int route_id, + bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture) +{ + Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + // We don't want to launch external applications unless it is based on a user action + if (!has_user_gesture) + return false; + + content::BrowserThread::PostTask( + content::BrowserThread::UI, + FROM_HERE, + base::Bind(&LaunchURL, url, child_id, route_id, page_transition, is_main_frame)); + return true; +} + content::ResourceDispatcherHostLoginDelegate *ResourceDispatcherHostDelegateQt::CreateLoginDelegate(net::AuthChallengeInfo *authInfo, net::URLRequest *request) { // ResourceDispatcherHostLoginDelegateQt is ref-counted and will be released after we called ClearLoginDelegateForRequest. diff --git a/src/core/resource_dispatcher_host_delegate_qt.h b/src/core/resource_dispatcher_host_delegate_qt.h index d62292995..57eaa3bc5 100644 --- a/src/core/resource_dispatcher_host_delegate_qt.h +++ b/src/core/resource_dispatcher_host_delegate_qt.h @@ -86,6 +86,9 @@ private: class ResourceDispatcherHostDelegateQt : public content::ResourceDispatcherHostDelegate { public: + virtual bool HandleExternalProtocol(const GURL& url, int child_id, int route_id, + bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture) Q_DECL_OVERRIDE; + virtual content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(net::AuthChallengeInfo *authInfo, net::URLRequest *request) Q_DECL_OVERRIDE; }; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index eb9c42edc..1c37f62df 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -43,6 +43,7 @@ #include "browser_context_adapter.h" #include "file_picker_controller.h" #include "media_capture_devices_dispatcher.h" +#include "network_delegate_qt.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" #include "web_contents_adapter_p.h" @@ -64,6 +65,8 @@ #include "content/public/common/web_preferences.h" #include "ui/events/latency_info.h" +#include + namespace QtWebEngineCore { // Maps the LogSeverity defines in base/logging.h to the web engines message levels. @@ -357,6 +360,18 @@ void WebContentsDelegateQt::requestGeolocationPermission(const QUrl &requestingO m_viewClient->runGeolocationPermissionRequest(requestingOrigin); } +extern int pageTransitionToNavigationType(ui::PageTransition transition); + +void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame) +{ + int navigationRequestAction = WebContentsAdapterClient::AcceptRequest; + m_viewClient->navigationRequested(pageTransitionToNavigationType(page_transition), url, navigationRequestAction, is_main_frame); +#ifndef QT_NO_DESKTOPSERVICES + if (navigationRequestAction == WebContentsAdapterClient::AcceptRequest) + QDesktopServices::openUrl(url); +#endif +} + void WebContentsDelegateQt::ShowValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view, const base::string16 &main_text, const base::string16 &sub_text) { Q_UNUSED(web_contents); diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 3fda96113..14421d060 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -107,6 +107,7 @@ public: void overrideWebPreferences(content::WebContents *, content::WebPreferences*); void allowCertificateError(const QSharedPointer &) ; void requestGeolocationPermission(const QUrl &requestingOrigin); + void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame); private: WebContentsAdapter *createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); -- cgit v1.2.1 From 961ecdd3456629bc40fd0a659c4dcf81521fc072 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 28 Sep 2015 16:04:17 +0200 Subject: Fix QT_NO_ASCII_CAST build Use QStringLiteral for string literals. Change-Id: Ie5c105fac5e23bb323da5e0407874d25154ebe58 Reviewed-by: Joerg Bornemann --- src/core/cookie_monster_delegate_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp index 7838617ba..7622614ca 100644 --- a/src/core/cookie_monster_delegate_qt.cpp +++ b/src/core/cookie_monster_delegate_qt.cpp @@ -49,7 +49,7 @@ namespace QtWebEngineCore { static GURL sourceUrlForCookie(const QNetworkCookie &cookie) { - QString urlFragment = QString("%1%2").arg(cookie.domain()).arg(cookie.path()); + QString urlFragment = QStringLiteral("%1%2").arg(cookie.domain()).arg(cookie.path()); return net::cookie_util::CookieOriginToURL(urlFragment.toStdString(), /* is_https */ cookie.isSecure()); } -- cgit v1.2.1 From 117d70f5c719cc6775eb5a653c887e68037b9a93 Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Mon, 28 Sep 2015 05:54:37 -0700 Subject: Remove whitespaces from custom HTTP user agents This prevents adding additional headers to the outgoing HTTP request through overridden user agent and unskips userAgentNewlineStripping API test. Change-Id: If9b3a88b0346058a7dc462471637d9777683fe82 Reviewed-by: Allan Sandfeld Jensen --- src/core/browser_context_adapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index 660c6ffb2..02fa207c9 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -255,12 +255,12 @@ void BrowserContextAdapter::setHttpUserAgent(const QString &userAgent) { if (m_httpUserAgent == userAgent) return; - m_httpUserAgent = userAgent; + m_httpUserAgent = userAgent.simplified(); std::vector list = content::WebContentsImpl::GetAllWebContents(); Q_FOREACH (content::WebContentsImpl *web_contents, list) if (web_contents->GetBrowserContext() == m_browserContext.data()) - web_contents->SetUserAgentOverride(userAgent.toStdString()); + web_contents->SetUserAgentOverride(m_httpUserAgent.toStdString()); if (m_browserContext->url_request_getter_.get()) m_browserContext->url_request_getter_->updateUserAgent(); -- cgit v1.2.1 From 6f92911e10fe4417c83af4ee356fd89549db29c6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 18 Sep 2015 17:43:43 +0200 Subject: Parse suggested filename from content-disposition Chromium hasn't parsed content-disposition by the time we get the download item, so we need to call the parsing manually. Change-Id: I105d0c6904dd764b368cb774e377a6028c082513 Task-number: QTBUG-48206 Reviewed-by: Joerg Bornemann --- src/core/download_manager_delegate_qt.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core') diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp index c01dcf63d..e9af98fd8 100644 --- a/src/core/download_manager_delegate_qt.cpp +++ b/src/core/download_manager_delegate_qt.cpp @@ -40,6 +40,7 @@ #include "content/public/browser/download_item.h" #include "content/public/browser/save_page_type.h" #include "content/public/browser/web_contents.h" +#include "net/http/http_content_disposition.h" #include #include @@ -103,6 +104,9 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(content::DownloadItem* i std::string suggestedFilename = item->GetSuggestedFilename(); + if (suggestedFilename.empty()) + suggestedFilename = net::HttpContentDisposition(item->GetContentDisposition(), std::string()).filename(); + if (suggestedFilename.empty()) suggestedFilename = item->GetTargetFilePath().AsUTF8Unsafe(); -- cgit v1.2.1 From 2a972c4046bbee49ec9c770f2c1e12fb95500240 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 29 Sep 2015 15:41:46 +0200 Subject: Fix assert on deleting installed custom URL scheme handler When the QObject::destroyed signal is emitted the inherited class parts have already been destroyed and thus it is no longer a QWebEngineUrlSchemeHandler and qobject_cast will return 0, which is asserted against. Change-Id: I7130c60a26088067930499a30e0081ed297a92d9 Reviewed-by: Kai Koehne --- src/core/api/qwebengineurlschemehandler.cpp | 1 + src/core/api/qwebengineurlschemehandler.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp index 330648893..e14da6fb5 100644 --- a/src/core/api/qwebengineurlschemehandler.cpp +++ b/src/core/api/qwebengineurlschemehandler.cpp @@ -84,6 +84,7 @@ QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler() { + Q_EMIT destroyed(this); delete d_ptr; } diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h index b6f6a69f0..1ec32e46c 100644 --- a/src/core/api/qwebengineurlschemehandler.h +++ b/src/core/api/qwebengineurlschemehandler.h @@ -57,6 +57,9 @@ public: virtual void requestStarted(QWebEngineUrlRequestJob*) = 0; +Q_SIGNALS: + void destroyed(QWebEngineUrlSchemeHandler*); + private: Q_DISABLE_COPY(QWebEngineUrlSchemeHandler) Q_DECLARE_PRIVATE(QWebEngineUrlSchemeHandler) -- cgit v1.2.1 From 295a915b5ae66ad9485b38e7d05040cf0321cd4e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 6 Oct 2015 09:39:40 +0200 Subject: fix link error with MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since qtbase/e88334e0 we must not put MSVC linker flags into LIBS or LIBS_PRIVATE. QMAKE_LFLAGS is the right place. This fixes a build error with MSVC: LINK : fatal error LNK1181: cannot open input file '\OPT:REF.obj' Change-Id: I2971e412dd8d5cfe8b7aca218d679dd136019dd8 Reviewed-by: Michael Brüning --- src/core/core_module.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/core_module.pro b/src/core/core_module.pro index cf253a735..68d46cd5a 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -22,7 +22,7 @@ osx { } else:msvc { # Simulate -whole-archive by passing the list of object files that belong to the public # API library as response file to the linker. - LIBS_PRIVATE += /OPT:REF + QMAKE_LFLAGS += /OPT:REF QMAKE_LFLAGS += @$${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib.objects } else { LIBS_PRIVATE += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive -- cgit v1.2.1 From 442ad85ee3f40a981fa721673dd6c7344d1daece Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 30 Sep 2015 13:59:22 +0200 Subject: Remove unnecessay delegation over CustomUrlSchemeHandler With QWebEngineSchemeHandler in QtWebEngineCore, we do not need the indirection and delegation CustomUrlSchemeHandler provided. This means the class can be removed and we can also store the handlers directly in BrowserContextAdapter and save a copy of the installed handlers in the QWebEngineProfile. Change-Id: Iabb5cc9d364c2f2a879bc77bfb2ff14b3c2ff640 Reviewed-by: Kai Koehne --- src/core/api/qwebengineurlrequestjob.h | 3 +- src/core/api/qwebengineurlschemehandler.cpp | 18 ++------ src/core/api/qwebengineurlschemehandler.h | 6 ++- src/core/api/qwebengineurlschemehandler_p.h | 19 ++------ src/core/browser_context_adapter.cpp | 7 ++- src/core/browser_context_adapter.h | 8 ++-- src/core/core_gyp_generator.pro | 2 - src/core/custom_protocol_handler.cpp | 2 +- src/core/custom_protocol_handler.h | 6 +-- src/core/custom_url_scheme_handler.cpp | 63 ------------------------- src/core/custom_url_scheme_handler.h | 71 ----------------------------- src/core/url_request_context_getter_qt.cpp | 6 +-- src/core/url_request_custom_job.cpp | 8 ++-- src/core/url_request_custom_job.h | 6 +-- 14 files changed, 36 insertions(+), 189 deletions(-) delete mode 100644 src/core/custom_url_scheme_handler.cpp delete mode 100644 src/core/custom_url_scheme_handler.h (limited to 'src/core') diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h index 098d46c93..76e9b2c39 100644 --- a/src/core/api/qwebengineurlrequestjob.h +++ b/src/core/api/qwebengineurlrequestjob.h @@ -55,6 +55,7 @@ #include namespace QtWebEngineCore { +class URLRequestCustomJob; class URLRequestCustomJobDelegate; } // namespace @@ -86,7 +87,7 @@ public: private: QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *); - friend class QWebEngineUrlSchemeHandlerPrivate; + friend class QtWebEngineCore::URLRequestCustomJob; QtWebEngineCore::URLRequestCustomJobDelegate* d_ptr; }; diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp index e14da6fb5..b2994847b 100644 --- a/src/core/api/qwebengineurlschemehandler.cpp +++ b/src/core/api/qwebengineurlschemehandler.cpp @@ -53,23 +53,11 @@ QT_BEGIN_NAMESPACE */ -QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme, QWebEngineUrlSchemeHandler *q) - : CustomUrlSchemeHandler(scheme) - , q_ptr(q) +QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme) + : m_scheme(scheme) { } -QWebEngineUrlSchemeHandlerPrivate::~QWebEngineUrlSchemeHandlerPrivate() -{ -} - -bool QWebEngineUrlSchemeHandlerPrivate::handleJob(QtWebEngineCore::URLRequestCustomJobDelegate *job) -{ - QWebEngineUrlRequestJob *requestJob = new QWebEngineUrlRequestJob(job); - q_ptr->requestStarted(requestJob); - return true; -} - /*! Constructs a new URL scheme handler. @@ -78,7 +66,7 @@ bool QWebEngineUrlSchemeHandlerPrivate::handleJob(QtWebEngineCore::URLRequestCus */ QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(const QByteArray &scheme, QObject *parent) : QObject(parent) - , d_ptr(new QWebEngineUrlSchemeHandlerPrivate(scheme, this)) + , d_ptr(new QWebEngineUrlSchemeHandlerPrivate(scheme)) { } diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h index 1ec32e46c..1b6a66706 100644 --- a/src/core/api/qwebengineurlschemehandler.h +++ b/src/core/api/qwebengineurlschemehandler.h @@ -42,6 +42,10 @@ #include #include +namespace QtWebEngineCore { +class URLRequestContextGetterQt; +} + QT_BEGIN_NAMESPACE class QWebEngineUrlRequestJob; @@ -63,8 +67,6 @@ Q_SIGNALS: private: Q_DISABLE_COPY(QWebEngineUrlSchemeHandler) Q_DECLARE_PRIVATE(QWebEngineUrlSchemeHandler) - friend class QWebEngineProfile; - friend class QQuickWebEngineProfile; QWebEngineUrlSchemeHandlerPrivate *d_ptr; }; diff --git a/src/core/api/qwebengineurlschemehandler_p.h b/src/core/api/qwebengineurlschemehandler_p.h index dc4b272b3..d63666326 100644 --- a/src/core/api/qwebengineurlschemehandler_p.h +++ b/src/core/api/qwebengineurlschemehandler_p.h @@ -48,27 +48,18 @@ // We mean it. // -#include "qwebengineurlschemehandler.h" - -#include "custom_url_scheme_handler.h" +#include QT_BEGIN_NAMESPACE -class QWebEngineProfile; -class QWebEngineUrlRequestJob; -class QWebEngineUrlSchemeHandler; - -class QWEBENGINE_EXPORT QWebEngineUrlSchemeHandlerPrivate : public QtWebEngineCore::CustomUrlSchemeHandler { +class QWEBENGINE_EXPORT QWebEngineUrlSchemeHandlerPrivate { public: - Q_DECLARE_PUBLIC(QWebEngineUrlSchemeHandler) - - QWebEngineUrlSchemeHandlerPrivate(const QByteArray &, QWebEngineUrlSchemeHandler *); - virtual ~QWebEngineUrlSchemeHandlerPrivate(); + QWebEngineUrlSchemeHandlerPrivate(const QByteArray &); - virtual bool handleJob(QtWebEngineCore::URLRequestCustomJobDelegate*) Q_DECL_OVERRIDE; + const QByteArray &scheme() const { return m_scheme; } private: - QWebEngineUrlSchemeHandler *q_ptr; + QByteArray m_scheme; }; QT_END_NAMESPACE diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index 02fa207c9..345741847 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -354,7 +354,7 @@ void BrowserContextAdapter::setHttpCacheMaxSize(int maxSize) m_browserContext->url_request_getter_->updateHttpCache(); } -QVector &BrowserContextAdapter::customUrlSchemeHandlers() +QHash &BrowserContextAdapter::customUrlSchemeHandlers() { return m_customUrlSchemeHandlers; } @@ -365,10 +365,9 @@ void BrowserContextAdapter::updateCustomUrlSchemeHandlers() m_browserContext->url_request_getter_->updateStorageSettings(); } -void BrowserContextAdapter::removeCustomUrlSchemeHandler(CustomUrlSchemeHandler *handler) +void BrowserContextAdapter::removeCustomUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler) { - m_customUrlSchemeHandlers.removeOne(handler); - Q_ASSERT(!m_customUrlSchemeHandlers.contains(handler)); + m_customUrlSchemeHandlers.remove(handler->scheme()); } UserScriptControllerHost *BrowserContextAdapter::userScriptController() diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index 0bca1bf8b..5272268f7 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -48,6 +48,7 @@ #include "api/qwebenginecookiestoreclient.h" #include "api/qwebengineurlrequestinterceptor.h" +#include "api/qwebengineurlschemehandler.h" QT_FORWARD_DECLARE_CLASS(QObject) @@ -55,7 +56,6 @@ namespace QtWebEngineCore { class BrowserContextAdapterClient; class BrowserContextQt; -class CustomUrlSchemeHandler; class DownloadManagerDelegateQt; class UserScriptControllerHost; class WebEngineVisitedLinksManager; @@ -145,9 +145,9 @@ public: bool trackVisitedLinks() const; bool persistVisitedLinks() const; - QVector &customUrlSchemeHandlers(); + QHash &customUrlSchemeHandlers(); void updateCustomUrlSchemeHandlers(); - void removeCustomUrlSchemeHandler(CustomUrlSchemeHandler*); + void removeCustomUrlSchemeHandler(QWebEngineUrlSchemeHandler *); UserScriptControllerHost *userScriptController(); void permissionRequestReply(const QUrl &origin, PermissionType type, bool reply); @@ -173,7 +173,7 @@ private: QString m_httpAcceptLanguage; PersistentCookiesPolicy m_persistentCookiesPolicy; VisitedLinksPolicy m_visitedLinksPolicy; - QVector m_customUrlSchemeHandlers; + QHash m_customUrlSchemeHandlers; QList m_clients; int m_httpCacheMaxSize; diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index c1b8179e0..813626dc3 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -45,7 +45,6 @@ SOURCES = \ content_main_delegate_qt.cpp \ cookie_monster_delegate_qt.cpp \ custom_protocol_handler.cpp \ - custom_url_scheme_handler.cpp \ delegated_frame_node.cpp \ desktop_screen_qt.cpp \ dev_tools_http_handler_delegate_qt.cpp \ @@ -117,7 +116,6 @@ HEADERS = \ content_main_delegate_qt.h \ cookie_monster_delegate_qt.h \ custom_protocol_handler.h \ - custom_url_scheme_handler.h \ delegated_frame_node.h \ desktop_screen_qt.h \ dev_tools_http_handler_delegate_qt.h \ diff --git a/src/core/custom_protocol_handler.cpp b/src/core/custom_protocol_handler.cpp index f140f98cf..fd1a4de41 100644 --- a/src/core/custom_protocol_handler.cpp +++ b/src/core/custom_protocol_handler.cpp @@ -43,7 +43,7 @@ namespace QtWebEngineCore { -CustomProtocolHandler::CustomProtocolHandler(CustomUrlSchemeHandler *schemeHandler) +CustomProtocolHandler::CustomProtocolHandler(QWebEngineUrlSchemeHandler *schemeHandler) : m_schemeHandler(schemeHandler) { } diff --git a/src/core/custom_protocol_handler.h b/src/core/custom_protocol_handler.h index 225bb0567..94da28673 100644 --- a/src/core/custom_protocol_handler.h +++ b/src/core/custom_protocol_handler.h @@ -45,6 +45,7 @@ #include // Needed for Q_DECL_OVERRIDE QT_FORWARD_DECLARE_CLASS(QIODevice) +QT_FORWARD_DECLARE_CLASS(QWebEngineUrlSchemeHandler) namespace net { class NetworkDelegate; @@ -54,20 +55,19 @@ class URLRequestJob; namespace QtWebEngineCore { class BrowserContextAdapter; -class CustomUrlSchemeHandler; // Implements a ProtocolHandler for custom URL schemes. // If |network_delegate_| is NULL then all file requests will fail with ERR_ACCESS_DENIED. class QWEBENGINE_EXPORT CustomProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { public: - CustomProtocolHandler(CustomUrlSchemeHandler *); + CustomProtocolHandler(QWebEngineUrlSchemeHandler *); virtual net::URLRequestJob *MaybeCreateJob(net::URLRequest *request, net::NetworkDelegate *networkDelegate) const Q_DECL_OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(CustomProtocolHandler); - CustomUrlSchemeHandler *m_schemeHandler; + QWebEngineUrlSchemeHandler *m_schemeHandler; }; } // namespace diff --git a/src/core/custom_url_scheme_handler.cpp b/src/core/custom_url_scheme_handler.cpp deleted file mode 100644 index 29791b555..000000000 --- a/src/core/custom_url_scheme_handler.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "custom_url_scheme_handler.h" -#include "custom_protocol_handler.h" - -namespace QtWebEngineCore { - -CustomUrlSchemeHandler::CustomUrlSchemeHandler(const QByteArray &scheme) - : m_scheme(scheme) -{ -} - -QByteArray CustomUrlSchemeHandler::scheme() const -{ - return m_scheme; -} - -void CustomUrlSchemeHandler::setScheme(const QByteArray &scheme) -{ - m_scheme = scheme; -} - -CustomProtocolHandler *CustomUrlSchemeHandler::createProtocolHandler() -{ - // Will be owned by the JobFactory. - return new CustomProtocolHandler(this); -} - -} // namespace diff --git a/src/core/custom_url_scheme_handler.h b/src/core/custom_url_scheme_handler.h deleted file mode 100644 index d866628de..000000000 --- a/src/core/custom_url_scheme_handler.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CUSTOM_URL_SCHEME_HANDLER_H_ -#define CUSTOM_URL_SCHEME_HANDLER_H_ - -#include "qtwebenginecoreglobal.h" - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QIODevice) - -namespace QtWebEngineCore { - -class BrowserContextAdapter; -class CustomProtocolHandler; -class URLRequestCustomJobDelegate; - -class QWEBENGINE_EXPORT CustomUrlSchemeHandler { -public: - explicit CustomUrlSchemeHandler(const QByteArray &); - virtual ~CustomUrlSchemeHandler() { } - - QByteArray scheme() const; - void setScheme(const QByteArray &); - CustomProtocolHandler *createProtocolHandler(); - - virtual bool handleJob(URLRequestCustomJobDelegate*) = 0; - -private: - QByteArray m_scheme; -}; - - -} // namespace - -#endif // CUSTOM_URL_SCHEME_HANDLER_H_ diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index c9ebf7f3b..771a662b9 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -66,9 +66,9 @@ #include "net/url_request/ftp_protocol_handler.h" #include "net/ftp/ftp_network_layer.h" +#include "api/qwebengineurlschemehandler.h" #include "browser_context_adapter.h" #include "custom_protocol_handler.h" -#include "custom_url_scheme_handler.h" #include "cookie_monster_delegate_qt.h" #include "content_client_qt.h" #include "network_delegate_qt.h" @@ -350,8 +350,8 @@ void URLRequestContextGetterQt::generateJobFactory() m_jobFactory->SetProtocolHandler(url::kFtpScheme, new net::FtpProtocolHandler(new net::FtpNetworkLayer(m_urlRequestContext->host_resolver()))); - Q_FOREACH (CustomUrlSchemeHandler* handler, m_browserContext->customUrlSchemeHandlers()) { - m_jobFactory->SetProtocolHandler(handler->scheme().toStdString(), handler->createProtocolHandler()); + Q_FOREACH (QWebEngineUrlSchemeHandler *handler, m_browserContext->customUrlSchemeHandlers()) { + m_jobFactory->SetProtocolHandler(handler->scheme().toStdString(), new CustomProtocolHandler(handler)); } m_urlRequestContext->set_job_factory(m_jobFactory.get()); diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp index afdcecdfe..0a81d04a1 100644 --- a/src/core/url_request_custom_job.cpp +++ b/src/core/url_request_custom_job.cpp @@ -37,7 +37,8 @@ #include "url_request_custom_job.h" #include "url_request_custom_job_delegate.h" -#include "custom_url_scheme_handler.h" +#include "api/qwebengineurlrequestjob.h" +#include "api/qwebengineurlschemehandler.h" #include "type_conversion.h" #include "content/public/browser/browser_thread.h" @@ -53,7 +54,7 @@ using namespace net; namespace QtWebEngineCore { -URLRequestCustomJob::URLRequestCustomJob(URLRequest *request, NetworkDelegate *networkDelegate, CustomUrlSchemeHandler *schemeHandler) +URLRequestCustomJob::URLRequestCustomJob(URLRequest *request, NetworkDelegate *networkDelegate, QWebEngineUrlSchemeHandler *schemeHandler) : URLRequestJob(request, networkDelegate) , m_device(0) , m_schemeHandler(schemeHandler) @@ -236,7 +237,8 @@ void URLRequestCustomJob::startAsync() QMutexLocker lock(&m_mutex); m_delegate = new URLRequestCustomJobDelegate(this); lock.unlock(); - m_schemeHandler->handleJob(m_delegate); + QWebEngineUrlRequestJob *requestJob = new QWebEngineUrlRequestJob(m_delegate); + m_schemeHandler->requestStarted(requestJob); } } // namespace diff --git a/src/core/url_request_custom_job.h b/src/core/url_request_custom_job.h index 60a1d60b9..a994c467a 100644 --- a/src/core/url_request_custom_job.h +++ b/src/core/url_request_custom_job.h @@ -45,16 +45,16 @@ #include QT_FORWARD_DECLARE_CLASS(QIODevice) +QT_FORWARD_DECLARE_CLASS(QWebEngineUrlSchemeHandler) namespace QtWebEngineCore { -class CustomUrlSchemeHandler; class URLRequestCustomJobDelegate; // A request job that handles reading custom URL schemes class URLRequestCustomJob : public net::URLRequestJob { public: - URLRequestCustomJob(net::URLRequest *request, net::NetworkDelegate *networkDelegate, CustomUrlSchemeHandler *schemeHandler); + URLRequestCustomJob(net::URLRequest *request, net::NetworkDelegate *networkDelegate, QWebEngineUrlSchemeHandler *schemeHandler); virtual void Start() Q_DECL_OVERRIDE; virtual void Kill() Q_DECL_OVERRIDE; virtual bool ReadRawData(net::IOBuffer *buf, int bufSize, int *bytesRead) Q_DECL_OVERRIDE; @@ -81,7 +81,7 @@ private: QMutex m_mutex; QPointer m_device; QPointer m_delegate; - CustomUrlSchemeHandler *m_schemeHandler; + QWebEngineUrlSchemeHandler *m_schemeHandler; std::string m_mimeType; std::string m_charset; int m_error; -- cgit v1.2.1 From 8229f7d0e841dc996f74978336a8d6ef851fc3ad Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 6 Oct 2015 14:06:40 +0200 Subject: Doc: edit QWebEngineUrlRequestJob docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add docs for the Error enum - Fix incorrect argument name - Edit for grammar Change-Id: I6c4364eb0a4dd52e38eaf1cde46aec4ddff99532 Reviewed-by: Michael Brüning --- src/core/api/qwebengineurlrequestjob.cpp | 38 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index d9f3833b9..0e56ba5b3 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -48,17 +48,35 @@ QT_BEGIN_NAMESPACE \since 5.6 A QWebEngineUrlRequestJob is given to QWebEngineUrlSchemeHandler::requestStarted() and must - be handled by the derived implementations of the class. + be handled by the derived implementations of the class. The job can be handled by calling + either reply(), redirect(), or fail(). - A job can be handled by calling either reply(), redirect() or fail(). - - The class is owned by QtWebEngine and does not need to be deleted. Note QtWebEngine may delete - the job when it is no longer needed, so the signal QObject::destroyed() must be monitored if - a pointer to the object is stored. + The class is owned by the web engine and does not need to be deleted. However, the web engine + may delete the job when it is no longer needed, and therefore the signal QObject::destroyed() + must be monitored if a pointer to the object is stored. \inmodule QtWebEngineCore */ +/*! + \enum QWebEngineUrlRequestJob::Error + + This enum type holds the type of the error that occurred: + + \value NoError + The request was successful. + \value UrlNotFound + The requested URL was not found. + \value UrlInvalid + The requested URL is invalid. + \value RequestAborted + The request was canceled. + \value RequestDenied + The request was denied. + \value RequestFailed + The request failed. +*/ + /*! \internal */ @@ -92,7 +110,7 @@ QByteArray QWebEngineUrlRequestJob::requestMethod() const } /*! - Replies the request with \a device with the mime-type \a contentType. + Replies to the request with \a device and the MIME type \a contentType. */ void QWebEngineUrlRequestJob::reply(const QByteArray &contentType, QIODevice *device) { @@ -100,7 +118,9 @@ void QWebEngineUrlRequestJob::reply(const QByteArray &contentType, QIODevice *de } /*! - Fails the request with error \a error. + Fails the request with the error \a r. + + \sa Error */ void QWebEngineUrlRequestJob::fail(Error r) { @@ -108,7 +128,7 @@ void QWebEngineUrlRequestJob::fail(Error r) } /*! - Tell the request is redirected to \a url. + Redirects the request to \a url. */ void QWebEngineUrlRequestJob::redirect(const QUrl &url) { -- cgit v1.2.1 From dfebd43f600e4ffd16975a0c5d401740e45fee54 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 5 Oct 2015 15:20:24 +0200 Subject: Doc: edit QWebEngineUrlSchemeHandler docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing docs - Edit for grammar Change-Id: I407818d66f17a354cf3f5051bed5a648bc807424 Reviewed-by: Florian Bruhin Reviewed-by: Michael Brüning --- src/core/api/qwebengineurlschemehandler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp index b2994847b..8b3327805 100644 --- a/src/core/api/qwebengineurlschemehandler.cpp +++ b/src/core/api/qwebengineurlschemehandler.cpp @@ -43,16 +43,22 @@ QT_BEGIN_NAMESPACE /*! \class QWebEngineUrlSchemeHandler - \brief The QWebEngineUrlSchemeHandler base class for handling custom URL schemes. + \brief The QWebEngineUrlSchemeHandler is a base class for handling custom URL schemes. \since 5.6 - To implement a custom URL scheme for QtWebEngine you must write a class derived from this class, + To implement a custom URL scheme for QtWebEngine, you must write a class derived from this class, and reimplement requestStarted(). \inmodule QtWebEngineCore */ +/*! + \fn QWebEngineUrlSchemeHandler::destroyed(QWebEngineUrlSchemeHandler*) + + This signal is emitted when a custom URL scheme handler is deleted. +*/ + QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme) : m_scheme(scheme) { @@ -70,6 +76,9 @@ QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(const QByteArray &scheme, { } +/*! + Deletes a custom URL scheme handler. +*/ QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler() { Q_EMIT destroyed(this); -- cgit v1.2.1 From a45f6fc3e1016a223a4b235cc61b033f8665c853 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 25 Sep 2015 15:39:12 +0200 Subject: Keep order of scripts added to QWebEngineScriptCollection Use a QList instead of a QSet to store the scripts in the collection. This avoids situations where two scripts injected depend on each other, and fail or succeed depending on the semi-random order that QSet imposes. Change-Id: I44d5d89866ff2431544cc91afb1c102d93daa5da Reviewed-by: Allan Sandfeld Jensen --- src/core/user_script.cpp | 11 ----------- src/core/user_script.h | 4 ---- src/core/user_script_controller_host.cpp | 31 ++++++++++++++++++------------- src/core/user_script_controller_host.h | 6 +++--- 4 files changed, 21 insertions(+), 31 deletions(-) (limited to 'src/core') diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp index fb293c56a..179febc48 100644 --- a/src/core/user_script.cpp +++ b/src/core/user_script.cpp @@ -168,14 +168,3 @@ UserScriptData &UserScript::data() const } } // namespace QtWebEngineCore - -QT_BEGIN_NAMESPACE -uint qHash(const QtWebEngineCore::UserScript &script, uint seed) -{ - if (script.isNull()) - return 0; - return qHash(script.sourceCode(), seed) ^ qHash(script.name(), seed) - ^ (script.injectionPoint() | (script.runsOnSubFrames() << 4)) - ^ script.worldId(); -} -QT_END_NAMESPACE diff --git a/src/core/user_script.h b/src/core/user_script.h index 7aeba9131..69c32c7ba 100644 --- a/src/core/user_script.h +++ b/src/core/user_script.h @@ -93,8 +93,4 @@ private: } // namespace QtWebEngineCore -QT_BEGIN_NAMESPACE -uint qHash(const QtWebEngineCore::UserScript &, uint seed = 0); -QT_END_NAMESPACE - #endif // USER_SCRIPT_H diff --git a/src/core/user_script_controller_host.cpp b/src/core/user_script_controller_host.cpp index d57518275..a0d3f6fed 100644 --- a/src/core/user_script_controller_host.cpp +++ b/src/core/user_script_controller_host.cpp @@ -116,9 +116,11 @@ void UserScriptControllerHost::addUserScript(const UserScript &script, WebConten return; // Global scripts should be dispatched to all our render processes. if (!adapter) { - m_profileWideScripts.insert(script); - Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses) - renderer->Send(new UserScriptController_AddScript(script.data())); + if (!m_profileWideScripts.contains(script)) { + m_profileWideScripts.append(script); + Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses) + renderer->Send(new UserScriptController_AddScript(script.data())); + } } else { content::WebContents *contents = adapter->webContents(); ContentsScriptsMap::iterator it = m_perContentsScripts.find(contents); @@ -126,11 +128,13 @@ void UserScriptControllerHost::addUserScript(const UserScript &script, WebConten // We need to keep track of RenderView/RenderViewHost changes for a given contents // in order to make sure the scripts stay in sync new WebContentsObserverHelper(this, contents); - it = m_perContentsScripts.insert(contents, (QSet() << script)); + it = m_perContentsScripts.insert(contents, (QList() << script)); } else { - QSet currentScripts = it.value(); - currentScripts.insert(script); - m_perContentsScripts.insert(contents, currentScripts); + QList currentScripts = it.value(); + if (!currentScripts.contains(script)) { + currentScripts.append(script); + m_perContentsScripts.insert(contents, currentScripts); + } } contents->Send(new RenderViewObserverHelper_AddScript(contents->GetRoutingID(), script.data())); } @@ -151,7 +155,8 @@ bool UserScriptControllerHost::removeUserScript(const UserScript &script, WebCon if (script.isNull()) return false; if (!adapter) { - QSet::iterator it = m_profileWideScripts.find(script); + QList::iterator it + = std::find(m_profileWideScripts.begin(), m_profileWideScripts.end(), script); if (it == m_profileWideScripts.end()) return false; Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses) @@ -161,12 +166,12 @@ bool UserScriptControllerHost::removeUserScript(const UserScript &script, WebCon content::WebContents *contents = adapter->webContents(); if (!m_perContentsScripts.contains(contents)) return false; - QSet &set(m_perContentsScripts[contents]); - QSet::iterator it = set.find(script); - if (it == set.end()) + QList &list(m_perContentsScripts[contents]); + QList::iterator it = std::find(list.begin(), list.end(), script); + if (it == list.end()) return false; contents->Send(new RenderViewObserverHelper_RemoveScript(contents->GetRoutingID(), (*it).data())); - set.erase(it); + list.erase(it); } return true; } @@ -184,7 +189,7 @@ void UserScriptControllerHost::clearAllScripts(WebContentsAdapter *adapter) } } -const QSet UserScriptControllerHost::registeredScripts(WebContentsAdapter *adapter) const +const QList UserScriptControllerHost::registeredScripts(WebContentsAdapter *adapter) const { if (!adapter) return m_profileWideScripts; diff --git a/src/core/user_script_controller_host.h b/src/core/user_script_controller_host.h index 49c96b333..3884fb3b9 100644 --- a/src/core/user_script_controller_host.h +++ b/src/core/user_script_controller_host.h @@ -64,7 +64,7 @@ public: bool removeUserScript(const UserScript &script, WebContentsAdapter *adapter); void clearAllScripts(WebContentsAdapter *adapter); void reserve(WebContentsAdapter *adapter, int count); - const QSet registeredScripts(WebContentsAdapter *adapter) const; + const QList registeredScripts(WebContentsAdapter *adapter) const; void renderProcessStartedWithHost(content::RenderProcessHost *renderer); @@ -75,8 +75,8 @@ private: void webContentsDestroyed(content::WebContents *); - QSet m_profileWideScripts; - typedef QHash> ContentsScriptsMap; + QList m_profileWideScripts; + typedef QHash> ContentsScriptsMap; ContentsScriptsMap m_perContentsScripts; QSet m_observedProcesses; QScopedPointer m_renderProcessObserver; -- cgit v1.2.1 From de36c91bbb710f130713e2e0c589d454364ea0a8 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 7 Oct 2015 15:06:30 +0200 Subject: Doc: add missing parameter name to function signature in docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...to fix a QDoc error. Change-Id: Id074b1e43fd1739a6dddd77b922b2483d0879727 Reviewed-by: Topi Reiniö Reviewed-by: Kai Koehne --- src/core/api/qwebengineurlschemehandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp index 8b3327805..e6c20dbca 100644 --- a/src/core/api/qwebengineurlschemehandler.cpp +++ b/src/core/api/qwebengineurlschemehandler.cpp @@ -54,9 +54,9 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QWebEngineUrlSchemeHandler::destroyed(QWebEngineUrlSchemeHandler*) + \fn QWebEngineUrlSchemeHandler::destroyed(QWebEngineUrlSchemeHandler *handler) - This signal is emitted when a custom URL scheme handler is deleted. + This signal is emitted when the custom URL scheme handler \a handler is deleted. */ QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme) -- cgit v1.2.1 From 2e9c6cd0bd6789a4f46fe0bcfbd522f0dd3eb4cb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 9 Oct 2015 10:50:56 +0200 Subject: add RequestClose web action Web pages can set the onbeforeunload handler to let the user confirm whether to leave the page or not. Until now, only when leaving the page via a link, a confirmation was shown. Before actually closing a web page, applications can now trigger the RequestClose web action. This will give the use the chance to confirm or deny the close request. If the request is confirmed, the signal windowCloseRequested is emitted. Task-number: QTBUG-36155 Change-Id: Icc1fabc37a2ac537f674c2f00bc8966e4dc4e610 Reviewed-by: Allan Sandfeld Jensen --- src/core/web_contents_adapter.cpp | 6 ++++++ src/core/web_contents_adapter.h | 1 + src/core/web_contents_adapter_client.h | 1 + src/core/web_contents_delegate_qt.cpp | 9 +++++++++ src/core/web_contents_delegate_qt.h | 1 + 5 files changed, 18 insertions(+) (limited to 'src/core') diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 2b2512fc3..92c831f94 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -576,6 +576,12 @@ void WebContentsAdapter::selectAll() d->webContents->SelectAll(); } +void WebContentsAdapter::requestClose() +{ + Q_D(WebContentsAdapter); + d->webContents->DispatchBeforeUnload(false); +} + void WebContentsAdapter::navigateToIndex(int offset) { Q_D(WebContentsAdapter); diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index ecb084e56..54bec9adf 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -128,6 +128,7 @@ public: void inspectElementAt(const QPoint &location); bool hasInspector() const; void exitFullScreen(); + void requestClose(); void wasShown(); void wasHidden(); diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 2b9b62229..6b203fc90 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -208,6 +208,7 @@ public: virtual void unhandledKeyEvent(QKeyEvent *event) = 0; virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; virtual void close() = 0; + virtual void windowCloseRejected() = 0; virtual bool contextMenuRequested(const WebEngineContextMenuData&) = 0; virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) = 0; virtual void requestFullScreen(bool) = 0; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 1c37f62df..497910a9c 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -390,4 +390,13 @@ void WebContentsDelegateQt::MoveValidationMessage(content::WebContents *web_cont m_viewClient->moveValidationMessage(toQt(anchor_in_root_view)); } +void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool proceed, bool *proceed_to_fire_unload) +{ + Q_UNUSED(tab); + Q_ASSERT(proceed_to_fire_unload); + *proceed_to_fire_unload = proceed; + if (!proceed) + m_viewClient->windowCloseRejected(); +} + } // namespace QtWebEngineCore diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 14421d060..abdf75fe5 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -91,6 +91,7 @@ public: 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; virtual void HideValidationMessage(content::WebContents *web_contents) Q_DECL_OVERRIDE; virtual void MoveValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view) Q_DECL_OVERRIDE; + void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) Q_DECL_OVERRIDE; // WebContentsObserver overrides virtual void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) Q_DECL_OVERRIDE; -- cgit v1.2.1 From effa889ba7b7a10b3648a9ded55a5bcd4bae993a Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 8 Oct 2015 17:28:19 +0200 Subject: Add firstPartyUrl to QWebEngineUrlRequestInfo Add firstPartyUrl that can be used to identify third-party requests. Change-Id: I2b8e48ff0a1a4402af224c80f91d4e599a61a89c Reviewed-by: Leena Miettinen Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qwebengineurlrequestinfo.cpp | 14 +++++++++++++- src/core/api/qwebengineurlrequestinfo.h | 1 + src/core/api/qwebengineurlrequestinfo_p.h | 2 ++ src/core/network_delegate_qt.cpp | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index b769081f8..e8ce65be3 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -119,11 +119,12 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q */ -QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource, QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QByteArray &m) +QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource, QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu, const QByteArray &m) : resourceType(resource) , navigationType(navigation) , shouldBlockRequest(false) , url(u) + , firstPartyUrl(fpu) , method(m) { } @@ -218,6 +219,17 @@ QUrl QWebEngineUrlRequestInfo::requestUrl() const return d->url; } +/*! + Returns the first party URL of the request. + The first party URL is the URL of the page that issued the request. +*/ + +QUrl QWebEngineUrlRequestInfo::firstPartyUrl() const +{ + Q_D(const QWebEngineUrlRequestInfo); + return d->firstPartyUrl; +} + /*! Returns the HTTP method of the request (for example, GET or POST). diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h index 7c016d20d..e6e225051 100644 --- a/src/core/api/qwebengineurlrequestinfo.h +++ b/src/core/api/qwebengineurlrequestinfo.h @@ -86,6 +86,7 @@ public: NavigationType navigationType() const; QUrl requestUrl() const; + QUrl firstPartyUrl() const; QByteArray requestMethod() const; void block(bool shouldBlock); diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h index b6a304a03..1b1279d27 100644 --- a/src/core/api/qwebengineurlrequestinfo_p.h +++ b/src/core/api/qwebengineurlrequestinfo_p.h @@ -58,6 +58,7 @@ public: QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource , QWebEngineUrlRequestInfo::NavigationType navigation , const QUrl &u + , const QUrl &fpu , const QByteArray &m); QWebEngineUrlRequestInfo::ResourceType resourceType; @@ -65,6 +66,7 @@ public: bool shouldBlockRequest; QUrl url; + QUrl firstPartyUrl; const QByteArray method; QHash extraHeaders; diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp index b8f1b68d0..3f67e7c0d 100644 --- a/src/core/network_delegate_qt.cpp +++ b/src/core/network_delegate_qt.cpp @@ -106,6 +106,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C QWebEngineUrlRequestInfoPrivate *infoPrivate = new QWebEngineUrlRequestInfoPrivate(static_cast(resourceType) , static_cast(navigationType) , qUrl + , toQt(request->first_party_for_cookies()) , QByteArray::fromStdString(request->method())); QWebEngineUrlRequestInfo requestInfo(infoPrivate); if (interceptor->interceptRequest(requestInfo)) { -- cgit v1.2.1 From 3b1faa91c3e8ee4b7fb602b0b476d4deda235378 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 12 Oct 2015 13:34:17 +0200 Subject: Remove private API warning from qwebengineurlrequestjob.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie2c9e3ac60790e49a449c473cd9fb60ef698b6de Reviewed-by: Michael Brüning --- src/core/api/qwebengineurlrequestjob.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/core') diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h index 76e9b2c39..fc9f4d911 100644 --- a/src/core/api/qwebengineurlrequestjob.h +++ b/src/core/api/qwebengineurlrequestjob.h @@ -37,17 +37,6 @@ #ifndef QWEBENGINEURLREQUESTJOB_H #define QWEBENGINEURLREQUESTJOB_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - #include "qtwebenginecoreglobal.h" #include -- cgit v1.2.1 From 4654fd86fb5de097a8ad271c2f53e99e19c36c93 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 16 Sep 2015 12:04:52 +0200 Subject: Make NSS vs BoringSSL choice more flexible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the NSS library optional on Linux to reduce the hard coded difference between embedded and desktop builds. Change-Id: I3d7f703ead0ff325ffd2ae272e7e4c2d5258fc25 Reviewed-by: Michael Brüning --- src/core/config/embedded_linux.pri | 3 --- src/core/config/linux.pri | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri index cd12204f9..50f94147e 100644 --- a/src/core/config/embedded_linux.pri +++ b/src/core/config/embedded_linux.pri @@ -33,9 +33,6 @@ GYP_CONFIG += \ toolkit_views=1 \ use_custom_freetype=0 \ use_libpci=0 \ - use_nss_certs=0 \ - use_openssl=1 \ - use_openssl_certs=1 \ use_ozone=1 \ use_system_fontconfig=1 \ icu_use_data_file_flag=0 \ diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 4c2e70daf..803043c50 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -18,6 +18,12 @@ GYP_CONFIG += \ use_kerberos=0 \ use_pango=0 +!config_system_nss { + GYP_CONFIG += use_nss_certs=0 \ + use_openssl=1 \ + use_openssl_certs=1 +} + contains(QT_CONFIG, system-zlib): config_system_minizip: GYP_CONFIG += use_system_zlib=1 contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1 contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1 -- cgit v1.2.1 From e0dd0c4e02efc3897c4c1f814ee89963849ffd50 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2015 15:59:17 +0200 Subject: Clean up configure syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Imports use? qmake macro from QtWebKit and use it to make checks simpler and keep the webengine config in WEBENGINE_CONFIG. Change-Id: Ic0f1fca45ebc292d8146107697f9d3ca3764dfb4 Reviewed-by: Michael Brüning --- src/core/config/linux.pri | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/core') diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 803043c50..8d736d0c1 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -18,29 +18,28 @@ GYP_CONFIG += \ use_kerberos=0 \ use_pango=0 -!config_system_nss { +!use?(nss) { GYP_CONFIG += use_nss_certs=0 \ use_openssl=1 \ use_openssl_certs=1 } -contains(QT_CONFIG, system-zlib): config_system_minizip: GYP_CONFIG += use_system_zlib=1 +contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1 contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1 contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1 contains(QT_CONFIG, system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1 !contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0 -config_system_libevent: GYP_CONFIG += use_system_libevent=1 -config_system_libwebp: GYP_CONFIG += use_system_libwebp=1 -config_system_libsrtp: GYP_CONFIG += use_system_libsrtp=1 -config_system_libxslt: GYP_CONFIG += use_system_libxml=1 -config_system_flac: GYP_CONFIG += use_system_flac=1 -config_system_jsoncpp: GYP_CONFIG += use_system_jsoncpp=1 -config_system_opus: GYP_CONFIG += use_system_opus=1 -config_system_snappy: GYP_CONFIG += use_system_snappy=1 -config_system_speex: GYP_CONFIG += use_system_speex=1 -config_system_vpx: GYP_CONFIG += use_system_libvpx=1 - -contains(WEBENGINE_CONFIG, use_system_icu): GYP_CONFIG += use_system_icu=1 -contains(WEBENGINE_CONFIG, use_system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1 +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.1 From 981e38d2dc82c047c6ad8ec19427d3ac7434dc3c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2015 16:10:47 +0200 Subject: Fix build with freetype2 depending on harfbuzz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chromium uses system freetype2 by default but not harfbuzz by default, since some newer versions of freetype2 depends on harfbuzz, we need to configure Chromium to use system harfbuzz in those cases. Change-Id: Ic15abe85c5b7e5ef1c3d82420efbc8605c2fe1ae Reviewed-by: Michael Brüning --- src/core/config/linux.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 8d736d0c1..7f269245e 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -27,9 +27,9 @@ GYP_CONFIG += \ contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1 contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1 contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1 -contains(QT_CONFIG, system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1 !contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0 +use?(system_harfbuzz): GYP_CONFIG += use_system_harfbuzz=1 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 -- cgit v1.2.1