Chromium Code Reviews| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 SpdySendStatus SpdyProxyClientSocket::OnSendHeadersComplete() { | 461 SpdySendStatus SpdyProxyClientSocket::OnSendHeadersComplete() { |
| 462 DCHECK_EQ(next_state_, STATE_SEND_REQUEST_COMPLETE); | 462 DCHECK_EQ(next_state_, STATE_SEND_REQUEST_COMPLETE); |
| 463 | 463 |
| 464 OnIOComplete(OK); | 464 OnIOComplete(OK); |
| 465 | 465 |
| 466 // We return true here so that we send |spdy_stream_| into | 466 // We return true here so that we send |spdy_stream_| into |
| 467 // STATE_OPEN (ala WebSockets). | 467 // STATE_OPEN (ala WebSockets). |
| 468 return NO_MORE_DATA_TO_SEND; | 468 return NO_MORE_DATA_TO_SEND; |
| 469 } | 469 } |
| 470 | 470 |
| 471 int SpdyProxyClientSocket::OnSendBody() { | 471 void SpdyProxyClientSocket::OnSendBody() { |
| 472 // Because we use |spdy_stream_| via STATE_OPEN (ala WebSockets) | 472 // Because we use |spdy_stream_| via STATE_OPEN (ala WebSockets) |
| 473 // OnSendBody() should never be called. | 473 // OnSendBody() must never be called. |
| 474 NOTREACHED(); | 474 CHECK(false); |
|
Ryan Hamilton
2013/05/22 03:17:30
CHECK(false)? This is pretty hardcore. Are you s
akalin
2013/05/22 08:40:05
Yeah, I think it's for the best. If this were orig
| |
| 475 return ERR_UNEXPECTED; | |
| 476 } | 475 } |
| 477 | 476 |
| 478 SpdySendStatus SpdyProxyClientSocket::OnSendBodyComplete( | 477 SpdySendStatus SpdyProxyClientSocket::OnSendBodyComplete( |
| 479 size_t /*bytes_sent*/) { | 478 size_t /*bytes_sent*/) { |
| 480 // Because we use |spdy_stream_| via STATE_OPEN (ala WebSockets) | 479 // Because we use |spdy_stream_| via STATE_OPEN (ala WebSockets) |
| 481 // OnSendBodyComplete() should never be called. | 480 // OnSendBodyComplete() must never be called. |
| 482 NOTREACHED(); | 481 CHECK(false); |
|
Ryan Hamilton
2013/05/22 03:17:30
ditto
akalin
2013/05/22 08:40:05
ditto.
| |
| 483 return NO_MORE_DATA_TO_SEND; | 482 return NO_MORE_DATA_TO_SEND; |
| 484 } | 483 } |
| 485 | 484 |
| 486 int SpdyProxyClientSocket::OnResponseReceived( | 485 int SpdyProxyClientSocket::OnResponseReceived( |
| 487 const SpdyHeaderBlock& response, | 486 const SpdyHeaderBlock& response, |
| 488 base::Time response_time, | 487 base::Time response_time, |
| 489 int status) { | 488 int status) { |
| 490 // If we've already received the reply, existing headers are too late. | 489 // If we've already received the reply, existing headers are too late. |
| 491 // TODO(mbelshe): figure out a way to make HEADERS frames useful after the | 490 // TODO(mbelshe): figure out a way to make HEADERS frames useful after the |
| 492 // initial response. | 491 // initial response. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 } else if (!read_callback_.is_null()) { | 571 } else if (!read_callback_.is_null()) { |
| 573 // If we have a read_callback_, the we need to make sure we call it back. | 572 // If we have a read_callback_, the we need to make sure we call it back. |
| 574 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 573 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
| 575 } | 574 } |
| 576 // This may have been deleted by read_callback_, so check first. | 575 // This may have been deleted by read_callback_, so check first. |
| 577 if (weak_ptr && !write_callback.is_null()) | 576 if (weak_ptr && !write_callback.is_null()) |
| 578 write_callback.Run(ERR_CONNECTION_CLOSED); | 577 write_callback.Run(ERR_CONNECTION_CLOSED); |
| 579 } | 578 } |
| 580 | 579 |
| 581 } // namespace net | 580 } // namespace net |
| OLD | NEW |