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/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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 base::WeakPtr<SpdyStream> weak_this = GetWeakPtr(); | 582 base::WeakPtr<SpdyStream> weak_this = GetWeakPtr(); |
583 // May close the stream. | 583 // May close the stream. |
584 DecreaseRecvWindowSize(static_cast<int32_t>(len)); | 584 DecreaseRecvWindowSize(static_cast<int32_t>(len)); |
585 if (!weak_this) | 585 if (!weak_this) |
586 return; | 586 return; |
587 IncreaseRecvWindowSize(static_cast<int32_t>(len)); | 587 IncreaseRecvWindowSize(static_cast<int32_t>(len)); |
588 } | 588 } |
589 | 589 |
590 void SpdyStream::OnFrameWriteComplete(SpdyFrameType frame_type, | 590 void SpdyStream::OnFrameWriteComplete(SpdyFrameType frame_type, |
591 size_t frame_size) { | 591 size_t frame_size) { |
| 592 // PRIORITY writes are allowed at any time and do not trigger a state update. |
| 593 if (frame_type == PRIORITY) { |
| 594 return; |
| 595 } |
| 596 |
592 DCHECK_NE(type_, SPDY_PUSH_STREAM); | 597 DCHECK_NE(type_, SPDY_PUSH_STREAM); |
593 CHECK(frame_type == HEADERS || frame_type == DATA) << frame_type; | 598 CHECK(frame_type == HEADERS || frame_type == DATA) << frame_type; |
594 | 599 |
595 int result = | 600 int result = |
596 (frame_type == HEADERS) ? OnHeadersSent() : OnDataSent(frame_size); | 601 (frame_type == HEADERS) ? OnHeadersSent() : OnDataSent(frame_size); |
597 if (result == ERR_IO_PENDING) { | 602 if (result == ERR_IO_PENDING) { |
598 // The write operation hasn't completed yet. | 603 // The write operation hasn't completed yet. |
599 return; | 604 return; |
600 } | 605 } |
601 | 606 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 940 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
936 state); | 941 state); |
937 break; | 942 break; |
938 } | 943 } |
939 return description; | 944 return description; |
940 } | 945 } |
941 | 946 |
942 #undef STATE_CASE | 947 #undef STATE_CASE |
943 | 948 |
944 } // namespace net | 949 } // namespace net |
OLD | NEW |