diff options
Diffstat (limited to 'src/core')
-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 |
4 files changed, 22 insertions, 0 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; |