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

Side by Side Diff: net/quic/p2p/quic_p2p_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 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/p2p/quic_p2p_stream.h ('k') | net/quic/quic_crypto_stream.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/p2p/quic_p2p_stream.h" 5 #include "net/quic/p2p/quic_p2p_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/quic/quic_write_blocked_list.h" 10 #include "net/quic/quic_write_blocked_list.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 void QuicP2PStream::OnCanWrite() { 44 void QuicP2PStream::OnCanWrite() {
45 ReliableQuicStream::OnCanWrite(); 45 ReliableQuicStream::OnCanWrite();
46 46
47 if (!HasBufferedData() && !write_callback_.is_null()) { 47 if (!HasBufferedData() && !write_callback_.is_null()) {
48 base::ResetAndReturn(&write_callback_).Run(last_write_size_); 48 base::ResetAndReturn(&write_callback_).Run(last_write_size_);
49 } 49 }
50 } 50 }
51 51
52 QuicPriority QuicP2PStream::EffectivePriority() const { 52 QuicPriority QuicP2PStream::Priority() const {
53 return priority_; 53 return priority_;
54 } 54 }
55 55
56 void QuicP2PStream::WriteHeader(base::StringPiece data) { 56 void QuicP2PStream::WriteHeader(base::StringPiece data) {
57 WriteOrBufferData(data, false, nullptr); 57 WriteOrBufferData(data, false, nullptr);
58 } 58 }
59 59
60 int QuicP2PStream::Write(base::StringPiece data, 60 int QuicP2PStream::Write(base::StringPiece data,
61 const CompletionCallback& callback) { 61 const CompletionCallback& callback) {
62 DCHECK(write_callback_.is_null()); 62 DCHECK(write_callback_.is_null());
63 63
64 // Writes the data, or buffers it. 64 // Writes the data, or buffers it.
65 WriteOrBufferData(data, false, nullptr); 65 WriteOrBufferData(data, false, nullptr);
66 if (!HasBufferedData()) { 66 if (!HasBufferedData()) {
67 return data.size(); 67 return data.size();
68 } 68 }
69 69
70 write_callback_ = callback; 70 write_callback_ = callback;
71 last_write_size_ = data.size(); 71 last_write_size_ = data.size();
72 return ERR_IO_PENDING; 72 return ERR_IO_PENDING;
73 } 73 }
74 74
75 void QuicP2PStream::SetDelegate(QuicP2PStream::Delegate* delegate) { 75 void QuicP2PStream::SetDelegate(QuicP2PStream::Delegate* delegate) {
76 DCHECK(!(delegate_ && delegate)); 76 DCHECK(!(delegate_ && delegate));
77 delegate_ = delegate; 77 delegate_ = delegate;
78 } 78 }
79 79
80 } // namespace net 80 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/p2p/quic_p2p_stream.h ('k') | net/quic/quic_crypto_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698