Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index 1e34ed6f6fd0a74c29bf4128145698becfda6720..327f3ac7afc667e00a3fbdc9e7d978a25c53c328 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -45,7 +45,6 @@ |
#include "chrome/browser/content_settings/tab_specific_content_settings.h" |
#include "chrome/browser/defaults.h" |
#include "chrome/browser/download/download_prefs.h" |
-#include "chrome/browser/engagement/site_engagement_eviction_policy.h" |
#include "chrome/browser/field_trial_recorder.h" |
#include "chrome/browser/font_family_cache.h" |
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
@@ -414,6 +413,8 @@ namespace { |
// thread. |
base::LazyInstance<std::string> g_io_thread_application_locale; |
+const storage::QuotaSettings* g_default_quota_settings; |
+ |
#if BUILDFLAG(ENABLE_PLUGINS) |
// TODO(teravest): Add renderer-side API-specific checking for these APIs so |
// that blanket permission isn't granted to all dev channel APIs for these. |
@@ -2176,12 +2177,20 @@ ChromeContentBrowserClient::CreateQuotaPermissionContext() { |
return new ChromeQuotaPermissionContext(); |
} |
-std::unique_ptr<storage::QuotaEvictionPolicy> |
-ChromeContentBrowserClient::GetTemporaryStorageEvictionPolicy( |
- content::BrowserContext* context) { |
- return SiteEngagementEvictionPolicy::IsEnabled() |
- ? base::MakeUnique<SiteEngagementEvictionPolicy>(context) |
- : nullptr; |
+void ChromeContentBrowserClient::GetQuotaSettings( |
+ content::BrowserContext* context, |
+ content::StoragePartition* partition, |
+ const storage::OptionalQuotaSettingsCallback& callback) { |
+ if (g_default_quota_settings) { |
+ // For debugging tests harness can inject settings. |
+ callback.Run(*g_default_quota_settings); |
+ return; |
+ } |
+ content::BrowserThread::PostTaskAndReplyWithResult( |
+ content::BrowserThread::FILE, FROM_HERE, |
+ base::Bind(&storage::CalculateNominalDynamicSettings, |
+ partition->GetPath(), context->IsOffTheRecord()), |
+ callback); |
} |
void ChromeContentBrowserClient::AllowCertificateError( |
@@ -3422,3 +3431,9 @@ bool ChromeContentBrowserClient:: |
return variations::GetVariationParamValue( |
"BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
} |
+ |
+//static |
+void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
+ const storage::QuotaSettings* settings) { |
+ g_default_quota_settings = settings; |
+} |