| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Returns |num_streams_| of |job|. It should be 0 for non-preconnect Jobs. | 143 // Returns |num_streams_| of |job|. It should be 0 for non-preconnect Jobs. |
| 144 static int GetNumStreams(const HttpStreamFactoryImpl::Job* job) { | 144 static int GetNumStreams(const HttpStreamFactoryImpl::Job* job) { |
| 145 return job->num_streams_; | 145 return job->num_streams_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Return SpdySessionKey of |job|. | 148 // Return SpdySessionKey of |job|. |
| 149 static const SpdySessionKey GetSpdySessionKey( | 149 static const SpdySessionKey GetSpdySessionKey( |
| 150 const HttpStreamFactoryImpl::Job* job) { | 150 const HttpStreamFactoryImpl::Job* job) { |
| 151 return job->GetSpdySessionKey(); | 151 return job->spdy_session_key_; |
| 152 } | 152 } |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 class JobControllerPeer { | 155 class JobControllerPeer { |
| 156 public: | 156 public: |
| 157 static bool main_job_is_blocked( | 157 static bool main_job_is_blocked( |
| 158 HttpStreamFactoryImpl::JobController* job_controller) { | 158 HttpStreamFactoryImpl::JobController* job_controller) { |
| 159 return job_controller->main_job_is_blocked_; | 159 return job_controller->main_job_is_blocked_; |
| 160 } | 160 } |
| 161 static bool main_job_is_resumed( | 161 static bool main_job_is_resumed( |
| (...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 Preconnect(kNumPreconects); | 1722 Preconnect(kNumPreconects); |
| 1723 // If experiment is enabled, only 1 stream is requested. | 1723 // If experiment is enabled, only 1 stream is requested. |
| 1724 EXPECT_EQ( | 1724 EXPECT_EQ( |
| 1725 (int)actual_num_connects, | 1725 (int)actual_num_connects, |
| 1726 HttpStreamFactoryImplJobPeer::GetNumStreams(job_controller_->main_job())); | 1726 HttpStreamFactoryImplJobPeer::GetNumStreams(job_controller_->main_job())); |
| 1727 base::RunLoop().RunUntilIdle(); | 1727 base::RunLoop().RunUntilIdle(); |
| 1728 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); | 1728 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); |
| 1729 } | 1729 } |
| 1730 | 1730 |
| 1731 } // namespace net | 1731 } // namespace net |
| OLD | NEW |