diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-01-24 14:40:01 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-26 14:10:18 +0100 |
commit | 6adf1bf7162185d1f57f0a25226dec8e27520673 (patch) | |
tree | a493ab3241ecade943f1aaf5f814f5f22f3b6c16 /src/core/profile_io_data_qt.cpp | |
parent | d9349a299f66fb154ad24f410451872a7ca253fb (diff) |
Fix changing profile settings with network service
Fixes: QTBUG-81558
Change-Id: I6f6d1b927d0f20d99477dce21697d4a03f61c059
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.cpp')
-rw-r--r-- | src/core/profile_io_data_qt.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index ef8f30e10..00d3e768a 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -41,6 +41,7 @@ #include "base/task/post_task.h" #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" +#include "content/browser/storage_partition_impl.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/browsing_data_remover.h" @@ -224,6 +225,18 @@ void ProfileIODataQt::setFullConfiguration() m_dataPath = m_profileAdapter->dataPath(); } +void ProfileIODataQt::resetNetworkContext() +{ + Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + setFullConfiguration(); + content::BrowserContext::ForEachStoragePartition( + m_profile, base::BindRepeating([](content::StoragePartition *storage) { + auto storage_impl = static_cast<content::StoragePartitionImpl *>(storage); + storage_impl->ResetURLLoaderFactories(); + storage_impl->ResetNetworkContext(); + })); +} + void ProfileIODataQt::requestStorageGeneration() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); const std::lock_guard<QRecursiveMutex> lock(m_mutex); |