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

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

Issue 2102253003: Make SpdyHeaderBlock non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS fix. Created 4 years, 5 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_session_unittest.cc ('k') | net/spdy/spdy_stream_test_util.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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 std::unique_ptr<SpdySerializedFrame> SpdyStream::ProduceSynStreamFrame() { 202 std::unique_ptr<SpdySerializedFrame> SpdyStream::ProduceSynStreamFrame() {
203 CHECK_EQ(io_state_, STATE_IDLE); 203 CHECK_EQ(io_state_, STATE_IDLE);
204 CHECK(request_headers_); 204 CHECK(request_headers_);
205 CHECK_GT(stream_id_, 0u); 205 CHECK_GT(stream_id_, 0u);
206 206
207 SpdyControlFlags flags = 207 SpdyControlFlags flags =
208 (pending_send_status_ == NO_MORE_DATA_TO_SEND) ? 208 (pending_send_status_ == NO_MORE_DATA_TO_SEND) ?
209 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE; 209 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE;
210 std::unique_ptr<SpdySerializedFrame> frame(session_->CreateSynStream( 210 std::unique_ptr<SpdySerializedFrame> frame(session_->CreateSynStream(
211 stream_id_, priority_, flags, *request_headers_)); 211 stream_id_, priority_, flags, request_headers_->Clone()));
212 send_time_ = base::TimeTicks::Now(); 212 send_time_ = base::TimeTicks::Now();
213 return frame; 213 return frame;
214 } 214 }
215 215
216 void SpdyStream::DetachDelegate() { 216 void SpdyStream::DetachDelegate() {
217 DCHECK(!IsClosed()); 217 DCHECK(!IsClosed());
218 delegate_ = NULL; 218 delegate_ = NULL;
219 Cancel(); 219 Cancel();
220 } 220 }
221 221
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 return MergeWithResponseHeaders(additional_response_headers); 463 return MergeWithResponseHeaders(additional_response_headers);
464 } 464 }
465 465
466 void SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) { 466 void SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) {
467 CHECK(!request_headers_.get()); 467 CHECK(!request_headers_.get());
468 CHECK_EQ(io_state_, STATE_IDLE); 468 CHECK_EQ(io_state_, STATE_IDLE);
469 CHECK_EQ(type_, SPDY_PUSH_STREAM); 469 CHECK_EQ(type_, SPDY_PUSH_STREAM);
470 DCHECK(!delegate_); 470 DCHECK(!delegate_);
471 471
472 io_state_ = STATE_RESERVED_REMOTE; 472 io_state_ = STATE_RESERVED_REMOTE;
473 request_headers_.reset(new SpdyHeaderBlock(headers)); 473 request_headers_.reset(new SpdyHeaderBlock(headers.Clone()));
474 } 474 }
475 475
476 void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { 476 void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {
477 DCHECK(session_->IsStreamActive(stream_id_)); 477 DCHECK(session_->IsStreamActive(stream_id_));
478 478
479 // Track our bandwidth. 479 // Track our bandwidth.
480 recv_bytes_ += buffer ? buffer->GetRemainingSize() : 0; 480 recv_bytes_ += buffer ? buffer->GetRemainingSize() : 0;
481 recv_last_byte_time_ = base::TimeTicks::Now(); 481 recv_last_byte_time_ = base::TimeTicks::Now();
482 482
483 // If we're still buffering data for a push stream, we will do the 483 // If we're still buffering data for a push stream, we will do the
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 945 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
946 state); 946 state);
947 break; 947 break;
948 } 948 }
949 return description; 949 return description;
950 } 950 }
951 951
952 #undef STATE_CASE 952 #undef STATE_CASE
953 953
954 } // namespace net 954 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_stream_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698