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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 DCHECK(spdy_stream_.get()); | 231 DCHECK(spdy_stream_.get()); |
232 spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); | 232 spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); |
233 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, | 233 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, |
234 buf_len, buf->data()); | 234 buf_len, buf->data()); |
235 write_callback_ = callback; | 235 write_callback_ = callback; |
236 write_buffer_len_ = buf_len; | 236 write_buffer_len_ = buf_len; |
237 return ERR_IO_PENDING; | 237 return ERR_IO_PENDING; |
238 } | 238 } |
239 | 239 |
240 bool SpdyProxyClientSocket::SetReceiveBufferSize(int32 size) { | 240 int SpdyProxyClientSocket::SetReceiveBufferSize(int32 size) { |
241 // Since this StreamSocket sits on top of a shared SpdySession, it | 241 // Since this StreamSocket sits on top of a shared SpdySession, it |
242 // is not safe for callers to set change this underlying socket. | 242 // is not safe for callers to change this underlying socket. |
243 return false; | 243 return ERR_NOT_IMPLEMENTED; |
244 } | 244 } |
245 | 245 |
246 bool SpdyProxyClientSocket::SetSendBufferSize(int32 size) { | 246 int SpdyProxyClientSocket::SetSendBufferSize(int32 size) { |
247 // Since this StreamSocket sits on top of a shared SpdySession, it | 247 // Since this StreamSocket sits on top of a shared SpdySession, it |
248 // is not safe for callers to set change this underlying socket. | 248 // is not safe for callers to change this underlying socket. |
249 return false; | 249 return ERR_NOT_IMPLEMENTED; |
250 } | 250 } |
251 | 251 |
252 int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { | 252 int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { |
253 if (!IsConnected()) | 253 if (!IsConnected()) |
254 return ERR_SOCKET_NOT_CONNECTED; | 254 return ERR_SOCKET_NOT_CONNECTED; |
255 return spdy_stream_->GetPeerAddress(address); | 255 return spdy_stream_->GetPeerAddress(address); |
256 } | 256 } |
257 | 257 |
258 int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const { | 258 int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const { |
259 if (!IsConnected()) | 259 if (!IsConnected()) |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 } else if (!read_callback_.is_null()) { | 511 } else if (!read_callback_.is_null()) { |
512 // If we have a read_callback_, the we need to make sure we call it back. | 512 // If we have a read_callback_, the we need to make sure we call it back. |
513 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 513 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
514 } | 514 } |
515 // This may have been deleted by read_callback_, so check first. | 515 // This may have been deleted by read_callback_, so check first. |
516 if (weak_ptr.get() && !write_callback.is_null()) | 516 if (weak_ptr.get() && !write_callback.is_null()) |
517 write_callback.Run(ERR_CONNECTION_CLOSED); | 517 write_callback.Run(ERR_CONNECTION_CLOSED); |
518 } | 518 } |
519 | 519 |
520 } // namespace net | 520 } // namespace net |
OLD | NEW |