| 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 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 storage_.set_http_server_properties( | 42 storage_.set_http_server_properties( |
| 43 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); | 43 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); |
| 44 | 44 |
| 45 HttpNetworkSession::Params params; | 45 HttpNetworkSession::Params params; |
| 46 params.host_resolver = host_resolver(); | 46 params.host_resolver = host_resolver(); |
| 47 params.cert_verifier = cert_verifier(); | 47 params.cert_verifier = cert_verifier(); |
| 48 params.transport_security_state = transport_security_state(); | 48 params.transport_security_state = transport_security_state(); |
| 49 params.proxy_service = proxy_service(); | 49 params.proxy_service = proxy_service(); |
| 50 params.ssl_config_service = ssl_config_service(); | 50 params.ssl_config_service = ssl_config_service(); |
| 51 params.http_server_properties = http_server_properties(); | 51 params.http_server_properties = http_server_properties(); |
| 52 scoped_refptr<HttpNetworkSession> network_session( | 52 storage_.set_http_network_session( |
| 53 new HttpNetworkSession(params)); | 53 make_scoped_ptr(new HttpNetworkSession(params))); |
| 54 storage_.set_http_transaction_factory( | 54 storage_.set_http_transaction_factory(make_scoped_ptr(new HttpCache( |
| 55 make_scoped_ptr(new HttpCache(network_session.get(), | 55 storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0), |
| 56 HttpCache::DefaultBackend::InMemory(0))) | 56 false /* set_up_quic_server_info */))); |
| 57 .Pass()); | |
| 58 storage_.set_job_factory(make_scoped_ptr(new URLRequestJobFactoryImpl())); | 57 storage_.set_job_factory(make_scoped_ptr(new URLRequestJobFactoryImpl())); |
| 59 } | 58 } |
| 60 | 59 |
| 61 ~RequestContext() override { AssertNoURLRequests(); } | 60 ~RequestContext() override { AssertNoURLRequests(); } |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 URLRequestContextStorage storage_; | 63 URLRequestContextStorage storage_; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 class FetchResult { | 66 class FetchResult { |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 EXPECT_EQ(1, network_delegate_.created_requests()); | 750 EXPECT_EQ(1, network_delegate_.created_requests()); |
| 752 | 751 |
| 753 scoped_ptr<FetchResult> result = callback1.WaitForResult(); | 752 scoped_ptr<FetchResult> result = callback1.WaitForResult(); |
| 754 result->VerifySuccess("-cert.crt-\n"); | 753 result->VerifySuccess("-cert.crt-\n"); |
| 755 | 754 |
| 756 // request2 was cancelled. | 755 // request2 was cancelled. |
| 757 EXPECT_FALSE(callback2.HasResult()); | 756 EXPECT_FALSE(callback2.HasResult()); |
| 758 } | 757 } |
| 759 | 758 |
| 760 } // namespace net | 759 } // namespace net |
| OLD | NEW |