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_script_fetcher_impl.h" | 5 #include "net/proxy/proxy_script_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 params.transport_security_state = transport_security_state(); | 79 params.transport_security_state = transport_security_state(); |
80 params.proxy_service = proxy_service(); | 80 params.proxy_service = proxy_service(); |
81 params.ssl_config_service = ssl_config_service(); | 81 params.ssl_config_service = ssl_config_service(); |
82 params.http_server_properties = http_server_properties(); | 82 params.http_server_properties = http_server_properties(); |
83 storage_.set_http_network_session( | 83 storage_.set_http_network_session( |
84 base::WrapUnique(new HttpNetworkSession(params))); | 84 base::WrapUnique(new HttpNetworkSession(params))); |
85 storage_.set_http_transaction_factory(base::WrapUnique( | 85 storage_.set_http_transaction_factory(base::WrapUnique( |
86 new HttpCache(storage_.http_network_session(), | 86 new HttpCache(storage_.http_network_session(), |
87 HttpCache::DefaultBackend::InMemory(0), false))); | 87 HttpCache::DefaultBackend::InMemory(0), false))); |
88 std::unique_ptr<URLRequestJobFactoryImpl> job_factory = | 88 std::unique_ptr<URLRequestJobFactoryImpl> job_factory = |
89 base::WrapUnique(new URLRequestJobFactoryImpl()); | 89 URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers(); |
| 90 |
90 #if !defined(DISABLE_FILE_SUPPORT) | 91 #if !defined(DISABLE_FILE_SUPPORT) |
91 job_factory->SetProtocolHandler("file", | 92 job_factory->SetProtocolHandler("file", |
92 base::WrapUnique(new FileProtocolHandler( | 93 base::WrapUnique(new FileProtocolHandler( |
93 base::ThreadTaskRunnerHandle::Get()))); | 94 base::ThreadTaskRunnerHandle::Get()))); |
94 #endif | 95 #endif |
95 storage_.set_job_factory(std::move(job_factory)); | 96 storage_.set_job_factory(std::move(job_factory)); |
96 } | 97 } |
97 | 98 |
98 ~RequestContext() override { AssertNoURLRequests(); } | 99 ~RequestContext() override { AssertNoURLRequests(); } |
99 | 100 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 base::string16 text; | 480 base::string16 text; |
480 TestCompletionCallback callback; | 481 TestCompletionCallback callback; |
481 int result = pac_fetcher.Fetch(url, &text, callback.callback()); | 482 int result = pac_fetcher.Fetch(url, &text, callback.callback()); |
482 EXPECT_EQ(ERR_FAILED, result); | 483 EXPECT_EQ(ERR_FAILED, result); |
483 } | 484 } |
484 } | 485 } |
485 | 486 |
486 } // namespace | 487 } // namespace |
487 | 488 |
488 } // namespace net | 489 } // namespace net |
OLD | NEW |