| Index: net/spdy/spdy_http_stream.cc
|
| diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
|
| index b3203ff4c6ba2dfbf2fef5ca1606755980c03b96..7648fabeb3cfa495964f01c7ea07e3064c009200 100644
|
| --- a/net/spdy/spdy_http_stream.cc
|
| +++ b/net/spdy/spdy_http_stream.cc
|
| @@ -62,8 +62,8 @@ int SpdyHttpStream::InitializeStream(const HttpRequestInfo* request_info,
|
|
|
| request_info_ = request_info;
|
| if (request_info_->method == "GET") {
|
| - int error = spdy_session_->GetPushStream(request_info_->url, &stream_,
|
| - stream_net_log);
|
| + int error = spdy_session_->GetPushStream(
|
| + request_info_->url, &stream_, stream_net_log);
|
| if (error != OK)
|
| return error;
|
|
|
| @@ -75,11 +75,15 @@ int SpdyHttpStream::InitializeStream(const HttpRequestInfo* request_info,
|
| }
|
| }
|
|
|
| - int rv = stream_request_.StartRequest(
|
| - SPDY_REQUEST_RESPONSE_STREAM, spdy_session_, request_info_->url,
|
| - priority, stream_net_log,
|
| - base::Bind(&SpdyHttpStream::OnStreamCreated,
|
| - weak_factory_.GetWeakPtr(), callback));
|
| + int rv =
|
| + stream_request_.StartRequest(SPDY_REQUEST_RESPONSE_STREAM,
|
| + spdy_session_,
|
| + request_info_->url,
|
| + priority,
|
| + stream_net_log,
|
| + base::Bind(&SpdyHttpStream::OnStreamCreated,
|
| + weak_factory_.GetWeakPtr(),
|
| + callback));
|
|
|
| if (rv == OK) {
|
| stream_ = stream_request_.ReleaseStream();
|
| @@ -120,8 +124,9 @@ int SpdyHttpStream::ReadResponseHeaders(const CompletionCallback& callback) {
|
| return ERR_IO_PENDING;
|
| }
|
|
|
| -int SpdyHttpStream::ReadResponseBody(
|
| - IOBuffer* buf, int buf_len, const CompletionCallback& callback) {
|
| +int SpdyHttpStream::ReadResponseBody(IOBuffer* buf,
|
| + int buf_len,
|
| + const CompletionCallback& callback) {
|
| if (stream_.get())
|
| CHECK(!stream_->IsIdle());
|
|
|
| @@ -265,17 +270,17 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
|
| result = ERR_IO_PENDING;
|
| } else {
|
| scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock);
|
| - CreateSpdyHeadersFromHttpRequest(
|
| - *request_info_, request_headers,
|
| - headers.get(), stream_->GetProtocolVersion(),
|
| - direct_);
|
| + CreateSpdyHeadersFromHttpRequest(*request_info_,
|
| + request_headers,
|
| + headers.get(),
|
| + stream_->GetProtocolVersion(),
|
| + direct_);
|
| stream_->net_log().AddEvent(
|
| NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS,
|
| base::Bind(&SpdyHeaderBlockNetLogCallback, headers.get()));
|
| - result =
|
| - stream_->SendRequestHeaders(
|
| - headers.Pass(),
|
| - HasUploadData() ? MORE_DATA_TO_SEND : NO_MORE_DATA_TO_SEND);
|
| + result = stream_->SendRequestHeaders(
|
| + headers.Pass(),
|
| + HasUploadData() ? MORE_DATA_TO_SEND : NO_MORE_DATA_TO_SEND);
|
| }
|
|
|
| if (result == ERR_IO_PENDING) {
|
| @@ -325,16 +330,15 @@ SpdyResponseHeadersStatus SpdyHttpStream::OnResponseHeadersUpdated(
|
| // will take care of that part.
|
| SSLInfo ssl_info;
|
| NextProto protocol_negotiated = kProtoUnknown;
|
| - stream_->GetSSLInfo(&ssl_info,
|
| - &response_info_->was_npn_negotiated,
|
| - &protocol_negotiated);
|
| + stream_->GetSSLInfo(
|
| + &ssl_info, &response_info_->was_npn_negotiated, &protocol_negotiated);
|
| response_info_->npn_negotiated_protocol =
|
| SSLClientSocket::NextProtoToString(protocol_negotiated);
|
| response_info_->request_time = stream_->GetRequestTime();
|
| response_info_->connection_info =
|
| HttpResponseInfo::ConnectionInfoFromNextProto(stream_->GetProtocol());
|
| - response_info_->vary_data
|
| - .Init(*request_info_, *response_info_->headers.get());
|
| + response_info_->vary_data.Init(*request_info_,
|
| + *response_info_->headers.get());
|
|
|
| if (!callback_.is_null())
|
| DoCallback(OK);
|
| @@ -387,15 +391,13 @@ void SpdyHttpStream::OnClose(int status) {
|
|
|
| bool SpdyHttpStream::HasUploadData() const {
|
| CHECK(request_info_);
|
| - return
|
| - request_info_->upload_data_stream &&
|
| - ((request_info_->upload_data_stream->size() > 0) ||
|
| - request_info_->upload_data_stream->is_chunked());
|
| + return request_info_->upload_data_stream &&
|
| + ((request_info_->upload_data_stream->size() > 0) ||
|
| + request_info_->upload_data_stream->is_chunked());
|
| }
|
|
|
| -void SpdyHttpStream::OnStreamCreated(
|
| - const CompletionCallback& callback,
|
| - int rv) {
|
| +void SpdyHttpStream::OnStreamCreated(const CompletionCallback& callback,
|
| + int rv) {
|
| if (rv == OK) {
|
| stream_ = stream_request_.ReleaseStream();
|
| stream_->SetDelegate(this);
|
| @@ -411,11 +413,11 @@ void SpdyHttpStream::ReadAndSendRequestBodyData() {
|
| return;
|
|
|
| // Read the data from the request body stream.
|
| - const int rv = request_info_->upload_data_stream
|
| - ->Read(request_body_buf_.get(),
|
| - request_body_buf_->size(),
|
| - base::Bind(&SpdyHttpStream::OnRequestBodyReadCompleted,
|
| - weak_factory_.GetWeakPtr()));
|
| + const int rv = request_info_->upload_data_stream->Read(
|
| + request_body_buf_.get(),
|
| + request_body_buf_->size(),
|
| + base::Bind(&SpdyHttpStream::OnRequestBodyReadCompleted,
|
| + weak_factory_.GetWeakPtr()));
|
|
|
| if (rv != ERR_IO_PENDING) {
|
| // ERR_IO_PENDING is the only possible error.
|
| @@ -465,7 +467,7 @@ bool SpdyHttpStream::ShouldWaitForMoreBufferedData() const {
|
|
|
| DCHECK_GT(user_buffer_len_, 0);
|
| return response_body_queue_.GetTotalSize() <
|
| - static_cast<size_t>(user_buffer_len_);
|
| + static_cast<size_t>(user_buffer_len_);
|
| }
|
|
|
| bool SpdyHttpStream::DoBufferedReadCallback() {
|
|
|