| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browsing_instance.h" | 5 #include "chrome/browser/browsing_instance.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/tab_contents/site_instance.h" | 8 #include "chrome/browser/tab_contents/site_instance.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 if (command_line.HasSwitch(switches::kProcessPerSite)) | 21 if (command_line.HasSwitch(switches::kProcessPerSite)) |
| 22 return true; | 22 return true; |
| 23 | 23 |
| 24 if (!command_line.HasSwitch(switches::kProcessPerTab)) { | 24 if (!command_line.HasSwitch(switches::kProcessPerTab)) { |
| 25 // We are not in process-per-site or process-per-tab, so we must be in the | 25 // We are not in process-per-site or process-per-tab, so we must be in the |
| 26 // default (process-per-site-instance). Only use the process-per-site | 26 // default (process-per-site-instance). Only use the process-per-site |
| 27 // logic for particular sites that we want to consolidate. | 27 // logic for particular sites that we want to consolidate. |
| 28 // Note that --single-process may have been specified, but that affects the | 28 // Note that --single-process may have been specified, but that affects the |
| 29 // process creation logic in RenderProcessHost, so we do not need to worry | 29 // process creation logic in RenderProcessHost, so we do not need to worry |
| 30 // about it here. | 30 // about it here. |
| 31 if (url.SchemeIs("chrome")) | 31 if (url.SchemeIs("chrome-ui")) |
| 32 // Always consolidate instances of the new tab page (and instances of any | 32 // Always consolidate instances of the new tab page (and instances of any |
| 33 // other internal resource urls). | 33 // other internal resource urls). |
| 34 return true; | 34 return true; |
| 35 | 35 |
| 36 // TODO(creis): List any other special cases that we want to limit to a | 36 // TODO(creis): List any other special cases that we want to limit to a |
| 37 // single process for all instances. | 37 // single process for all instances. |
| 38 } | 38 } |
| 39 | 39 |
| 40 // In all other cases, don't use process-per-site logic. | 40 // In all other cases, don't use process-per-site logic. |
| 41 return false; | 41 return false; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // for the site. (It might have been an unregistered SiteInstance. See the | 105 // for the site. (It might have been an unregistered SiteInstance. See the |
| 106 // comments in RegisterSiteInstance.) | 106 // comments in RegisterSiteInstance.) |
| 107 SiteInstanceMap* map = GetSiteInstanceMap(profile_, site_instance->site()); | 107 SiteInstanceMap* map = GetSiteInstanceMap(profile_, site_instance->site()); |
| 108 SiteInstanceMap::iterator i = map->find(site); | 108 SiteInstanceMap::iterator i = map->find(site); |
| 109 if (i != map->end() && i->second == site_instance) { | 109 if (i != map->end() && i->second == site_instance) { |
| 110 // Matches, so erase it. | 110 // Matches, so erase it. |
| 111 map->erase(i); | 111 map->erase(i); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| OLD | NEW |