summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2017-06-20 17:05:42 +0200
committerSzabolcs David <davidsz@inf.u-szeged.hu>2017-06-26 08:30:16 +0000
commit5406c49638f3e4ff22a485b3788fa4f4ceb4dab9 (patch)
tree110de71b000d35a5f4df7fe3ff151afea25e3857 /src/core
parent949fb65dd958d5129b7e359fec9eb21b229b468d (diff)
Add QuotaSettings
From 58-based Chromium, we have to provide quota settings that determine the amount of disk space that may be used by storage APIs, like IndexedDB. The provided space was 0 by default, so these APIs were not working properly. Let Chromium estimate the size intelligently for now - that is exactly what Chrome and content_shell do. Change-Id: Ifd16cee92e56ec14b0c0e75b73d7238d128bebfa Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/content_browser_client_qt.cpp12
-rw-r--r--src/core/content_browser_client_qt.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 197ea5b6d..5bce81f25 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -59,6 +59,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "content/public/common/content_switches.h"
@@ -459,6 +460,17 @@ content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionCo
return new QuotaPermissionContextQt;
}
+void ContentBrowserClientQt::GetQuotaSettings(content::BrowserContext *context,
+ content::StoragePartition *partition,
+ const storage::OptionalQuotaSettingsCallback &callback)
+{
+ content::BrowserThread::PostTaskAndReplyWithResult(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(&storage::CalculateNominalDynamicSettings,
+ partition->GetPath(), context->IsOffTheRecord()),
+ callback);
+}
+
void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webContents,
int cert_error,
const net::SSLInfo& ssl_info,
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 68ec455e3..95c7d2894 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -94,6 +94,9 @@ public:
gl::GLShareGroup* GetInProcessGpuShareGroup() override;
content::MediaObserver* GetMediaObserver() override;
content::QuotaPermissionContext *CreateQuotaPermissionContext() override;
+ void GetQuotaSettings(content::BrowserContext *context,
+ content::StoragePartition *partition,
+ const storage::OptionalQuotaSettingsCallback &callback) override;
void OverrideWebkitPrefs(content::RenderViewHost *, content::WebPreferences *) override;
void AllowCertificateError(content::WebContents* web_contents,
int cert_error,