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

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

Issue 23597045: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged QuicPriority to RequestPriority changes Created 7 years, 3 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/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_reliable_client_stream_test.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 "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/quic/quic_session.h" 9 #include "net/quic/quic_session.h"
10 #include "net/spdy/write_blocked_list.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id, 14 QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id,
14 QuicSession* session, 15 QuicSession* session,
15 const BoundNetLog& net_log) 16 const BoundNetLog& net_log)
16 : ReliableQuicStream(id, session), 17 : ReliableQuicStream(id, session),
17 net_log_(net_log), 18 net_log_(net_log),
18 delegate_(NULL) { 19 delegate_(NULL) {
19 } 20 }
(...skipping 27 matching lines...) Expand all
47 } 48 }
48 49
49 void QuicReliableClientStream::OnCanWrite() { 50 void QuicReliableClientStream::OnCanWrite() {
50 ReliableQuicStream::OnCanWrite(); 51 ReliableQuicStream::OnCanWrite();
51 52
52 if (!HasBufferedData() && !callback_.is_null()) { 53 if (!HasBufferedData() && !callback_.is_null()) {
53 base::ResetAndReturn(&callback_).Run(OK); 54 base::ResetAndReturn(&callback_).Run(OK);
54 } 55 }
55 } 56 }
56 57
58 QuicPriority QuicReliableClientStream::EffectivePriority() const {
59 if (delegate_->HasSendHeadersComplete()) {
60 return ReliableQuicStream::EffectivePriority();
61 }
62 return kHighestPriority;
63 }
64
57 int QuicReliableClientStream::WriteStreamData( 65 int QuicReliableClientStream::WriteStreamData(
58 base::StringPiece data, 66 base::StringPiece data,
59 bool fin, 67 bool fin,
60 const CompletionCallback& callback) { 68 const CompletionCallback& callback) {
61 // We should not have data buffered. 69 // We should not have data buffered.
62 DCHECK(!HasBufferedData()); 70 DCHECK(!HasBufferedData());
63 // Writes the data, or buffers it. 71 // Writes the data, or buffers it.
64 WriteData(data, fin); 72 WriteData(data, fin);
65 if (!HasBufferedData()) { 73 if (!HasBufferedData()) {
66 return OK; 74 return OK;
(...skipping 11 matching lines...) Expand all
78 86
79 void QuicReliableClientStream::OnError(int error) { 87 void QuicReliableClientStream::OnError(int error) {
80 if (delegate_) { 88 if (delegate_) {
81 QuicReliableClientStream::Delegate* delegate = delegate_; 89 QuicReliableClientStream::Delegate* delegate = delegate_;
82 delegate_ = NULL; 90 delegate_ = NULL;
83 delegate->OnError(error); 91 delegate->OnError(error);
84 } 92 }
85 } 93 }
86 94
87 } // namespace net 95 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698