From 6a603af9933f42bed008e4d0dcdd81e37a0671f0 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 27 Apr 2017 14:59:31 -0400 Subject: [PATCH] Fix IndexedDB quota (issue #2070) --- libcef/browser/content_browser_client.cc | 15 +++++++++++++++ libcef/browser/content_browser_client.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index e1639aa86..3c151cb79 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -51,7 +51,9 @@ #include "content/browser/frame_host/navigation_handle_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/plugin_service_impl.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_ppapi_host.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/client_certificate_delegate.h" #include "content/public/browser/navigation_handle.h" @@ -63,6 +65,7 @@ #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/resource_dispatcher_host.h" +#include "content/public/browser/storage_partition.h" #include "content/public/common/content_switches.h" #include "content/public/common/service_names.mojom.h" #include "content/public/common/storage_quota_params.h" @@ -76,6 +79,7 @@ #include "extensions/common/switches.h" #include "net/ssl/ssl_cert_request_info.h" #include "ppapi/host/ppapi_host.h" +#include "storage/browser/quota/quota_settings.h" #include "third_party/WebKit/public/web/WebWindowFeatures.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" @@ -722,6 +726,17 @@ content::QuotaPermissionContext* return new CefQuotaPermissionContext(); } +void CefContentBrowserClient::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); +} + content::MediaObserver* CefContentBrowserClient::GetMediaObserver() { return CefMediaCaptureDevicesDispatcher::GetInstance(); } diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 97095783f..82d782bf8 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -56,6 +56,10 @@ class CefContentBrowserClient : public content::ContentBrowserClient { int child_process_id) override; content::QuotaPermissionContext* CreateQuotaPermissionContext() override; + void GetQuotaSettings( + content::BrowserContext* context, + content::StoragePartition* partition, + const storage::OptionalQuotaSettingsCallback& callback) override; content::MediaObserver* GetMediaObserver() override; content::SpeechRecognitionManagerDelegate* CreateSpeechRecognitionManagerDelegate() override;