diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2019-03-06 13:56:01 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2019-03-07 08:21:22 +0000 |
commit | dc6c8d5c9fe61ba58d065564f4d6dc0571475004 (patch) | |
tree | 44b1edbea4ace619298b574f04b7ec993b00d8e4 | |
parent | a64565af1e2d83665b8a0ece77750ac50555423a (diff) |
Fix -no-ssl buildv5.13.0-beta1
Change-Id: I978f70545484060218f5243c74978c85bc603c16
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/core/profile_adapter.cpp | 4 | ||||
-rw-r--r-- | src/core/profile_adapter.h | 4 | ||||
-rw-r--r-- | src/core/profile_io_data_qt.cpp | 10 | ||||
-rw-r--r-- | src/core/profile_io_data_qt.h | 4 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 4 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebengineprofile.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/core.pro | 4 |
7 files changed, 33 insertions, 1 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index 7070292d6..6f05c4c3f 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -114,7 +114,9 @@ ProfileAdapter::~ProfileAdapter() m_profile->GetDownloadManager(m_profile.data())->Shutdown(); m_downloadManagerDelegate.reset(); } +#if QT_CONFIG(ssl) delete m_clientCertificateStore; +#endif Q_ASSERT(m_pageRequestInterceptors == 0); } @@ -668,11 +670,13 @@ bool ProfileAdapter::isUsedForGlobalCertificateVerification() const return m_usedForGlobalCertificateVerification; } +#if QT_CONFIG(ssl) QWebEngineClientCertificateStore *ProfileAdapter::clientCertificateStore() { if (!m_clientCertificateStore) m_clientCertificateStore = new QWebEngineClientCertificateStore(m_profile->m_profileIOData->clientCertificateStoreData()); return m_clientCertificateStore; } +#endif } // namespace QtWebEngineCore diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h index 1aff145b2..48094a3d8 100644 --- a/src/core/profile_adapter.h +++ b/src/core/profile_adapter.h @@ -205,7 +205,9 @@ public: void removePageRequestInterceptor(); bool hasPageRequestInterceptor() const { return m_pageRequestInterceptors > 0; } +#if QT_CONFIG(ssl) QWebEngineClientCertificateStore *clientCertificateStore(); +#endif QHash<QByteArray, QWeakPointer<UserNotificationController>> &ephemeralNotifications() { return m_ephemeralNotifications; } @@ -225,7 +227,9 @@ private: QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate; QScopedPointer<UserResourceControllerHost> m_userResourceController; QScopedPointer<QWebEngineCookieStore> m_cookieStore; +#if QT_CONFIG(ssl) QWebEngineClientCertificateStore *m_clientCertificateStore = nullptr; +#endif QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor; QString m_dataPath; diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index f1fe96f81..a73a7c21d 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -169,7 +169,9 @@ static net::HttpNetworkSession::Params generateNetworkSessionParams(bool ignoreC ProfileIODataQt::ProfileIODataQt(ProfileQt *profile) : m_profile(profile), +#if QT_CONFIG(ssl) m_clientCertificateStoreData(new ClientCertificateStoreData), +#endif m_mutex(QMutex::Recursive), m_weakPtrFactory(this) { @@ -209,8 +211,10 @@ QPointer<ProfileAdapter> ProfileIODataQt::profileAdapter() void ProfileIODataQt::shutdownOnUIThread() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); +#if QT_CONFIG(ssl) delete m_clientCertificateStoreData; m_clientCertificateStoreData = nullptr; +#endif bool posted = content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, this); if (!posted) { qWarning() << "Could not delete ProfileIODataQt on io thread !"; @@ -775,14 +779,20 @@ void ProfileIODataQt::updateUsedForGlobalCertificateVerification() base::BindOnce(&ProfileIODataQt::setGlobalCertificateVerification, m_weakPtr)); } +#if QT_CONFIG(ssl) ClientCertificateStoreData *ProfileIODataQt::clientCertificateStoreData() { return m_clientCertificateStoreData; } +#endif std::unique_ptr<net::ClientCertStore> ProfileIODataQt::CreateClientCertStore() { +#if QT_CONFIG(ssl) return std::unique_ptr<net::ClientCertStore>(new ClientCertOverrideStore(m_clientCertificateStoreData)); +#else + return nullptr; +#endif } // static diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index edb2fd3b5..57ddb6fd3 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -124,7 +124,9 @@ public: void updateUsedForGlobalCertificateVerification(); // runs on ui thread bool hasPageInterceptors(); +#if QT_CONFIG(ssl) ClientCertificateStoreData *clientCertificateStoreData(); +#endif std::unique_ptr<net::ClientCertStore> CreateClientCertStore(); static ProfileIODataQt *FromResourceContext(content::ResourceContext *resource_context); private: @@ -148,7 +150,9 @@ private: QAtomicPointer<net::ProxyConfigService> m_proxyConfigService; QPointer<ProfileAdapter> m_profileAdapter; // never dereferenced in IO thread and it is passed by qpointer ProfileAdapter::PersistentCookiesPolicy m_persistentCookiesPolicy; +#if QT_CONFIG(ssl) ClientCertificateStoreData *m_clientCertificateStoreData; +#endif QString m_cookiesPath; QString m_channelIdPath; QString m_httpAcceptLanguage; diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 3c4ec0595..ac75b5356 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -1086,8 +1086,12 @@ QQmlListProperty<QQuickWebEngineScript> QQuickWebEngineProfile::userScripts() */ QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore() { +#if QT_CONFIG(ssl) Q_D(QQuickWebEngineProfile); return d->profileAdapter()->clientCertificateStore(); +#else + return nullptr; +#endif } QT_END_NAMESPACE diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 50de63e9a..d69ddb343 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -871,8 +871,12 @@ void QWebEngineProfile::clearHttpCache() */ QWebEngineClientCertificateStore *QWebEngineProfile::clientCertificateStore() { +#if QT_CONFIG(ssl) Q_D(QWebEngineProfile); return d->profileAdapter()->clientCertificateStore(); +#else + return nullptr; +#endif } QT_END_NAMESPACE diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro index 5224edbdc..376f97f4d 100644 --- a/tests/auto/core/core.pro +++ b/tests/auto/core/core.pro @@ -1,9 +1,11 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += network-private SUBDIRS += \ - qwebengineclientcertificatestore \ qwebenginecookiestore \ qwebengineurlrequestinterceptor \ +qtConfig(ssl): SUBDIRS += qwebengineclientcertificatestore + # QTBUG-60268 boot2qt: SUBDIRS = "" |