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

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

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 if (!extensions::BackgroundInfo::HasBackgroundPage(extension)) 891 if (!extensions::BackgroundInfo::HasBackgroundPage(extension))
892 return false; 892 return false;
893 893
894 std::set<int> process_ids; 894 std::set<int> process_ids;
895 size_t max_process_count = 895 size_t max_process_count =
896 content::RenderProcessHost::GetMaxRendererProcessCount(); 896 content::RenderProcessHost::GetMaxRendererProcessCount();
897 897
898 // Go through all profiles to ensure we have total count of extension 898 // Go through all profiles to ensure we have total count of extension
899 // processes containing background pages, otherwise one profile can 899 // processes containing background pages, otherwise one profile can
900 // starve the other. 900 // starve the other.
901 std::vector<Profile*> profiles = g_browser_process->profile_manager()-> 901 ProfileManager* profile_manager = g_browser_process->profile_manager();
902 GetLoadedProfiles(); 902 // Tests may not set up a profile manager.
Matt Perry 2013/04/04 20:54:26 Can we fix that instead?
Paweł Hajdan Jr. 2013/04/04 21:30:05 Probably, see TestingBrowserProcess::SetProfileMan
Jeffrey Yasskin 2013/04/05 13:14:01 Some of the uses of that function re-set it to NUL
903 if (profile_manager == NULL)
904 return false;
905
906 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
903 for (size_t i = 0; i < profiles.size(); ++i) { 907 for (size_t i = 0; i < profiles.size(); ++i) {
904 ExtensionProcessManager* epm = 908 ExtensionProcessManager* epm =
905 extensions::ExtensionSystem::Get(profiles[i])->process_manager(); 909 extensions::ExtensionSystem::Get(profiles[i])->process_manager();
906 for (ExtensionProcessManager::const_iterator iter = 910 for (ExtensionProcessManager::const_iterator iter =
907 epm->background_hosts().begin(); 911 epm->background_hosts().begin();
908 iter != epm->background_hosts().end(); ++iter) { 912 iter != epm->background_hosts().end(); ++iter) {
909 const extensions::ExtensionHost* host = *iter; 913 const extensions::ExtensionHost* host = *iter;
910 process_ids.insert(host->render_process_host()->GetID()); 914 process_ids.insert(host->render_process_host()->GetID());
911 } 915 }
912 } 916 }
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 io_thread_application_locale_ = locale; 2184 io_thread_application_locale_ = locale;
2181 } 2185 }
2182 2186
2183 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 2187 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
2184 const std::string& locale) { 2188 const std::string& locale) {
2185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2186 io_thread_application_locale_ = locale; 2190 io_thread_application_locale_ = locale;
2187 } 2191 }
2188 2192
2189 } // namespace chrome 2193 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698