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

Side by Side Diff: extensions/shell/browser/shell_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: rebase Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/shell_content_browser_client.h" 5 #include "extensions/shell/browser/shell_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 19 matching lines...) Expand all
30 #include "extensions/browser/io_thread_extension_message_filter.h" 30 #include "extensions/browser/io_thread_extension_message_filter.h"
31 #include "extensions/browser/process_map.h" 31 #include "extensions/browser/process_map.h"
32 #include "extensions/common/constants.h" 32 #include "extensions/common/constants.h"
33 #include "extensions/common/extension.h" 33 #include "extensions/common/extension.h"
34 #include "extensions/common/switches.h" 34 #include "extensions/common/switches.h"
35 #include "extensions/shell/browser/shell_browser_context.h" 35 #include "extensions/shell/browser/shell_browser_context.h"
36 #include "extensions/shell/browser/shell_browser_main_parts.h" 36 #include "extensions/shell/browser/shell_browser_main_parts.h"
37 #include "extensions/shell/browser/shell_extension_system.h" 37 #include "extensions/shell/browser/shell_extension_system.h"
38 #include "extensions/shell/browser/shell_navigation_ui_data.h" 38 #include "extensions/shell/browser/shell_navigation_ui_data.h"
39 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" 39 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h"
40 #include "storage/browser/quota/quota_settings.h"
40 #include "url/gurl.h" 41 #include "url/gurl.h"
41 42
42 #if !defined(DISABLE_NACL) 43 #if !defined(DISABLE_NACL)
43 #include "components/nacl/browser/nacl_browser.h" 44 #include "components/nacl/browser/nacl_browser.h"
44 #include "components/nacl/browser/nacl_host_message_filter.h" 45 #include "components/nacl/browser/nacl_host_message_filter.h"
45 #include "components/nacl/browser/nacl_process_host.h" 46 #include "components/nacl/browser/nacl_process_host.h"
46 #include "components/nacl/common/nacl_process_type.h" 47 #include "components/nacl/common/nacl_process_type.h"
47 #include "components/nacl/common/nacl_switches.h" 48 #include "components/nacl/common/nacl_switches.h"
48 #include "content/public/browser/browser_child_process_host.h" 49 #include "content/public/browser/browser_child_process_host.h"
49 #include "content/public/browser/child_process_data.h" 50 #include "content/public/browser/child_process_data.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 bool ShellContentBrowserClient::ShouldUseProcessPerSite( 114 bool ShellContentBrowserClient::ShouldUseProcessPerSite(
114 content::BrowserContext* browser_context, 115 content::BrowserContext* browser_context,
115 const GURL& effective_url) { 116 const GURL& effective_url) {
116 // This ensures that all render views created for a single app will use the 117 // This ensures that all render views created for a single app will use the
117 // same render process (see content::SiteInstance::GetProcess). Otherwise the 118 // same render process (see content::SiteInstance::GetProcess). Otherwise the
118 // default behavior of ContentBrowserClient will lead to separate render 119 // default behavior of ContentBrowserClient will lead to separate render
119 // processes for the background page and each app window view. 120 // processes for the background page and each app window view.
120 return true; 121 return true;
121 } 122 }
122 123
124 void ShellContentBrowserClient::GetQuotaSettings(
125 content::BrowserContext* context,
126 content::StoragePartition* partition,
127 const storage::OptionalQuotaSettingsCallback& callback) {
128 content::BrowserThread::PostTaskAndReplyWithResult(
129 content::BrowserThread::FILE, FROM_HERE,
130 base::Bind(&storage::CalculateNominalDynamicSettings,
131 partition->GetPath(), context->IsOffTheRecord()),
132 callback);
133 }
134
123 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { 135 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) {
124 if (!url.is_valid()) 136 if (!url.is_valid())
125 return false; 137 return false;
126 // Keep in sync with ProtocolHandlers added in 138 // Keep in sync with ProtocolHandlers added in
127 // ShellBrowserContext::CreateRequestContext() and in 139 // ShellBrowserContext::CreateRequestContext() and in
128 // content::ShellURLRequestContextGetter::GetURLRequestContext(). 140 // content::ShellURLRequestContextGetter::GetURLRequestContext().
129 static const char* const kProtocolList[] = { 141 static const char* const kProtocolList[] = {
130 url::kBlobScheme, 142 url::kBlobScheme,
131 content::kChromeDevToolsScheme, 143 content::kChromeDevToolsScheme,
132 content::kChromeUIScheme, 144 content::kChromeUIScheme,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 283
272 const Extension* ShellContentBrowserClient::GetExtension( 284 const Extension* ShellContentBrowserClient::GetExtension(
273 content::SiteInstance* site_instance) { 285 content::SiteInstance* site_instance) {
274 ExtensionRegistry* registry = 286 ExtensionRegistry* registry =
275 ExtensionRegistry::Get(site_instance->GetBrowserContext()); 287 ExtensionRegistry::Get(site_instance->GetBrowserContext());
276 return registry->enabled_extensions().GetExtensionOrAppByURL( 288 return registry->enabled_extensions().GetExtensionOrAppByURL(
277 site_instance->GetSiteURL()); 289 site_instance->GetSiteURL());
278 } 290 }
279 291
280 } // namespace extensions 292 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698