diff options
Diffstat (limited to 'src/core/browser_context_qt.cpp')
-rw-r--r-- | src/core/browser_context_qt.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp index 3913b7548..44b6ca4ef 100644 --- a/src/core/browser_context_qt.cpp +++ b/src/core/browser_context_qt.cpp @@ -72,9 +72,21 @@ base::FilePath BrowserContextQt::GetPath() const dataLocation = QDir::homePath() % QDir::separator() % QChar::fromLatin1('.') % QCoreApplication::applicationName(); dataLocation.append(QDir::separator() % QLatin1String("QtWebEngine")); + dataLocation.append(QDir::separator() % QLatin1String("Default")); return base::FilePath(toFilePathString(dataLocation)); } +base::FilePath BrowserContextQt::GetCachePath() const +{ + QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); + if (cacheLocation.isEmpty()) + cacheLocation = QDir::homePath() % QDir::separator() % QChar::fromLatin1('.') % QCoreApplication::applicationName(); + + cacheLocation.append(QDir::separator() % QLatin1String("QtWebEngine")); + cacheLocation.append(QDir::separator() % QLatin1String("Default")); + return base::FilePath(toFilePathString(cacheLocation)); +} + bool BrowserContextQt::IsOffTheRecord() const { return false; @@ -133,7 +145,7 @@ content::PushMessagingService *BrowserContextQt::GetPushMessagingService() net::URLRequestContextGetter *BrowserContextQt::CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers) { - url_request_getter_ = new URLRequestContextGetterQt(GetPath(), protocol_handlers); + url_request_getter_ = new URLRequestContextGetterQt(GetPath(), GetCachePath(), protocol_handlers); static_cast<ResourceContextQt*>(resourceContext.get())->set_url_request_context_getter(url_request_getter_.get()); return url_request_getter_.get(); } |