summaryrefslogtreecommitdiffstats
path: root/src/core/profile_io_data_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-27 13:49:30 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-01 22:32:13 +0000
commit4dc312011bcaa2ee2cf812b5b84dc9238130e608 (patch)
tree495513b9fe73d2d1e45ea84c3e00e43e4625a5ee /src/core/profile_io_data_qt.cpp
parent9e299978cfb40e01f2871b71129a02f4b5b7404d (diff)
Tie client certificate stores to profiles
Move the client certificate store from being global to being tied to individual profiles. Change-Id: Ib21ae14c501b7d0612b84ae7535120291aeeada2 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.cpp')
-rw-r--r--src/core/profile_io_data_qt.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 01a4e98aa..f1fe96f81 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -79,6 +79,7 @@
#include "services/network/proxy_service_mojo.h"
#include "net/client_cert_override.h"
+#include "net/client_cert_store_data.h"
#include "net/cookie_monster_delegate_qt.h"
#include "net/custom_protocol_handler.h"
#include "net/network_delegate_qt.h"
@@ -168,6 +169,7 @@ static net::HttpNetworkSession::Params generateNetworkSessionParams(bool ignoreC
ProfileIODataQt::ProfileIODataQt(ProfileQt *profile)
: m_profile(profile),
+ m_clientCertificateStoreData(new ClientCertificateStoreData),
m_mutex(QMutex::Recursive),
m_weakPtrFactory(this)
{
@@ -207,6 +209,8 @@ QPointer<ProfileAdapter> ProfileIODataQt::profileAdapter()
void ProfileIODataQt::shutdownOnUIThread()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ delete m_clientCertificateStoreData;
+ m_clientCertificateStoreData = nullptr;
bool posted = content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, this);
if (!posted) {
qWarning() << "Could not delete ProfileIODataQt on io thread !";
@@ -771,9 +775,14 @@ void ProfileIODataQt::updateUsedForGlobalCertificateVerification()
base::BindOnce(&ProfileIODataQt::setGlobalCertificateVerification, m_weakPtr));
}
+ClientCertificateStoreData *ProfileIODataQt::clientCertificateStoreData()
+{
+ return m_clientCertificateStoreData;
+}
+
std::unique_ptr<net::ClientCertStore> ProfileIODataQt::CreateClientCertStore()
{
- return std::unique_ptr<net::ClientCertStore>(new ClientCertOverrideStore());
+ return std::unique_ptr<net::ClientCertStore>(new ClientCertOverrideStore(m_clientCertificateStoreData));
}
// static