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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 size_t max_process_count = | 588 size_t max_process_count = |
589 content::RenderProcessHost::GetMaxRendererProcessCount(); | 589 content::RenderProcessHost::GetMaxRendererProcessCount(); |
590 | 590 |
591 // Go through all profiles to ensure we have total count of extension | 591 // Go through all profiles to ensure we have total count of extension |
592 // processes containing background pages, otherwise one profile can | 592 // processes containing background pages, otherwise one profile can |
593 // starve the other. | 593 // starve the other. |
594 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> | 594 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> |
595 GetLoadedProfiles(); | 595 GetLoadedProfiles(); |
596 for (size_t i = 0; i < profiles.size(); ++i) { | 596 for (size_t i = 0; i < profiles.size(); ++i) { |
597 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager(); | 597 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager(); |
598 for (ExtensionProcessManager::const_iterator iter = epm->begin(); | 598 for (ExtensionProcessManager::const_iterator iter = |
599 iter != epm->end(); | 599 epm->background_hosts().begin(); |
600 ++iter) { | 600 iter != epm->background_hosts().end(); ++iter) { |
601 ExtensionHost* host = *iter; | 601 ExtensionHost* host = *iter; |
602 if (host->extension()->has_background_page()) { | 602 process_ids.insert(host->render_process_host()->GetID()); |
603 process_ids.insert(host->render_process_host()->GetID()); | |
604 } | |
605 } | 603 } |
606 } | 604 } |
607 | 605 |
608 if (process_ids.size() > | 606 if (process_ids.size() > |
609 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) { | 607 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) { |
610 return true; | 608 return true; |
611 } | 609 } |
612 | 610 |
613 return false; | 611 return false; |
614 } | 612 } |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 #if defined(USE_NSS) | 1643 #if defined(USE_NSS) |
1646 crypto::CryptoModuleBlockingPasswordDelegate* | 1644 crypto::CryptoModuleBlockingPasswordDelegate* |
1647 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1645 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1648 const GURL& url) { | 1646 const GURL& url) { |
1649 return browser::NewCryptoModuleBlockingDialogDelegate( | 1647 return browser::NewCryptoModuleBlockingDialogDelegate( |
1650 browser::kCryptoModulePasswordKeygen, url.host()); | 1648 browser::kCryptoModulePasswordKeygen, url.host()); |
1651 } | 1649 } |
1652 #endif | 1650 #endif |
1653 | 1651 |
1654 } // namespace chrome | 1652 } // namespace chrome |
OLD | NEW |