summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-07-17 16:43:14 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2018-07-20 12:41:01 +0000
commit67e6b9e679856975161e85ee8011fac94b59bb22 (patch)
tree60055bc8340822986efe3c57ce55292cd265c5c8
parente96f036ac82fd280f1938eaa7a5a8f15fd844325 (diff)
Update user dir associated to BrowserContext when chaging profile's path
Otherwise, setting a WebEngineProfile to non-off-the-record would assert. Therefore, now it is safe to set the quicknanobrowser's defaultProfile to non-off-the-record. Task-number: QTBUG-69416 Change-Id: I5ca2230e12e457dd9963e386708f2394ae4c8cea Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--examples/webengine/quicknanobrowser/ApplicationRoot.qml1
-rw-r--r--src/core/profile_io_data_qt.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/webengine/quicknanobrowser/ApplicationRoot.qml b/examples/webengine/quicknanobrowser/ApplicationRoot.qml
index 014b556a1..67b686541 100644
--- a/examples/webengine/quicknanobrowser/ApplicationRoot.qml
+++ b/examples/webengine/quicknanobrowser/ApplicationRoot.qml
@@ -56,6 +56,7 @@ QtObject {
property QtObject defaultProfile: WebEngineProfile {
storageName: "Profile"
+ offTheRecord: false
}
property QtObject otrProfile: WebEngineProfile {
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index a011c2b81..547527e1f 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -70,6 +70,7 @@
#include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "net/url_request/url_request_intercepting_job_factory.h"
+#include "services/file/user_id_map.h"
#include "services/network/proxy_service_mojo.h"
#include "net/cookie_monster_delegate_qt.h"
@@ -566,6 +567,12 @@ void ProfileIODataQt::updateStorageSettings()
QMutexLocker lock(&m_mutex);
setFullConfiguration();
+ std::string userId = content::BrowserContext::GetServiceUserIdFor(m_profile);
+ if (file::GetUserDirForUserId(userId) != toFilePath(m_profileAdapter->dataPath())) {
+ file::ForgetServiceUserIdUserDirAssociation(userId);
+ file::AssociateServiceUserIdWithUserDir(userId, toFilePath(m_profileAdapter->dataPath()));
+ }
+
if (!m_updateAllStorage) {
m_updateAllStorage = true;
// We must create the proxy config service on the UI loop on Linux because it