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

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

Powered by Google App Engine
This is Rietveld 408576698