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

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

Issue 1852423004: Implement SpdySerializedFrame move semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_stream_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_stream.h" 5 #include "net/spdy/spdy_stream.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (eof) { 196 if (eof) {
197 DCHECK(pending_recv_data_.empty()); 197 DCHECK(pending_recv_data_.empty());
198 session_->CloseActiveStream(stream_id_, OK); 198 session_->CloseActiveStream(stream_id_, OK);
199 DCHECK(!weak_this); 199 DCHECK(!weak_this);
200 // |pending_recv_data_| is invalid at this point. 200 // |pending_recv_data_| is invalid at this point.
201 break; 201 break;
202 } 202 }
203 } 203 }
204 } 204 }
205 205
206 scoped_ptr<SpdyFrame> SpdyStream::ProduceSynStreamFrame() { 206 scoped_ptr<SpdySerializedFrame> SpdyStream::ProduceSynStreamFrame() {
207 CHECK_EQ(io_state_, STATE_IDLE); 207 CHECK_EQ(io_state_, STATE_IDLE);
208 CHECK(request_headers_); 208 CHECK(request_headers_);
209 CHECK_GT(stream_id_, 0u); 209 CHECK_GT(stream_id_, 0u);
210 210
211 SpdyControlFlags flags = 211 SpdyControlFlags flags =
212 (pending_send_status_ == NO_MORE_DATA_TO_SEND) ? 212 (pending_send_status_ == NO_MORE_DATA_TO_SEND) ?
213 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE; 213 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE;
214 scoped_ptr<SpdyFrame> frame(session_->CreateSynStream( 214 scoped_ptr<SpdySerializedFrame> frame(session_->CreateSynStream(
215 stream_id_, priority_, flags, *request_headers_)); 215 stream_id_, priority_, flags, *request_headers_));
216 send_time_ = base::TimeTicks::Now(); 216 send_time_ = base::TimeTicks::Now();
217 return frame; 217 return frame;
218 } 218 }
219 219
220 void SpdyStream::DetachDelegate() { 220 void SpdyStream::DetachDelegate() {
221 DCHECK(!IsClosed()); 221 DCHECK(!IsClosed());
222 delegate_ = NULL; 222 delegate_ = NULL;
223 Cancel(); 223 Cancel();
224 } 224 }
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 944 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
945 state); 945 state);
946 break; 946 break;
947 } 947 }
948 return description; 948 return description;
949 } 949 }
950 950
951 #undef STATE_CASE 951 #undef STATE_CASE
952 952
953 } // namespace net 953 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698