diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 2622cb09e8f91424e2f1103d032be1aaa367c52a..d3f46163980aefa93638c1559e26333b0591a1c7 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -48,6 +48,7 @@ #include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h" #include "content/network/proxy_service_mojo.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/browsing_data_remover.h" #include "content/public/browser/cookie_store_factory.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" @@ -406,6 +407,13 @@ void URLRequestContextGetterQt::updateHttpCache() m_httpCachePath = m_browserContext.data()->httpCachePath(); m_httpCacheMaxSize = m_browserContext.data()->httpCacheMaxSize(); + if (m_httpCacheType == BrowserContextAdapter::NoCache) { + content::BrowsingDataRemover *remover = content::BrowserContext::GetBrowsingDataRemover(m_browserContext.data()->browserContext()); + remover->Remove(base::Time(), base::Time::Max(), + content::BrowsingDataRemover::DATA_TYPE_CACHE, + content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB | content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB); + } + if (m_contextInitialized && !m_updateAllStorage && !m_updateHttpCache) { m_updateHttpCache = true; content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,