Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/buffered_spdy_framer.h" | 5 #include "net/spdy/buffered_spdy_framer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 void BufferedSpdyFramer::OnPing(SpdyPingId unique_id, bool is_ack) { | 219 void BufferedSpdyFramer::OnPing(SpdyPingId unique_id, bool is_ack) { |
| 220 visitor_->OnPing(unique_id, is_ack); | 220 visitor_->OnPing(unique_id, is_ack); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void BufferedSpdyFramer::OnRstStream(SpdyStreamId stream_id, | 223 void BufferedSpdyFramer::OnRstStream(SpdyStreamId stream_id, |
| 224 SpdyRstStreamStatus status) { | 224 SpdyRstStreamStatus status) { |
| 225 visitor_->OnRstStream(stream_id, status); | 225 visitor_->OnRstStream(stream_id, status); |
| 226 } | 226 } |
| 227 void BufferedSpdyFramer::OnGoAway(SpdyStreamId last_accepted_stream_id, | 227 void BufferedSpdyFramer::OnGoAway(SpdyStreamId last_accepted_stream_id, |
| 228 SpdyGoAwayStatus status) { | 228 SpdyGoAwayStatus status) { |
| 229 visitor_->OnGoAway(last_accepted_stream_id, status); | 229 DCHECK(!go_away_fields_.get()); |
| 230 go_away_fields_.reset(new GoAwayFields()); | |
| 231 go_away_fields_->last_accepted_stream_id = last_accepted_stream_id; | |
| 232 go_away_fields_->status = status; | |
| 233 } | |
| 234 | |
| 235 bool BufferedSpdyFramer::OnGoAwayFrameData(const char* goaway_data, | |
| 236 size_t len) { | |
| 237 if (len > 0) { | |
| 238 go_away_fields_->debug_data.append(goaway_data, len); | |
| 239 return true; | |
| 240 } | |
| 241 visitor_->OnGoAway(go_away_fields_->last_accepted_stream_id, | |
| 242 go_away_fields_->status, go_away_fields_->debug_data); | |
| 243 go_away_fields_.reset(nullptr); | |
| 244 return true; | |
| 230 } | 245 } |
|
Ryan Hamilton
2015/10/05 21:17:55
This method wasn't overridden previously, right? W
Bence
2015/10/06 15:18:57
Exactly: it returns true.
https://code.google.com/
| |
| 231 | 246 |
| 232 void BufferedSpdyFramer::OnWindowUpdate(SpdyStreamId stream_id, | 247 void BufferedSpdyFramer::OnWindowUpdate(SpdyStreamId stream_id, |
| 233 int delta_window_size) { | 248 int delta_window_size) { |
| 234 visitor_->OnWindowUpdate(stream_id, delta_window_size); | 249 visitor_->OnWindowUpdate(stream_id, delta_window_size); |
| 235 } | 250 } |
| 236 | 251 |
| 237 void BufferedSpdyFramer::OnPushPromise(SpdyStreamId stream_id, | 252 void BufferedSpdyFramer::OnPushPromise(SpdyStreamId stream_id, |
| 238 SpdyStreamId promised_stream_id, | 253 SpdyStreamId promised_stream_id, |
| 239 bool end) { | 254 bool end) { |
| 240 DCHECK_LT(SPDY3, protocol_version()); | 255 DCHECK_LT(SPDY3, protocol_version()); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 | 426 |
| 412 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) { | 427 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) { |
| 413 memset(header_buffer_, 0, kHeaderBufferSize); | 428 memset(header_buffer_, 0, kHeaderBufferSize); |
| 414 header_buffer_used_ = 0; | 429 header_buffer_used_ = 0; |
| 415 header_buffer_valid_ = true; | 430 header_buffer_valid_ = true; |
| 416 header_stream_id_ = stream_id; | 431 header_stream_id_ = stream_id; |
| 417 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream); | 432 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream); |
| 418 } | 433 } |
| 419 | 434 |
| 420 } // namespace net | 435 } // namespace net |
| OLD | NEW |