| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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_script_fetcher.h" | 5 #include "net/proxy/proxy_script_fetcher.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 host_resolver_ = net::CreateSystemHostResolver(); | 33 host_resolver_ = net::CreateSystemHostResolver(); |
| 34 proxy_service_ = net::ProxyService::CreateFixed(no_proxy); | 34 proxy_service_ = net::ProxyService::CreateFixed(no_proxy); |
| 35 | 35 |
| 36 http_transaction_factory_ = | 36 http_transaction_factory_ = |
| 37 new net::HttpCache(net::HttpNetworkLayer::CreateFactory( | 37 new net::HttpCache(net::HttpNetworkLayer::CreateFactory( |
| 38 host_resolver_, proxy_service_), | 38 host_resolver_, proxy_service_), |
| 39 disk_cache::CreateInMemoryCacheBackend(0)); | 39 disk_cache::CreateInMemoryCacheBackend(0)); |
| 40 } | 40 } |
| 41 ~RequestContext() { | 41 ~RequestContext() { |
| 42 delete http_transaction_factory_; | 42 delete http_transaction_factory_; |
| 43 delete proxy_service_; | |
| 44 } | 43 } |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 // Helper for doing synch fetches. This object lives in SynchFetcher's | 46 // Helper for doing synch fetches. This object lives in SynchFetcher's |
| 48 // |io_thread_| and communicates with SynchFetcher though (|result|, |event|). | 47 // |io_thread_| and communicates with SynchFetcher though (|result|, |event|). |
| 49 class SynchFetcherThreadHelper { | 48 class SynchFetcherThreadHelper { |
| 50 public: | 49 public: |
| 51 SynchFetcherThreadHelper(base::WaitableEvent* event, FetchResult* result) | 50 SynchFetcherThreadHelper(base::WaitableEvent* event, FetchResult* result) |
| 52 : event_(event), | 51 : event_(event), |
| 53 fetch_result_(result), | 52 fetch_result_(result), |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 328 |
| 330 { // Make sure we can still fetch regular URLs. | 329 { // Make sure we can still fetch regular URLs. |
| 331 GURL url = server->TestServerPage("files/pac.nsproxy"); | 330 GURL url = server->TestServerPage("files/pac.nsproxy"); |
| 332 FetchResult result = pac_fetcher.Fetch(url); | 331 FetchResult result = pac_fetcher.Fetch(url); |
| 333 EXPECT_EQ(net::OK, result.code); | 332 EXPECT_EQ(net::OK, result.code); |
| 334 EXPECT_EQ("-pac.nsproxy-\n", result.bytes); | 333 EXPECT_EQ("-pac.nsproxy-\n", result.bytes); |
| 335 } | 334 } |
| 336 } | 335 } |
| 337 | 336 |
| 338 } // namespace net | 337 } // namespace net |
| OLD | NEW |