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

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

Issue 22159003: DO NOT COMMIT: More hacks to get HTTP/2 working Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for draft 06 Created 7 years, 2 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_stream.h ('k') | no next file » | 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 NOTREACHED(); 511 NOTREACHED();
512 return; 512 return;
513 } 513 }
514 if (IsClosed()) 514 if (IsClosed())
515 return; 515 return;
516 just_completed_frame_type_ = frame_type; 516 just_completed_frame_type_ = frame_type;
517 just_completed_frame_size_ = frame_size; 517 just_completed_frame_size_ = frame_size;
518 DoLoop(OK); 518 DoLoop(OK);
519 } 519 }
520 520
521 int SpdyStream::GetProtocolVersion() const { 521 SpdyMajorVersion SpdyStream::GetProtocolVersion() const {
522 return session_->GetProtocolVersion(); 522 return session_->GetProtocolVersion();
523 } 523 }
524 524
525 void SpdyStream::LogStreamError(int status, const std::string& description) { 525 void SpdyStream::LogStreamError(int status, const std::string& description) {
526 net_log_.AddEvent(NetLog::TYPE_SPDY_STREAM_ERROR, 526 net_log_.AddEvent(NetLog::TYPE_SPDY_STREAM_ERROR,
527 base::Bind(&NetLogSpdyStreamErrorCallback, 527 base::Bind(&NetLogSpdyStreamErrorCallback,
528 stream_id_, status, &description)); 528 stream_id_, status, &description));
529 } 529 }
530 530
531 void SpdyStream::OnClose(int status) { 531 void SpdyStream::OnClose(int status) {
532 CHECK(!in_do_loop_); 532 CHECK(!in_do_loop_);
533 io_state_ = STATE_CLOSED; 533 io_state_ = STATE_CLOSED;
534 response_status_ = status; 534 response_status_ = status;
535 Delegate* delegate = delegate_; 535 Delegate* delegate = delegate_;
536 delegate_ = NULL; 536 delegate_ = NULL;
537 if (delegate) 537 if (delegate)
538 delegate->OnClose(status); 538 delegate->OnClose(status);
539 // Unset |stream_id_| last so that the delegate can look it up. 539 // Unset |stream_id_| last so that the delegate can look it up.
540 stream_id_ = 0; 540 stream_id_ = 0;
541 } 541 }
542 542
543 void SpdyStream::Cancel() { 543 void SpdyStream::Cancel() {
544 CHECK(!in_do_loop_); 544 CHECK(!in_do_loop_);
545 // We may be called again from a delegate's OnClose(). 545 // We may be called again from a delegate's OnClose().
546 if (io_state_ == STATE_CLOSED) 546 if (io_state_ == STATE_CLOSED)
547 return; 547 return;
548 548
549 if (stream_id_ != 0) { 549 if (stream_id_ != 0) {
550 session_->ResetStream(stream_id_, RST_STREAM_CANCEL, std::string()); 550 session_->ResetStream(stream_id_, RST_STREAM_CANCEL, "Cancelling stream");
551 } else { 551 } else {
552 session_->CloseCreatedStream(GetWeakPtr(), RST_STREAM_CANCEL); 552 session_->CloseCreatedStream(GetWeakPtr(), RST_STREAM_CANCEL);
553 } 553 }
554 // |this| is invalid at this point. 554 // |this| is invalid at this point.
555 } 555 }
556 556
557 void SpdyStream::Close() { 557 void SpdyStream::Close() {
558 CHECK(!in_do_loop_); 558 CHECK(!in_do_loop_);
559 // We may be called again from a delegate's OnClose(). 559 // We may be called again from a delegate's OnClose().
560 if (io_state_ == STATE_CLOSED) 560 if (io_state_ == STATE_CLOSED)
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 } 1026 }
1027 } else if (weak_this) { 1027 } else if (weak_this) {
1028 response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; 1028 response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE;
1029 } 1029 }
1030 } 1030 }
1031 1031
1032 return OK; 1032 return OK;
1033 } 1033 }
1034 1034
1035 } // namespace net 1035 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698