| 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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 base::Bind(&SynchConfigGetter::CleanUp, base::Unretained(this))); | 281 base::Bind(&SynchConfigGetter::CleanUp, base::Unretained(this))); |
| 282 Wait(); | 282 Wait(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 // Does gconf setup and initial fetch of the proxy config, | 285 // Does gconf setup and initial fetch of the proxy config, |
| 286 // all on the calling thread (meant to be the thread with the | 286 // all on the calling thread (meant to be the thread with the |
| 287 // default glib main loop, which is the UI thread). | 287 // default glib main loop, which is the UI thread). |
| 288 void SetupAndInitialFetch() { | 288 void SetupAndInitialFetch() { |
| 289 // We pass the mock IO thread as both the IO and file threads. | 289 // We pass the mock IO thread as both the IO and file threads. |
| 290 config_service_->SetupAndFetchInitialConfig( | 290 config_service_->SetupAndFetchInitialConfig( |
| 291 base::ThreadTaskRunnerHandle::Get(), io_thread_.message_loop_proxy(), | 291 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner(), |
| 292 io_thread_.message_loop_proxy()); | 292 io_thread_.task_runner()); |
| 293 } | 293 } |
| 294 // Synchronously gets the proxy config. | 294 // Synchronously gets the proxy config. |
| 295 ProxyConfigService::ConfigAvailability SyncGetLatestProxyConfig( | 295 ProxyConfigService::ConfigAvailability SyncGetLatestProxyConfig( |
| 296 ProxyConfig* config) { | 296 ProxyConfig* config) { |
| 297 io_thread_.message_loop()->PostTask(FROM_HERE, | 297 io_thread_.message_loop()->PostTask(FROM_HERE, |
| 298 base::Bind(&SynchConfigGetter::GetLatestConfigOnIOThread, | 298 base::Bind(&SynchConfigGetter::GetLatestConfigOnIOThread, |
| 299 base::Unretained(this))); | 299 base::Unretained(this))); |
| 300 Wait(); | 300 Wait(); |
| 301 *config = proxy_config_; | 301 *config = proxy_config_; |
| 302 return get_latest_config_result_; | 302 return get_latest_config_result_; |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, | 1603 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, |
| 1604 sync_config_getter.SyncGetLatestProxyConfig(&config)); | 1604 sync_config_getter.SyncGetLatestProxyConfig(&config)); |
| 1605 EXPECT_TRUE(config.auto_detect()); | 1605 EXPECT_TRUE(config.auto_detect()); |
| 1606 EXPECT_EQ(GURL(), config.pac_url()); | 1606 EXPECT_EQ(GURL(), config.pac_url()); |
| 1607 } | 1607 } |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 } // namespace | 1610 } // namespace |
| 1611 | 1611 |
| 1612 } // namespace net | 1612 } // namespace net |
| OLD | NEW |