OLD | NEW |
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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 // this to allow multiple chrome://tasks instances to share, but that's | 705 // this to allow multiple chrome://tasks instances to share, but that's |
706 // a very unlikely case without serious consequences. | 706 // a very unlikely case without serious consequences. |
707 if (site_url.GetOrigin() == GURL(chrome::kChromeUITaskManagerURL).GetOrigin()) | 707 if (site_url.GetOrigin() == GURL(chrome::kChromeUITaskManagerURL).GetOrigin()) |
708 return false; | 708 return false; |
709 | 709 |
710 // These may be NULL during tests. In that case, just assume any site can | 710 // These may be NULL during tests. In that case, just assume any site can |
711 // share any host. | 711 // share any host. |
712 if (!service || !process_map) | 712 if (!service || !process_map) |
713 return true; | 713 return true; |
714 | 714 |
715 // Experimental: | |
716 // If --enable-strict-site-isolation or --site-per-process is enabled, do not | |
717 // allow non-WebUI pages to share a renderer process. (We could allow pages | |
718 // from the same site or extensions of the same type to share, if we knew what | |
719 // the given process was dedicated to. Allowing no sharing is simpler for | |
720 // now.) This may cause resource exhaustion issues if too many sites are open | |
721 // at once. | |
722 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
723 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || | |
724 command_line.HasSwitch(switches::kSitePerProcess)) | |
725 return false; | |
726 | |
727 // Otherwise, just make sure the process privilege matches the privilege | 715 // Otherwise, just make sure the process privilege matches the privilege |
728 // required by the site. | 716 // required by the site. |
729 RenderProcessHostPrivilege privilege_required = | 717 RenderProcessHostPrivilege privilege_required = |
730 GetPrivilegeRequiredByUrl(site_url, service); | 718 GetPrivilegeRequiredByUrl(site_url, service); |
731 return GetProcessPrivilege(process_host, process_map, service) == | 719 return GetProcessPrivilege(process_host, process_map, service) == |
732 privilege_required; | 720 privilege_required; |
733 } | 721 } |
734 | 722 |
735 // This function is trying to limit the amount of processes used by extensions | 723 // This function is trying to limit the amount of processes used by extensions |
736 // with background pages. It uses a globally set percentage of processes to | 724 // with background pages. It uses a globally set percentage of processes to |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 io_thread_application_locale_ = locale; | 1918 io_thread_application_locale_ = locale; |
1931 } | 1919 } |
1932 | 1920 |
1933 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1921 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1934 const std::string& locale) { | 1922 const std::string& locale) { |
1935 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1923 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1936 io_thread_application_locale_ = locale; | 1924 io_thread_application_locale_ = locale; |
1937 } | 1925 } |
1938 | 1926 |
1939 } // namespace chrome | 1927 } // namespace chrome |
OLD | NEW |