Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Side by Side Diff: net/spdy/spdy_proxy_client_socket.cc

Issue 15555003: [SPDY] Remove SpdyStream::Delegate::OnSendBody()'s return value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.h ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
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);
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
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.h ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698