Index: net/spdy/spdy_proxy_client_socket.cc |
diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc |
index 74e6d7489ebe75c13df80e048dd1441833797b33..22bb60d6008c2c8ce0e335786a95f388842c444b 100644 |
--- a/net/spdy/spdy_proxy_client_socket.cc |
+++ b/net/spdy/spdy_proxy_client_socket.cc |
@@ -36,11 +36,10 @@ SpdyProxyClientSocket::SpdyProxyClientSocket( |
: next_state_(STATE_DISCONNECTED), |
spdy_stream_(spdy_stream), |
endpoint_(endpoint), |
- auth_( |
- new HttpAuthController(HttpAuth::AUTH_PROXY, |
- GURL("https://" + proxy_server.ToString()), |
- auth_cache, |
- auth_handler_factory)), |
+ auth_(new HttpAuthController(HttpAuth::AUTH_PROXY, |
+ GURL("https://" + proxy_server.ToString()), |
+ auth_cache, |
+ auth_handler_factory)), |
user_buffer_len_(0), |
write_buffer_len_(0), |
was_ever_used_(false), |
@@ -95,8 +94,8 @@ NextProto SpdyProxyClientSocket::GetProtocolNegotiated() const { |
SSLInfo ssl_info; |
bool was_npn_negotiated; |
NextProto protocol_negotiated; |
- spdy_stream_->GetSSLInfo(&ssl_info, &was_npn_negotiated, |
- &protocol_negotiated); |
+ spdy_stream_->GetSSLInfo( |
+ &ssl_info, &was_npn_negotiated, &protocol_negotiated); |
return protocol_negotiated; |
} |
@@ -154,7 +153,7 @@ bool SpdyProxyClientSocket::IsConnected() const { |
bool SpdyProxyClientSocket::IsConnectedAndIdle() const { |
return IsConnected() && read_buffer_queue_.IsEmpty() && |
- spdy_stream_->IsOpen(); |
+ spdy_stream_->IsOpen(); |
} |
const BoundNetLog& SpdyProxyClientSocket::NetLog() const { |
@@ -188,11 +187,12 @@ NextProto SpdyProxyClientSocket::GetNegotiatedProtocol() const { |
bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
bool was_npn_negotiated; |
NextProto protocol_negotiated; |
- return spdy_stream_->GetSSLInfo(ssl_info, &was_npn_negotiated, |
- &protocol_negotiated); |
+ return spdy_stream_->GetSSLInfo( |
+ ssl_info, &was_npn_negotiated, &protocol_negotiated); |
} |
-int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
+int SpdyProxyClientSocket::Read(IOBuffer* buf, |
+ int buf_len, |
const CompletionCallback& callback) { |
DCHECK(read_callback_.is_null()); |
DCHECK(!user_buffer_.get()); |
@@ -222,7 +222,8 @@ size_t SpdyProxyClientSocket::PopulateUserReadBuffer(char* data, size_t len) { |
return read_buffer_queue_.Dequeue(data, len); |
} |
-int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len, |
+int SpdyProxyClientSocket::Write(IOBuffer* buf, |
+ int buf_len, |
const CompletionCallback& callback) { |
DCHECK(write_callback_.is_null()); |
if (next_state_ != STATE_OPEN) |
@@ -230,8 +231,8 @@ int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len, |
DCHECK(spdy_stream_.get()); |
spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); |
- net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, |
- buf_len, buf->data()); |
+ net_log_.AddByteTransferEvent( |
+ NetLog::TYPE_SOCKET_BYTES_SENT, buf_len, buf->data()); |
write_callback_ = callback; |
write_buffer_len_ = buf_len; |
return ERR_IO_PENDING; |
@@ -350,19 +351,24 @@ int SpdyProxyClientSocket::DoSendRequest() { |
std::string request_line; |
HttpRequestHeaders request_headers; |
- BuildTunnelRequest(request_, authorization_headers, endpoint_, &request_line, |
+ BuildTunnelRequest(request_, |
+ authorization_headers, |
+ endpoint_, |
+ &request_line, |
&request_headers); |
- net_log_.AddEvent( |
- NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, |
- base::Bind(&HttpRequestHeaders::NetLogCallback, |
- base::Unretained(&request_headers), |
- &request_line)); |
+ net_log_.AddEvent(NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, |
+ base::Bind(&HttpRequestHeaders::NetLogCallback, |
+ base::Unretained(&request_headers), |
+ &request_line)); |
request_.extra_headers.MergeFrom(request_headers); |
scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock()); |
- CreateSpdyHeadersFromHttpRequest(request_, request_headers, headers.get(), |
- spdy_stream_->GetProtocolVersion(), true); |
+ CreateSpdyHeadersFromHttpRequest(request_, |
+ request_headers, |
+ headers.get(), |
+ spdy_stream_->GetProtocolVersion(), |
+ true); |
// Reset the URL to be the endpoint of the connection |
if (spdy_stream_->GetProtocolVersion() > 2) { |
(*headers)[":path"] = endpoint_.ToString(); |
@@ -477,7 +483,7 @@ void SpdyProxyClientSocket::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { |
} |
} |
-void SpdyProxyClientSocket::OnDataSent() { |
+void SpdyProxyClientSocket::OnDataSent() { |
DCHECK(!write_callback_.is_null()); |
int rv = write_buffer_len_; |
@@ -486,16 +492,15 @@ void SpdyProxyClientSocket::OnDataSent() { |
// Proxy write callbacks result in deep callback chains. Post to allow the |
// stream's write callback chain to unwind (see crbug.com/355511). |
base::MessageLoop::current()->PostTask( |
- FROM_HERE, |
- base::Bind(ResetAndReturn(&write_callback_), rv)); |
+ FROM_HERE, base::Bind(ResetAndReturn(&write_callback_), rv)); |
} |
-void SpdyProxyClientSocket::OnClose(int status) { |
+void SpdyProxyClientSocket::OnClose(int status) { |
was_ever_used_ = spdy_stream_->WasEverUsed(); |
spdy_stream_.reset(); |
- bool connecting = next_state_ != STATE_DISCONNECTED && |
- next_state_ < STATE_OPEN; |
+ bool connecting = |
+ next_state_ != STATE_DISCONNECTED && next_state_ < STATE_OPEN; |
if (next_state_ == STATE_OPEN) |
next_state_ = STATE_CLOSED; |
else |