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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 // Go through all profiles to ensure we have total count of extension | 621 // Go through all profiles to ensure we have total count of extension |
622 // processes containing background pages, otherwise one profile can | 622 // processes containing background pages, otherwise one profile can |
623 // starve the other. | 623 // starve the other. |
624 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> | 624 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> |
625 GetLoadedProfiles(); | 625 GetLoadedProfiles(); |
626 for (size_t i = 0; i < profiles.size(); ++i) { | 626 for (size_t i = 0; i < profiles.size(); ++i) { |
627 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager(); | 627 ExtensionProcessManager* epm = profiles[i]->GetExtensionProcessManager(); |
628 for (ExtensionProcessManager::const_iterator iter = | 628 for (ExtensionProcessManager::const_iterator iter = |
629 epm->background_hosts().begin(); | 629 epm->background_hosts().begin(); |
630 iter != epm->background_hosts().end(); ++iter) { | 630 iter != epm->background_hosts().end(); ++iter) { |
631 ExtensionHost* host = *iter; | 631 const extensions::ExtensionHost* host = *iter; |
632 process_ids.insert(host->render_process_host()->GetID()); | 632 process_ids.insert(host->render_process_host()->GetID()); |
633 } | 633 } |
634 } | 634 } |
635 | 635 |
636 if (process_ids.size() > | 636 if (process_ids.size() > |
637 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) { | 637 (max_process_count * chrome::kMaxShareOfExtensionProcesses)) { |
638 return true; | 638 return true; |
639 } | 639 } |
640 | 640 |
641 return false; | 641 return false; |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 io_thread_application_locale_ = locale; | 1663 io_thread_application_locale_ = locale; |
1664 } | 1664 } |
1665 | 1665 |
1666 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1666 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1667 const std::string& locale) { | 1667 const std::string& locale) { |
1668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1669 io_thread_application_locale_ = locale; | 1669 io_thread_application_locale_ = locale; |
1670 } | 1670 } |
1671 | 1671 |
1672 } // namespace chrome | 1672 } // namespace chrome |
OLD | NEW |