Chromium Code Reviews| Index: net/spdy/spdy_session.cc |
| diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc |
| index 32630a8459e484630d768f419333c124c034ca96..85bd2223ae4d42b3bd00ac9bd782461ee71b3cbf 100644 |
| --- a/net/spdy/spdy_session.cc |
| +++ b/net/spdy/spdy_session.cc |
| @@ -826,6 +826,9 @@ void SpdySession::ProcessPendingStreamRequests() { |
| if (!pending_request) |
| break; |
| + // Note that this post can race with other stream creations, and it's |
| + // possible that the un-stalled stream will be stalled again if it loses. |
| + // TODO(jgraettinger): Provide stronger ordering guarantees. |
| base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| base::Bind(&SpdySession::CompleteStreamRequest, |
| @@ -2860,11 +2863,13 @@ void SpdySession::CompleteStreamRequest( |
| return; |
| base::WeakPtr<SpdyStream> stream; |
| - int rv = CreateStream(*pending_request, &stream); |
| + int rv = TryCreateStream(pending_request, &stream); |
| if (rv == OK) { |
|
Ryan Hamilton
2014/05/19 23:00:07
How 'bout early return here:
if (rv == OK) {
DC
Johnny
2014/05/19 23:37:32
Done.
|
| DCHECK(stream); |
| pending_request->OnRequestCompleteSuccess(stream); |
| + } else if (rv == ERR_IO_PENDING) { |
| + DCHECK(!stream); |
| } else { |
| DCHECK(!stream); |
| pending_request->OnRequestCompleteFailure(rv); |