summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_context_getter_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-11-07 17:07:48 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-11-07 17:17:55 +0100
commitf343e9d69a9aa8d64fe61725cf17c824f8f2d703 (patch)
treeb6ca22d2d475751c600fcf07ad16a858df8014dc /src/core/url_request_context_getter_qt.cpp
parentd2d5baeb8c3b10579f7f144e918b2935af66bec5 (diff)
Cache to QStandardPaths::CacheLocation
We should save our cache in the configured CacheLocation, and ensure we are prepared for multiple BrowserContext by caching to a Default subdir. This matches how chromium caches on linux. Change-Id: Ibe914fca35435ea1658565be87747cfabc71e97b Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/url_request_context_getter_qt.cpp')
-rw-r--r--src/core/url_request_context_getter_qt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 8d44d0ad1..8ec600a85 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -69,9 +69,10 @@ static const char kQrcSchemeQt[] = "qrc";
using content::BrowserThread;
-URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &basePath, content::ProtocolHandlerMap *protocolHandlers)
+URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &dataPath, const base::FilePath &cachePath, content::ProtocolHandlerMap *protocolHandlers)
: m_ignoreCertificateErrors(false)
- , m_basePath(basePath)
+ , m_dataPath(dataPath)
+ , m_cachePath(cachePath)
{
std::swap(m_protocolHandlers, *protocolHandlers);
@@ -93,7 +94,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
m_urlRequestContext->set_network_delegate(m_networkDelegate.get());
- base::FilePath cookiesPath = m_basePath.Append(FILE_PATH_LITERAL("Cookies"));
+ base::FilePath cookiesPath = m_dataPath.Append(FILE_PATH_LITERAL("Cookies"));
content::CookieStoreConfig cookieStoreConfig(cookiesPath, content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES, NULL, NULL);
scoped_refptr<net::CookieStore> cookieStore = content::CreateCookieStore(cookieStoreConfig);
@@ -119,7 +120,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
m_storage->set_http_server_properties(scoped_ptr<net::HttpServerProperties>(new net::HttpServerPropertiesImpl));
- base::FilePath cache_path = m_basePath.Append(FILE_PATH_LITERAL("Cache"));
+ base::FilePath cache_path = m_cachePath.Append(FILE_PATH_LITERAL("Cache"));
net::HttpCache::DefaultBackend* main_backend =
new net::HttpCache::DefaultBackend(
net::DISK_CACHE,