Chromium Code Reviews| Index: net/quic/chromium/quic_stream_factory.cc |
| diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc |
| index 1fe0bf28f1878cae0695a69dfbbe1396be04291c..948efce1738cd84782131c694406b4a94a570e95 100644 |
| --- a/net/quic/chromium/quic_stream_factory.cc |
| +++ b/net/quic/chromium/quic_stream_factory.cc |
| @@ -345,6 +345,8 @@ class QuicStreamFactory::Job { |
| const QuicSessionKey& key() const { return key_; } |
| + const NetLogWithSource& net_log() const { return net_log_; } |
| + |
| base::WeakPtr<Job> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } |
| private: |
| @@ -1007,6 +1009,16 @@ int QuicStreamFactory::Create(const QuicServerId& server_id, |
| // Associate with active job to |server_id| if such exists. |
| if (HasActiveJob(server_id)) { |
| + if (active_jobs_[server_id].size() == 1) { |
|
eroman
2017/04/10 21:55:07
nit: There are 3 instances of active_jobs_[server
Zhongyi Shi
2017/04/10 23:50:49
Yeah, we could reduce the 2 lookups to 1. However,
xunjieli
2017/04/10 23:56:24
I agreed with Eric. I landed a CL last week to red
Zhongyi Shi
2017/04/11 00:27:04
Done.
|
| + const NetLogWithSource& job_net_log = |
| + active_jobs_[server_id].begin()->first->net_log(); |
| + job_net_log.AddEvent( |
| + NetLogEventType::QUIC_STREAM_FACTORY_JOB_BOUND_TO_HTTP_STREAM_JOB, |
| + net_log.source().ToEventParametersCallback()); |
| + net_log.AddEvent( |
| + NetLogEventType::HTTP_STREAM_JOB_BOUND_TO_QUIC_STREAM_FACTORY_JOB, |
| + job_net_log.source().ToEventParametersCallback()); |
| + } |
| job_requests_map_[server_id].insert(request); |
| return ERR_IO_PENDING; |
| } |