| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cert_net/cert_net_fetcher_impl.h" | 5 #include "net/cert_net/cert_net_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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 params.cert_transparency_verifier = cert_transparency_verifier(); | 61 params.cert_transparency_verifier = cert_transparency_verifier(); |
| 62 params.ct_policy_enforcer = ct_policy_enforcer(); | 62 params.ct_policy_enforcer = ct_policy_enforcer(); |
| 63 params.proxy_service = proxy_service(); | 63 params.proxy_service = proxy_service(); |
| 64 params.ssl_config_service = ssl_config_service(); | 64 params.ssl_config_service = ssl_config_service(); |
| 65 params.http_server_properties = http_server_properties(); | 65 params.http_server_properties = http_server_properties(); |
| 66 storage_.set_http_network_session( | 66 storage_.set_http_network_session( |
| 67 base::MakeUnique<HttpNetworkSession>(params)); | 67 base::MakeUnique<HttpNetworkSession>(params)); |
| 68 storage_.set_http_transaction_factory(base::MakeUnique<HttpCache>( | 68 storage_.set_http_transaction_factory(base::MakeUnique<HttpCache>( |
| 69 storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0), | 69 storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0), |
| 70 false /* set_up_quic_server_info */)); | 70 false /* set_up_quic_server_info */)); |
| 71 storage_.set_job_factory(base::MakeUnique<URLRequestJobFactoryImpl>()); | 71 storage_.set_job_factory( |
| 72 URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers()); |
| 72 } | 73 } |
| 73 | 74 |
| 74 ~RequestContext() override { AssertNoURLRequests(); } | 75 ~RequestContext() override { AssertNoURLRequests(); } |
| 75 | 76 |
| 76 private: | 77 private: |
| 77 URLRequestContextStorage storage_; | 78 URLRequestContextStorage storage_; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 class FetchResult { | 81 class FetchResult { |
| 81 public: | 82 public: |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 EXPECT_EQ(1, network_delegate_.created_requests()); | 802 EXPECT_EQ(1, network_delegate_.created_requests()); |
| 802 | 803 |
| 803 std::unique_ptr<FetchResult> result = callback1.WaitForResult(); | 804 std::unique_ptr<FetchResult> result = callback1.WaitForResult(); |
| 804 result->VerifySuccess("-cert.crt-\n"); | 805 result->VerifySuccess("-cert.crt-\n"); |
| 805 | 806 |
| 806 // request2 was cancelled. | 807 // request2 was cancelled. |
| 807 EXPECT_FALSE(callback2.HasResult()); | 808 EXPECT_FALSE(callback2.HasResult()); |
| 808 } | 809 } |
| 809 | 810 |
| 810 } // namespace net | 811 } // namespace net |
| OLD | NEW |