| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void SpdyProxyClientSocket::GetConnectionAttempts( | 182 void SpdyProxyClientSocket::GetConnectionAttempts( |
| 183 ConnectionAttempts* out) const { | 183 ConnectionAttempts* out) const { |
| 184 out->clear(); | 184 out->clear(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 int64_t SpdyProxyClientSocket::GetTotalReceivedBytes() const { | 187 int64_t SpdyProxyClientSocket::GetTotalReceivedBytes() const { |
| 188 NOTIMPLEMENTED(); | 188 NOTIMPLEMENTED(); |
| 189 return 0; | 189 return 0; |
| 190 } | 190 } |
| 191 | 191 |
| 192 void SpdyProxyClientSocket::DumpMemoryStats( |
| 193 base::trace_event::MemoryAllocatorDump* dump) const {} |
| 194 |
| 192 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 195 int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
| 193 const CompletionCallback& callback) { | 196 const CompletionCallback& callback) { |
| 194 DCHECK(read_callback_.is_null()); | 197 DCHECK(read_callback_.is_null()); |
| 195 DCHECK(!user_buffer_.get()); | 198 DCHECK(!user_buffer_.get()); |
| 196 | 199 |
| 197 if (next_state_ == STATE_DISCONNECTED) | 200 if (next_state_ == STATE_DISCONNECTED) |
| 198 return ERR_SOCKET_NOT_CONNECTED; | 201 return ERR_SOCKET_NOT_CONNECTED; |
| 199 | 202 |
| 200 if (next_state_ == STATE_CLOSED && read_buffer_queue_.IsEmpty()) { | 203 if (next_state_ == STATE_CLOSED && read_buffer_queue_.IsEmpty()) { |
| 201 return 0; | 204 return 0; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } else if (!read_callback_.is_null()) { | 523 } else if (!read_callback_.is_null()) { |
| 521 // If we have a read_callback_, the we need to make sure we call it back. | 524 // If we have a read_callback_, the we need to make sure we call it back. |
| 522 OnDataReceived(std::unique_ptr<SpdyBuffer>()); | 525 OnDataReceived(std::unique_ptr<SpdyBuffer>()); |
| 523 } | 526 } |
| 524 // This may have been deleted by read_callback_, so check first. | 527 // This may have been deleted by read_callback_, so check first. |
| 525 if (weak_ptr.get() && !write_callback.is_null()) | 528 if (weak_ptr.get() && !write_callback.is_null()) |
| 526 write_callback.Run(ERR_CONNECTION_CLOSED); | 529 write_callback.Run(ERR_CONNECTION_CLOSED); |
| 527 } | 530 } |
| 528 | 531 |
| 529 } // namespace net | 532 } // namespace net |
| OLD | NEW |