| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/http/http_stream_factory_impl_job_controller.h" | 5 #include "net/http/http_stream_factory_impl_job_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 if (use_alternative_proxy) { | 136 if (use_alternative_proxy) { |
| 137 std::unique_ptr<ProxyService> proxy_service = | 137 std::unique_ptr<ProxyService> proxy_service = |
| 138 ProxyService::CreateFixedFromPacResult("HTTPS myproxy.org:443"); | 138 ProxyService::CreateFixedFromPacResult("HTTPS myproxy.org:443"); |
| 139 session_deps_.proxy_service = std::move(proxy_service); | 139 session_deps_.proxy_service = std::move(proxy_service); |
| 140 } | 140 } |
| 141 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 141 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
| 142 factory_ = | 142 factory_ = |
| 143 static_cast<HttpStreamFactoryImpl*>(session_->http_stream_factory()); | 143 static_cast<HttpStreamFactoryImpl*>(session_->http_stream_factory()); |
| 144 job_controller_ = new HttpStreamFactoryImpl::JobController( | 144 job_controller_ = new HttpStreamFactoryImpl::JobController( |
| 145 factory_, &request_delegate_, session_.get(), &job_factory_); | 145 factory_, &request_delegate_, session_.get(), &job_factory_, |
| 146 /*is_preconnect=*/false); |
| 146 HttpStreamFactoryImplPeer::AddJobController(factory_, job_controller_); | 147 HttpStreamFactoryImplPeer::AddJobController(factory_, job_controller_); |
| 147 } | 148 } |
| 148 | 149 |
| 149 TestProxyDelegate* test_proxy_delegate() const { | 150 TestProxyDelegate* test_proxy_delegate() const { |
| 150 return test_proxy_delegate_; | 151 return test_proxy_delegate_; |
| 151 } | 152 } |
| 152 | 153 |
| 153 ~HttpStreamFactoryImplJobControllerTest() {} | 154 ~HttpStreamFactoryImplJobControllerTest() {} |
| 154 | 155 |
| 155 void SetAlternativeService(const HttpRequestInfo& request_info, | 156 void SetAlternativeService(const HttpRequestInfo& request_info, |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 EXPECT_FALSE(job_controller_->alternative_job()); | 1093 EXPECT_FALSE(job_controller_->alternative_job()); |
| 1093 // There is only 1 connect even though multiple streams were requested. | 1094 // There is only 1 connect even though multiple streams were requested. |
| 1094 EXPECT_EQ(1, HttpStreamFactoryImplJobPeer::GetNumStreams( | 1095 EXPECT_EQ(1, HttpStreamFactoryImplJobPeer::GetNumStreams( |
| 1095 job_controller_->main_job())); | 1096 job_controller_->main_job())); |
| 1096 | 1097 |
| 1097 base::RunLoop().RunUntilIdle(); | 1098 base::RunLoop().RunUntilIdle(); |
| 1098 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); | 1099 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); |
| 1099 } | 1100 } |
| 1100 | 1101 |
| 1101 } // namespace net | 1102 } // namespace net |
| OLD | NEW |