Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/base_switches.h" 12 #include "base/base_switches.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/files/scoped_file.h" 16 #include "base/files/scoped_file.h"
17 #include "base/json/json_reader.h" 17 #include "base/json/json_reader.h"
18 #include "base/lazy_instance.h" 18 #include "base/lazy_instance.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/memory/ptr_util.h" 20 #include "base/memory/ptr_util.h"
21 #include "base/metrics/histogram_macros.h" 21 #include "base/metrics/histogram_macros.h"
22 #include "base/path_service.h" 22 #include "base/path_service.h"
23 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
24 #include "base/strings/string_split.h" 24 #include "base/strings/string_split.h"
25 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
26 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
27 #include "base/strings/utf_string_conversions.h" 27 #include "base/strings/utf_string_conversions.h"
28 #include "base/sys_info.h"
28 #include "base/threading/sequenced_worker_pool.h" 29 #include "base/threading/sequenced_worker_pool.h"
29 #include "base/threading/thread_task_runner_handle.h" 30 #include "base/threading/thread_task_runner_handle.h"
30 #include "build/build_config.h" 31 #include "build/build_config.h"
31 #include "chrome/browser/after_startup_task_utils.h" 32 #include "chrome/browser/after_startup_task_utils.h"
32 #include "chrome/browser/apps/app_url_redirector.h" 33 #include "chrome/browser/apps/app_url_redirector.h"
33 #include "chrome/browser/browser_about_handler.h" 34 #include "chrome/browser/browser_about_handler.h"
34 #include "chrome/browser/browser_process.h" 35 #include "chrome/browser/browser_process.h"
35 #include "chrome/browser/browser_shutdown.h" 36 #include "chrome/browser/browser_shutdown.h"
36 #include "chrome/browser/browsing_data/browsing_data_helper.h" 37 #include "chrome/browser/browsing_data/browsing_data_helper.h"
37 #include "chrome/browser/browsing_data/browsing_data_remover.h" 38 #include "chrome/browser/browsing_data/browsing_data_remover.h"
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 } 2112 }
2112 2113
2113 std::unique_ptr<storage::QuotaEvictionPolicy> 2114 std::unique_ptr<storage::QuotaEvictionPolicy>
2114 ChromeContentBrowserClient::GetTemporaryStorageEvictionPolicy( 2115 ChromeContentBrowserClient::GetTemporaryStorageEvictionPolicy(
2115 content::BrowserContext* context) { 2116 content::BrowserContext* context) {
2116 return SiteEngagementEvictionPolicy::IsEnabled() 2117 return SiteEngagementEvictionPolicy::IsEnabled()
2117 ? base::MakeUnique<SiteEngagementEvictionPolicy>(context) 2118 ? base::MakeUnique<SiteEngagementEvictionPolicy>(context)
2118 : nullptr; 2119 : nullptr;
2119 } 2120 }
2120 2121
2122 void ChromeContentBrowserClient::GetQuotaSettings(
2123 content::BrowserContext* context,
2124 content::StoragePartition* partition,
2125 const storage::OptionalQuotaSettingsCallback& callback) {
2126 content::BrowserThread::PostTaskAndReplyWithResult(
2127 content::BrowserThread::FILE, FROM_HERE,
2128 base::Bind(&storage::CalculateNominalDynamicSettings,
2129 partition->GetPath(), context->IsOffTheRecord()),
2130 callback);
2131 }
2132
2121 void ChromeContentBrowserClient::AllowCertificateError( 2133 void ChromeContentBrowserClient::AllowCertificateError(
2122 content::WebContents* web_contents, 2134 content::WebContents* web_contents,
2123 int cert_error, 2135 int cert_error,
2124 const net::SSLInfo& ssl_info, 2136 const net::SSLInfo& ssl_info,
2125 const GURL& request_url, 2137 const GURL& request_url,
2126 ResourceType resource_type, 2138 ResourceType resource_type,
2127 bool overridable, 2139 bool overridable,
2128 bool strict_enforcement, 2140 bool strict_enforcement,
2129 bool expired_previous_decision, 2141 bool expired_previous_decision,
2130 const base::Callback<void(content::CertificateRequestResultType)>& 2142 const base::Callback<void(content::CertificateRequestResultType)>&
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 kWebRtcDevSwitchNames, 3246 kWebRtcDevSwitchNames,
3235 arraysize(kWebRtcDevSwitchNames)); 3247 arraysize(kWebRtcDevSwitchNames));
3236 } 3248 }
3237 } 3249 }
3238 #endif // defined(ENABLE_WEBRTC) 3250 #endif // defined(ENABLE_WEBRTC)
3239 3251
3240 std::unique_ptr<content::MemoryCoordinatorDelegate> 3252 std::unique_ptr<content::MemoryCoordinatorDelegate>
3241 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { 3253 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
3242 return memory::ChromeMemoryCoordinatorDelegate::Create(); 3254 return memory::ChromeMemoryCoordinatorDelegate::Create();
3243 } 3255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698