| 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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 content::RenderProcessHost* process_host) { | 1220 content::RenderProcessHost* process_host) { |
| 1221 // If there is currently a prerender in progress for the host provided, | 1221 // If there is currently a prerender in progress for the host provided, |
| 1222 // it may not be shared. We require prerenders to be by themselves in a | 1222 // it may not be shared. We require prerenders to be by themselves in a |
| 1223 // separate process, so that we can monitor their resource usage, and so that | 1223 // separate process, so that we can monitor their resource usage, and so that |
| 1224 // we can track the cookies that they change. | 1224 // we can track the cookies that they change. |
| 1225 Profile* profile = Profile::FromBrowserContext( | 1225 Profile* profile = Profile::FromBrowserContext( |
| 1226 process_host->GetBrowserContext()); | 1226 process_host->GetBrowserContext()); |
| 1227 prerender::PrerenderManager* prerender_manager = | 1227 prerender::PrerenderManager* prerender_manager = |
| 1228 prerender::PrerenderManagerFactory::GetForProfile(profile); | 1228 prerender::PrerenderManagerFactory::GetForProfile(profile); |
| 1229 if (prerender_manager && | 1229 if (prerender_manager && |
| 1230 prerender_manager->IsProcessPrerendering(process_host)) { | 1230 !prerender_manager->MayReuseProcessHost(process_host)) { |
| 1231 return false; | 1231 return false; |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 return true; | 1234 return true; |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 // This function is trying to limit the amount of processes used by extensions | 1237 // This function is trying to limit the amount of processes used by extensions |
| 1238 // with background pages. It uses a globally set percentage of processes to | 1238 // with background pages. It uses a globally set percentage of processes to |
| 1239 // run such extensions and if the limit is exceeded, it returns true, to | 1239 // run such extensions and if the limit is exceeded, it returns true, to |
| 1240 // indicate to the content module to group extensions together. | 1240 // indicate to the content module to group extensions together. |
| (...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 switches::kDisableWebRtcEncryption, | 2749 switches::kDisableWebRtcEncryption, |
| 2750 }; | 2750 }; |
| 2751 to_command_line->CopySwitchesFrom(from_command_line, | 2751 to_command_line->CopySwitchesFrom(from_command_line, |
| 2752 kWebRtcDevSwitchNames, | 2752 kWebRtcDevSwitchNames, |
| 2753 arraysize(kWebRtcDevSwitchNames)); | 2753 arraysize(kWebRtcDevSwitchNames)); |
| 2754 } | 2754 } |
| 2755 } | 2755 } |
| 2756 #endif // defined(ENABLE_WEBRTC) | 2756 #endif // defined(ENABLE_WEBRTC) |
| 2757 | 2757 |
| 2758 } // namespace chrome | 2758 } // namespace chrome |
| OLD | NEW |