Chromium Code Reviews| Index: net/http/http_stream_factory_impl_job.cc |
| diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc |
| index 38497c131c9a946155de2b81476950208ef2b0e2..3d16279955b3fe7a465e78d9e399cbdb3a7ee4ab 100644 |
| --- a/net/http/http_stream_factory_impl_job.cc |
| +++ b/net/http/http_stream_factory_impl_job.cc |
| @@ -134,6 +134,15 @@ std::unique_ptr<base::Value> NetLogHttpStreamJobCallback( |
| return std::move(dict); |
| } |
| +// Returns parameters associated with the start of a HTTP stream job. |
| +std::unique_ptr<base::Value> NetLogHttpStreamJobWaitingCallback( |
|
eroman
2017/02/14 21:18:36
Have you considered using NetLog::BoolCallback() ?
Ryan Hamilton
2017/02/14 21:42:37
Oh nice! I didn't know that existed. Thanks!
|
| + bool should_wait, |
| + NetLogCaptureMode /* capture_mode */) { |
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| + dict->SetBoolean("should_wait", should_wait); |
| + return std::move(dict); |
| +} |
| + |
| // Returns parameters associated with the Proto (with NPN negotiation) of a HTTP |
| // stream. |
| std::unique_ptr<base::Value> NetLogHttpStreamProtoCallback( |
| @@ -809,13 +818,18 @@ bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const { |
| int HttpStreamFactoryImpl::Job::DoWait() { |
| next_state_ = STATE_WAIT_COMPLETE; |
| - if (delegate_->ShouldWait(this)) |
| + bool should_wait = delegate_->ShouldWait(this); |
| + net_log_.BeginEvent( |
| + NetLogEventType::HTTP_STREAM_JOB_WAITING, |
| + base::Bind(&NetLogHttpStreamJobWaitingCallback, should_wait)); |
| + if (should_wait) |
| return ERR_IO_PENDING; |
| return OK; |
| } |
| int HttpStreamFactoryImpl::Job::DoWaitComplete(int result) { |
| + net_log_.EndEvent(NetLogEventType::HTTP_STREAM_JOB_WAITING); |
| DCHECK_EQ(OK, result); |
| next_state_ = STATE_INIT_CONNECTION; |
| return OK; |