OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
6 | 6 |
7 #include <algorithm> // min | 7 #include <algorithm> // min |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return kProtoUnknown; | 183 return kProtoUnknown; |
184 } | 184 } |
185 | 185 |
186 bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { | 186 bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
187 bool was_npn_negotiated; | 187 bool was_npn_negotiated; |
188 NextProto protocol_negotiated; | 188 NextProto protocol_negotiated; |
189 return spdy_stream_->GetSSLInfo(ssl_info, &was_npn_negotiated, | 189 return spdy_stream_->GetSSLInfo(ssl_info, &was_npn_negotiated, |
190 &protocol_negotiated); | 190 &protocol_negotiated); |
191 } | 191 } |
192 | 192 |
| 193 void SpdyProxyClientSocket::GetConnectionAttempts( |
| 194 ConnectionAttempts* out) const { |
| 195 out->clear(); |
| 196 } |
| 197 |
193 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 198 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
194 const CompletionCallback& callback) { | 199 const CompletionCallback& callback) { |
195 DCHECK(read_callback_.is_null()); | 200 DCHECK(read_callback_.is_null()); |
196 DCHECK(!user_buffer_.get()); | 201 DCHECK(!user_buffer_.get()); |
197 | 202 |
198 if (next_state_ == STATE_DISCONNECTED) | 203 if (next_state_ == STATE_DISCONNECTED) |
199 return ERR_SOCKET_NOT_CONNECTED; | 204 return ERR_SOCKET_NOT_CONNECTED; |
200 | 205 |
201 if (next_state_ == STATE_CLOSED && read_buffer_queue_.IsEmpty()) { | 206 if (next_state_ == STATE_CLOSED && read_buffer_queue_.IsEmpty()) { |
202 return 0; | 207 return 0; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } else if (!read_callback_.is_null()) { | 521 } else if (!read_callback_.is_null()) { |
517 // If we have a read_callback_, the we need to make sure we call it back. | 522 // If we have a read_callback_, the we need to make sure we call it back. |
518 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 523 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
519 } | 524 } |
520 // This may have been deleted by read_callback_, so check first. | 525 // This may have been deleted by read_callback_, so check first. |
521 if (weak_ptr.get() && !write_callback.is_null()) | 526 if (weak_ptr.get() && !write_callback.is_null()) |
522 write_callback.Run(ERR_CONNECTION_CLOSED); | 527 write_callback.Run(ERR_CONNECTION_CLOSED); |
523 } | 528 } |
524 | 529 |
525 } // namespace net | 530 } // namespace net |
OLD | NEW |