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

Unified Diff: net/spdy/spdy_stream.h

Issue 15936003: [SPDY] Refactor SpdyStream::Delegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_session_spdy3_unittest.cc ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.h
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h
index 91f24006c096661ae3676be1e287ee082cf477b5..01f04f164f5af603be5855700eff2c1a70875731 100644
--- a/net/spdy/spdy_stream.h
+++ b/net/spdy/spdy_stream.h
@@ -71,23 +71,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Called when the request headers have been sent. Never called
// for push streams.
- virtual void OnSendRequestHeadersComplete() = 0;
-
- // Called when the stream is ready to send body data. The
- // delegate must call SendStreamData() on the stream, either
- // immediately or asynchronously (e.g., if the data to be send has
- // to be read asynchronously).
- //
- // Called only for request/response streams when
- // SendRequestHeaders() is called with MORE_DATA_TO_SEND.
- //
- // TODO(akalin): Unify this with OnSendRequestHeadersComplete().
- virtual void OnSendBody() = 0;
-
- // Called when body data has been sent.
- //
- // TODO(akalin): Unify this with OnDataSent().
- virtual void OnSendBodyComplete() = 0;
+ virtual void OnRequestHeadersSent() = 0;
// Called when the SYN_STREAM, SYN_REPLY, or HEADERS frames are received.
// Normal streams will receive a SYN_REPLY and optional HEADERS frames.
@@ -95,9 +79,9 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Because a stream may have a SYN_* frame and multiple HEADERS frames,
// this callback may be called multiple times.
// |status| indicates network error. Returns network error code.
- virtual int OnResponseReceived(const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) = 0;
+ virtual int OnResponseHeadersReceived(const SpdyHeaderBlock& response,
+ base::Time response_time,
+ int status) = 0;
// Called when data is received. |buffer| may be NULL, which
// signals EOF. Must return OK if the data was received
@@ -130,8 +114,8 @@ class NET_EXPORT_PRIVATE SpdyStream {
~SpdyStream();
- // Set new |delegate|. |delegate| must not be NULL.
- // If it already received SYN_REPLY or data, OnResponseReceived() or
+ // Set new |delegate|. |delegate| must not be NULL. If it already
+ // received SYN_REPLY or data, OnResponseHeadersReceived() or
// OnDataReceived() will be called.
void SetDelegate(Delegate* delegate);
Delegate* GetDelegate() { return delegate_; }
@@ -247,15 +231,16 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Called by the SpdySession when a response (e.g. a SYN_STREAM or
// SYN_REPLY) has been received for this stream. This is the entry
// point for a push stream. Returns a status code.
- int OnResponseReceived(const SpdyHeaderBlock& response);
+ int OnResponseHeadersReceived(const SpdyHeaderBlock& response);
// Called by the SpdySession when late-bound headers are received for a
// stream. Returns a status code.
int OnHeaders(const SpdyHeaderBlock& headers);
- // Called by the SpdySession when response data has been received for this
- // stream. This callback may be called multiple times as data arrives
- // from the network, and will never be called prior to OnResponseReceived.
+ // Called by the SpdySession when response data has been received
+ // for this stream. This callback may be called multiple times as
+ // data arrives from the network, and will never be called prior to
+ // OnResponseHeadersReceived.
//
// |buffer| contains the data received, or NULL if the stream is
// being closed. The stream must copy any data from this
@@ -303,8 +288,8 @@ class NET_EXPORT_PRIVATE SpdyStream {
// streams, which must not send anything.
// Sends the request headers. The delegate is called back via
- // OnSendRequestHeadersComplete() when the request headers have
- // completed sending. |send_status| must be MORE_DATA_TO_SEND for
+ // OnRequestHeadersSent() when the request headers have completed
+ // sending. |send_status| must be MORE_DATA_TO_SEND for
// bidirectional streams; for request/response streams, it must be
// MORE_DATA_TO_SEND if the request has data to upload, or
// NO_MORE_DATA_TO_SEND if not.
@@ -312,13 +297,11 @@ class NET_EXPORT_PRIVATE SpdyStream {
SpdySendStatus send_status);
// Sends a DATA frame. The delegate will be notified via
- // OnSendBodyComplete() (if the response hasn't been received yet)
- // or OnDataSent() (if the response has been received) when the send
- // is complete. |send_status| must be MORE_DATA_TO_SEND for
- // bidirectional streams; for request/response streams, it must be
- // MORE_DATA_TO_SEND if there is more data to upload, or
- // NO_MORE_DATA_TO_SEND if not.
- void SendStreamData(IOBuffer* data, int length, SpdySendStatus send_status);
+ // OnDataSent() when the send is complete. |send_status| must be
+ // MORE_DATA_TO_SEND for bidirectional streams; for request/response
+ // streams, it must be MORE_DATA_TO_SEND if there is more data to
+ // upload, or NO_MORE_DATA_TO_SEND if not.
+ void SendData(IOBuffer* data, int length, SpdySendStatus send_status);
// Fills SSL info in |ssl_info| and returns true when SSL is in use.
bool GetSSLInfo(SSLInfo* ssl_info,
« no previous file with comments | « net/spdy/spdy_session_spdy3_unittest.cc ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698