summaryrefslogtreecommitdiffstats
path: root/src/core/profile_io_data_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-23 13:11:58 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-29 09:17:28 +0200
commitf341988f451c6ba1fc3b8da765c00d1d64eaff30 (patch)
tree407e1f7d121c19d20006ec7e143210a0aea7ef92 /src/core/profile_io_data_qt.cpp
parent1a26c0ace958c3604c8a751134429dd38168a1a1 (diff)
Return valid path in Profile::GetPath() for incognito profiles
Parts of Chromium depends on it for temporary directories it creates. This also changes the logic of depending on it being empty as indicating an in memory profile, so it required a bit of cleaning up. Note this does subtly change the return value of off-the-record profiles. Task-number: QTBUG-62957 Change-Id: Iec6e24556128c515fce27803171a766b8a9d92e3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.cpp')
-rw-r--r--src/core/profile_io_data_qt.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index ecebbdaa7..02912e35e 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -179,6 +179,8 @@ void ProfileIODataQt::setFullConfiguration()
m_httpCacheMaxSize = m_profileAdapter->httpCacheMaxSize();
m_useForGlobalCertificateVerification = m_profileAdapter->isUsedForGlobalCertificateVerification();
m_dataPath = m_profileAdapter->dataPath();
+ m_storageName = m_profileAdapter->storageName();
+ m_inMemoryOnly = m_profileAdapter->isOffTheRecord() || m_storageName.isEmpty();
}
void ProfileIODataQt::resetNetworkContext()
@@ -221,7 +223,7 @@ network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextPar
network::mojom::NetworkContextParamsPtr network_context_params =
SystemNetworkContextManager::GetInstance()->CreateDefaultNetworkContextParams();
- network_context_params->context_name = m_profile->profileAdapter()->storageName().toStdString();
+ network_context_params->context_name = m_storageName.toStdString();
network_context_params->user_agent = m_httpUserAgent.toStdString();
network_context_params->accept_language = m_httpAcceptLanguage.toStdString();
@@ -234,7 +236,7 @@ network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextPar
if (m_httpCacheType == ProfileAdapter::DiskHttpCache && !m_httpCachePath.isEmpty())
network_context_params->http_cache_path = toFilePath(m_httpCachePath);
- if (m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies && !m_dataPath.isEmpty()) {
+ if (m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies && !m_inMemoryOnly) {
base::FilePath cookie_path = toFilePath(m_dataPath);
cookie_path = cookie_path.AppendASCII("Cookies");
network_context_params->cookie_path = cookie_path;
@@ -242,7 +244,7 @@ network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextPar
network_context_params->restore_old_session_cookies = m_persistentCookiesPolicy == ProfileAdapter::ForcePersistentCookies;
network_context_params->persist_session_cookies = m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies;
}
- if (!m_dataPath.isEmpty()) {
+ if (!m_inMemoryOnly) {
network_context_params->http_server_properties_path = toFilePath(m_dataPath).AppendASCII("Network Persistent State");
network_context_params->transport_security_persister_path = toFilePath(m_dataPath);
}