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

Unified Diff: net/spdy/spdy_stream.cc

Issue 331663007: Implement PUSH_PROMISE handling in spdy_session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. Some strange andriod compile errors in skia Created 6 years, 6 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_stream.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index fe2f37a3e0cdf5e7818731027935089c010c0538..40ec654bba429fd91253cd27bf1bf61ac8896794 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -122,10 +122,9 @@ void SpdyStream::SetDelegate(Delegate* delegate) {
CHECK(delegate);
delegate_ = delegate;
- // TODO(baranovich): allow STATE_RESERVED_REMOTE when push promises will be
- // implemented.
CHECK(io_state_ == STATE_IDLE ||
- io_state_ == STATE_HALF_CLOSED_LOCAL_UNCLAIMED);
+ io_state_ == STATE_HALF_CLOSED_LOCAL_UNCLAIMED ||
+ io_state_ == STATE_RESERVED_REMOTE);
if (io_state_ == STATE_HALF_CLOSED_LOCAL_UNCLAIMED) {
DCHECK_EQ(type_, SPDY_PUSH_STREAM);
@@ -419,13 +418,12 @@ int SpdyStream::OnInitialResponseHeadersReceived(
// Push streams transition to a locally half-closed state upon headers.
// We must continue to buffer data while waiting for a call to
// SetDelegate() (which may not ever happen).
- // TODO(baranovich): For HTTP 2 push streams, delegate may be set before
- // receiving response headers when PUSH_PROMISE will be implemented.
- // TODO(baranovich): In HTTP 2 additional HEADERS frames are not allowed.
- // Set |response_headers_status_| to RESPONSE_HEADERS_ARE_COMPLETE.
CHECK_EQ(io_state_, STATE_RESERVED_REMOTE);
- DCHECK(!delegate_);
- io_state_ = STATE_HALF_CLOSED_LOCAL_UNCLAIMED;
+ if (!delegate_) {
+ io_state_ = STATE_HALF_CLOSED_LOCAL_UNCLAIMED;
+ } else {
+ io_state_ = STATE_HALF_CLOSED_LOCAL;
+ }
break;
}
@@ -455,7 +453,7 @@ int SpdyStream::OnAdditionalResponseHeadersReceived(
return MergeWithResponseHeaders(additional_response_headers);
}
-int SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) {
+void SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) {
CHECK(!request_headers_.get());
CHECK_EQ(io_state_, STATE_IDLE);
CHECK_EQ(type_, SPDY_PUSH_STREAM);
@@ -463,7 +461,6 @@ int SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) {
io_state_ = STATE_RESERVED_REMOTE;
request_headers_.reset(new SpdyHeaderBlock(headers));
- return OK;
}
void SpdyStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
@@ -733,6 +730,10 @@ bool SpdyStream::IsOpen() const {
return io_state_ == STATE_OPEN;
}
+bool SpdyStream::IsReservedRemote() const {
+ return io_state_ == STATE_RESERVED_REMOTE;
+}
+
NextProto SpdyStream::GetProtocol() const {
return session_->protocol();
}
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698