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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 DCHECK(spdy_stream_.get()); | 238 DCHECK(spdy_stream_.get()); |
239 spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); | 239 spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); |
240 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, | 240 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, |
241 buf_len, buf->data()); | 241 buf_len, buf->data()); |
242 write_callback_ = callback; | 242 write_callback_ = callback; |
243 write_buffer_len_ = buf_len; | 243 write_buffer_len_ = buf_len; |
244 return ERR_IO_PENDING; | 244 return ERR_IO_PENDING; |
245 } | 245 } |
246 | 246 |
247 int SpdyProxyClientSocket::SetReceiveBufferSize(int32 size) { | 247 int SpdyProxyClientSocket::SetReceiveBufferSize(int32_t size) { |
248 // Since this StreamSocket sits on top of a shared SpdySession, it | 248 // Since this StreamSocket sits on top of a shared SpdySession, it |
249 // is not safe for callers to change this underlying socket. | 249 // is not safe for callers to change this underlying socket. |
250 return ERR_NOT_IMPLEMENTED; | 250 return ERR_NOT_IMPLEMENTED; |
251 } | 251 } |
252 | 252 |
253 int SpdyProxyClientSocket::SetSendBufferSize(int32 size) { | 253 int SpdyProxyClientSocket::SetSendBufferSize(int32_t size) { |
254 // Since this StreamSocket sits on top of a shared SpdySession, it | 254 // Since this StreamSocket sits on top of a shared SpdySession, it |
255 // is not safe for callers to change this underlying socket. | 255 // is not safe for callers to change this underlying socket. |
256 return ERR_NOT_IMPLEMENTED; | 256 return ERR_NOT_IMPLEMENTED; |
257 } | 257 } |
258 | 258 |
259 int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { | 259 int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { |
260 if (!IsConnected()) | 260 if (!IsConnected()) |
261 return ERR_SOCKET_NOT_CONNECTED; | 261 return ERR_SOCKET_NOT_CONNECTED; |
262 return spdy_stream_->GetPeerAddress(address); | 262 return spdy_stream_->GetPeerAddress(address); |
263 } | 263 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } else if (!read_callback_.is_null()) { | 529 } else if (!read_callback_.is_null()) { |
530 // If we have a read_callback_, the we need to make sure we call it back. | 530 // If we have a read_callback_, the we need to make sure we call it back. |
531 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 531 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
532 } | 532 } |
533 // This may have been deleted by read_callback_, so check first. | 533 // This may have been deleted by read_callback_, so check first. |
534 if (weak_ptr.get() && !write_callback.is_null()) | 534 if (weak_ptr.get() && !write_callback.is_null()) |
535 write_callback.Run(ERR_CONNECTION_CLOSED); | 535 write_callback.Run(ERR_CONNECTION_CLOSED); |
536 } | 536 } |
537 | 537 |
538 } // namespace net | 538 } // namespace net |
OLD | NEW |