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

Side by Side Diff: net/quic/quic_reliable_client_stream.cc

Issue 1471573002: Replacing EffectivePriority with Priority for QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107595145
Patch Set: Created 5 years, 1 month 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/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_session.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/quic/quic_reliable_client_stream.h" 5 #include "net/quic/quic_reliable_client_stream.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 void QuicReliableClientStream::OnCanWrite() { 65 void QuicReliableClientStream::OnCanWrite() {
66 ReliableQuicStream::OnCanWrite(); 66 ReliableQuicStream::OnCanWrite();
67 67
68 if (!HasBufferedData() && !callback_.is_null()) { 68 if (!HasBufferedData() && !callback_.is_null()) {
69 base::ResetAndReturn(&callback_).Run(OK); 69 base::ResetAndReturn(&callback_).Run(OK);
70 } 70 }
71 } 71 }
72 72
73 QuicPriority QuicReliableClientStream::EffectivePriority() const { 73 QuicPriority QuicReliableClientStream::Priority() const {
74 if (delegate_ && delegate_->HasSendHeadersComplete()) { 74 if (delegate_ && delegate_->HasSendHeadersComplete()) {
75 return QuicSpdyStream::EffectivePriority(); 75 return QuicSpdyStream::Priority();
76 } 76 }
77 return QuicWriteBlockedList::kHighestPriority; 77 return QuicWriteBlockedList::kHighestPriority;
78 } 78 }
79 79
80 int QuicReliableClientStream::WriteStreamData( 80 int QuicReliableClientStream::WriteStreamData(
81 base::StringPiece data, 81 base::StringPiece data,
82 bool fin, 82 bool fin,
83 const CompletionCallback& callback) { 83 const CompletionCallback& callback) {
84 // We should not have data buffered. 84 // We should not have data buffered.
85 DCHECK(!HasBufferedData()); 85 DCHECK(!HasBufferedData());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 iovec iov; 120 iovec iov;
121 iov.iov_base = buf->data(); 121 iov.iov_base = buf->data();
122 iov.iov_len = buf_len; 122 iov.iov_len = buf_len;
123 return Readv(&iov, 1); 123 return Readv(&iov, 1);
124 } 124 }
125 125
126 bool QuicReliableClientStream::CanWrite(const CompletionCallback& callback) { 126 bool QuicReliableClientStream::CanWrite(const CompletionCallback& callback) {
127 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA); 127 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA);
128 if (!can_write) { 128 if (!can_write) {
129 session()->MarkConnectionLevelWriteBlocked(id(), EffectivePriority()); 129 session()->MarkConnectionLevelWriteBlocked(id(), Priority());
130 DCHECK(callback_.is_null()); 130 DCHECK(callback_.is_null());
131 callback_ = callback; 131 callback_ = callback;
132 } 132 }
133 return can_write; 133 return can_write;
134 } 134 }
135 135
136 void QuicReliableClientStream::NotifyDelegateOfHeadersCompleteLater( 136 void QuicReliableClientStream::NotifyDelegateOfHeadersCompleteLater(
137 size_t frame_len) { 137 size_t frame_len) {
138 DCHECK(delegate_); 138 DCHECK(delegate_);
139 base::ThreadTaskRunnerHandle::Get()->PostTask( 139 base::ThreadTaskRunnerHandle::Get()->PostTask(
(...skipping 29 matching lines...) Expand all
169 base::Bind(&QuicReliableClientStream::NotifyDelegateOfDataAvailable, 169 base::Bind(&QuicReliableClientStream::NotifyDelegateOfDataAvailable,
170 weak_factory_.GetWeakPtr())); 170 weak_factory_.GetWeakPtr()));
171 } 171 }
172 172
173 void QuicReliableClientStream::NotifyDelegateOfDataAvailable() { 173 void QuicReliableClientStream::NotifyDelegateOfDataAvailable() {
174 if (delegate_) 174 if (delegate_)
175 delegate_->OnDataAvailable(); 175 delegate_->OnDataAvailable();
176 } 176 }
177 177
178 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698