| OLD | NEW |
| 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 std::set<int> process_ids; | 253 std::set<int> process_ids; |
| 254 size_t max_process_count = | 254 size_t max_process_count = |
| 255 content::RenderProcessHost::GetMaxRendererProcessCount(); | 255 content::RenderProcessHost::GetMaxRendererProcessCount(); |
| 256 | 256 |
| 257 // Go through all profiles to ensure we have total count of extension | 257 // Go through all profiles to ensure we have total count of extension |
| 258 // processes containing background pages, otherwise one profile can | 258 // processes containing background pages, otherwise one profile can |
| 259 // starve the other. | 259 // starve the other. |
| 260 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> | 260 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> |
| 261 GetLoadedProfiles(); | 261 GetLoadedProfiles(); |
| 262 for (size_t i = 0; i < profiles.size(); ++i) { | 262 for (size_t i = 0; i < profiles.size(); ++i) { |
| 263 ProcessManager* epm = ExtensionSystem::Get(profiles[i])->process_manager(); | 263 ProcessManager* epm = ProcessManager::Get(profiles[i]); |
| 264 for (ProcessManager::const_iterator iter = epm->background_hosts().begin(); | 264 for (ProcessManager::const_iterator iter = epm->background_hosts().begin(); |
| 265 iter != epm->background_hosts().end(); ++iter) { | 265 iter != epm->background_hosts().end(); ++iter) { |
| 266 const ExtensionHost* host = *iter; | 266 const ExtensionHost* host = *iter; |
| 267 process_ids.insert(host->render_process_host()->GetID()); | 267 process_ids.insert(host->render_process_host()->GetID()); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 | 270 |
| 271 return (process_ids.size() > | 271 return (process_ids.size() > |
| 272 (max_process_count * chrome::kMaxShareOfExtensionProcesses)); | 272 (max_process_count * chrome::kMaxShareOfExtensionProcesses)); |
| 273 } | 273 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 DCHECK(profile); | 529 DCHECK(profile); |
| 530 if (ProcessMap::Get(profile)->Contains(process->GetID())) { | 530 if (ProcessMap::Get(profile)->Contains(process->GetID())) { |
| 531 command_line->AppendSwitch(switches::kExtensionProcess); | 531 command_line->AppendSwitch(switches::kExtensionProcess); |
| 532 #if defined(ENABLE_WEBRTC) | 532 #if defined(ENABLE_WEBRTC) |
| 533 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); | 533 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
| 534 #endif | 534 #endif |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace extensions | 538 } // namespace extensions |
| OLD | NEW |