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

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

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates from rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_websocket_stream.h ('k') | net/spdy/spdy_websocket_stream_spdy2_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_websocket_stream.h" 5 #include "net/spdy/spdy_websocket_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 stream_->Close(); 80 stream_->Close();
81 DCHECK(!stream_.get()); 81 DCHECK(!stream_.get());
82 } 82 }
83 } 83 }
84 84
85 void SpdyWebSocketStream::OnRequestHeadersSent() { 85 void SpdyWebSocketStream::OnRequestHeadersSent() {
86 DCHECK(delegate_); 86 DCHECK(delegate_);
87 delegate_->OnSentSpdyHeaders(); 87 delegate_->OnSentSpdyHeaders();
88 } 88 }
89 89
90 int SpdyWebSocketStream::OnResponseHeadersReceived( 90 SpdyResponseHeadersStatus SpdyWebSocketStream::OnResponseHeadersUpdated(
91 const SpdyHeaderBlock& response, 91 const SpdyHeaderBlock& response_headers) {
92 base::Time response_time, int status) {
93 DCHECK(delegate_); 92 DCHECK(delegate_);
94 return delegate_->OnReceivedSpdyResponseHeader(response, status); 93 delegate_->OnSpdyResponseHeadersUpdated(response_headers);
94 return RESPONSE_HEADERS_ARE_COMPLETE;
95 } 95 }
96 96
97 int SpdyWebSocketStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { 97 void SpdyWebSocketStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
98 DCHECK(delegate_); 98 DCHECK(delegate_);
99 delegate_->OnReceivedSpdyData(buffer.Pass()); 99 delegate_->OnReceivedSpdyData(buffer.Pass());
100 return OK;
101 } 100 }
102 101
103 void SpdyWebSocketStream::OnDataSent() { 102 void SpdyWebSocketStream::OnDataSent() {
104 DCHECK(delegate_); 103 DCHECK(delegate_);
105 delegate_->OnSentSpdyData(pending_send_data_length_); 104 delegate_->OnSentSpdyData(pending_send_data_length_);
106 pending_send_data_length_ = 0; 105 pending_send_data_length_ = 0;
107 } 106 }
108 107
109 void SpdyWebSocketStream::OnClose(int status) { 108 void SpdyWebSocketStream::OnClose(int status) {
110 stream_.reset(); 109 stream_.reset();
(...skipping 11 matching lines...) Expand all
122 if (result == OK) { 121 if (result == OK) {
123 stream_ = stream_request_.ReleaseStream(); 122 stream_ = stream_request_.ReleaseStream();
124 DCHECK(stream_.get()); 123 DCHECK(stream_.get());
125 stream_->SetDelegate(this); 124 stream_->SetDelegate(this);
126 } 125 }
127 DCHECK(delegate_); 126 DCHECK(delegate_);
128 delegate_->OnCreatedSpdyStream(result); 127 delegate_->OnCreatedSpdyStream(result);
129 } 128 }
130 129
131 } // namespace net 130 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_websocket_stream.h ('k') | net/spdy/spdy_websocket_stream_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698