summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 02:16:16 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 02:16:16 +0000
commit81ae0a99d2a8d729c4417d95e622ed5b3fd802a3 (patch)
treec2ce613aad3e1062a0ce79bed9b0d99c2d0a6773 /chrome/browser
parente8035fba00f4ce5971ad80ea8be9abd363c57830 (diff)
downloadchromium_src-81ae0a99d2a8d729c4417d95e622ed5b3fd802a3.zip
chromium_src-81ae0a99d2a8d729c4417d95e622ed5b3fd802a3.tar.gz
chromium_src-81ae0a99d2a8d729c4417d95e622ed5b3fd802a3.tar.bz2
Don't run the SetProxyConfig task on the UI thread as it causes a bunch of DCHECKS
to fire in the ProxyConfigService objects. Review URL: http://codereview.chromium.org/164013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22577 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/automation/automation_provider.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 6e0171e..da9fbd5 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -2188,9 +2188,6 @@ class SetProxyConfigTask : public Task {
void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) {
URLRequestContext* context = Profile::GetDefaultRequestContext();
- // If we don't have a default request context yet then we have to create
- // one.
- bool run_on_ui_thread = false;
if (!context) {
FilePath user_data_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
@@ -2199,23 +2196,14 @@ void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) {
Profile* profile = profile_manager->GetDefaultProfile(user_data_dir);
DCHECK(profile);
context = profile->GetRequestContext();
- run_on_ui_thread = true;
}
DCHECK(context);
// Every URLRequestContext should have a proxy service.
net::ProxyService* proxy_service = context->proxy_service();
DCHECK(proxy_service);
- // If we just now created the URLRequestContext then we can immediately
- // set the proxy settings on this (the UI) thread. If there was already
- // a URLRequestContext, then run the reset on the IO thread.
- if (run_on_ui_thread) {
- SetProxyConfigTask set_proxy_config_task(proxy_service, new_proxy_config);
- set_proxy_config_task.Run();
- } else {
- g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
- new SetProxyConfigTask(proxy_service, new_proxy_config));
- }
+ g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
+ new SetProxyConfigTask(proxy_service, new_proxy_config));
}
void AutomationProvider::GetDownloadDirectory(