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..68edabaad5e27ef46b97629d7cdde9358ef12f51 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: |
| @@ -1006,7 +1008,21 @@ int QuicStreamFactory::Create(const QuicServerId& server_id, |
| } |
| // Associate with active job to |server_id| if such exists. |
| - if (HasActiveJob(server_id)) { |
| + auto itr = active_jobs_.find(server_id); |
|
eroman
2017/04/11 01:29:44
Can you use a more descriptive name than |itr| ? I
Zhongyi Shi
2017/04/11 03:49:34
Done.
|
| + if (itr != active_jobs_.end()) { |
| + const JobSet* job_set = &itr->second; |
|
eroman
2017/04/11 01:29:44
Could this be a |const JobSet&| instead?
Zhongyi Shi
2017/04/11 03:49:34
Done.
|
| + // TODO(zhongyi): figure out how to link the NetLogs if there are more than |
| + // one job serving the same server id, i.e., auxiliary job is also |
| + // created. |
| + if (job_set->size() == 1) { |
| + const NetLogWithSource& job_net_log = job_set->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; |
| } |