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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 int64 SpdyProxyClientSocket::NumBytesRead() const { | 163 int64 SpdyProxyClientSocket::NumBytesRead() const { |
164 return -1; | 164 return -1; |
165 } | 165 } |
166 | 166 |
167 base::TimeDelta SpdyProxyClientSocket::GetConnectTimeMicros() const { | 167 base::TimeDelta SpdyProxyClientSocket::GetConnectTimeMicros() const { |
168 return base::TimeDelta::FromMicroseconds(-1); | 168 return base::TimeDelta::FromMicroseconds(-1); |
169 } | 169 } |
170 | 170 |
| 171 bool SpdyProxyClientSocket::WasNpnNegotiated() const { |
| 172 return false; |
| 173 } |
| 174 |
171 NextProto SpdyProxyClientSocket::GetNegotiatedProtocol() const { | 175 NextProto SpdyProxyClientSocket::GetNegotiatedProtocol() const { |
172 return kProtoUnknown; | 176 return kProtoUnknown; |
173 } | 177 } |
174 | 178 |
| 179 bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 180 bool was_npn_negotiated; |
| 181 NextProto protocol_negotiated; |
| 182 return spdy_stream_->GetSSLInfo(ssl_info, &was_npn_negotiated, |
| 183 &protocol_negotiated); |
| 184 } |
| 185 |
175 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 186 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
176 const CompletionCallback& callback) { | 187 const CompletionCallback& callback) { |
177 DCHECK(read_callback_.is_null()); | 188 DCHECK(read_callback_.is_null()); |
178 DCHECK(!user_buffer_); | 189 DCHECK(!user_buffer_); |
179 | 190 |
180 if (next_state_ == STATE_DISCONNECTED) | 191 if (next_state_ == STATE_DISCONNECTED) |
181 return ERR_SOCKET_NOT_CONNECTED; | 192 return ERR_SOCKET_NOT_CONNECTED; |
182 | 193 |
183 if (next_state_ == STATE_CLOSED && read_buffer_.empty()) { | 194 if (next_state_ == STATE_CLOSED && read_buffer_.empty()) { |
184 return 0; | 195 return 0; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } else if (!read_callback_.is_null()) { | 552 } else if (!read_callback_.is_null()) { |
542 // If we have a read_callback_, the we need to make sure we call it back. | 553 // If we have a read_callback_, the we need to make sure we call it back. |
543 OnDataReceived(NULL, 0); | 554 OnDataReceived(NULL, 0); |
544 } | 555 } |
545 // This may have been deleted by read_callback_, so check first. | 556 // This may have been deleted by read_callback_, so check first. |
546 if (weak_ptr && !write_callback.is_null()) | 557 if (weak_ptr && !write_callback.is_null()) |
547 write_callback.Run(ERR_CONNECTION_CLOSED); | 558 write_callback.Run(ERR_CONNECTION_CLOSED); |
548 } | 559 } |
549 | 560 |
550 } // namespace net | 561 } // namespace net |
OLD | NEW |