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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10113005: Remove EPM:all_hosts_ and use all_extension_views_ instead. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: interactive_ui_tests Created 8 years, 8 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 (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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 size_t max_process_count = 568 size_t max_process_count =
569 content::RenderProcessHost::GetMaxRendererProcessCount(); 569 content::RenderProcessHost::GetMaxRendererProcessCount();
570 570
571 // Go through all profiles to ensure we have total count of extension 571 // Go through all profiles to ensure we have total count of extension
572 // processes containing background pages, otherwise one profile can 572 // processes containing background pages, otherwise one profile can
573 // starve the other. 573 // starve the other.
574 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> 574 std::vector<Profile*> profiles = g_browser_process->profile_manager()->
575 GetLoadedProfiles(); 575 GetLoadedProfiles();
576 for (size_t i = 0; i < profiles.size(); ++i) { 576 for (size_t i = 0; i < profiles.size(); ++i) {
577 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager(); 577 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager();
578 for (ExtensionProcessManager::const_iterator iter = epm->begin(); 578 for (ExtensionProcessManager::const_iterator iter =
579 iter != epm->end(); 579 epm->background_hosts().begin();
580 ++iter) { 580 iter != epm->background_hosts().end(); ++iter) {
581 ExtensionHost* host = *iter; 581 ExtensionHost* host = *iter;
582 if (host->extension()->has_background_page()) { 582 process_ids.insert(host->render_process_host()->GetID());
583 process_ids.insert(host->render_process_host()->GetID());
584 }
585 } 583 }
586 } 584 }
587 585
588 if (process_ids.size() > 586 if (process_ids.size() >
589 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) { 587 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) {
590 return true; 588 return true;
591 } 589 }
592 590
593 return false; 591 return false;
594 } 592 }
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 #if defined(USE_NSS) 1626 #if defined(USE_NSS)
1629 crypto::CryptoModuleBlockingPasswordDelegate* 1627 crypto::CryptoModuleBlockingPasswordDelegate*
1630 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 1628 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
1631 const GURL& url) { 1629 const GURL& url) {
1632 return browser::NewCryptoModuleBlockingDialogDelegate( 1630 return browser::NewCryptoModuleBlockingDialogDelegate(
1633 browser::kCryptoModulePasswordKeygen, url.host()); 1631 browser::kCryptoModulePasswordKeygen, url.host());
1634 } 1632 }
1635 #endif 1633 #endif
1636 1634
1637 } // namespace chrome 1635 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698