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

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

Issue 112343002: Merge ReliableQuicStream::WriteData with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_crypto_stream.cc ('k') | net/quic/reliable_quic_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 (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 #include "net/spdy/write_blocked_list.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return kHighestPriority; 62 return kHighestPriority;
63 } 63 }
64 64
65 int QuicReliableClientStream::WriteStreamData( 65 int QuicReliableClientStream::WriteStreamData(
66 base::StringPiece data, 66 base::StringPiece data,
67 bool fin, 67 bool fin,
68 const CompletionCallback& callback) { 68 const CompletionCallback& callback) {
69 // We should not have data buffered. 69 // We should not have data buffered.
70 DCHECK(!HasBufferedData()); 70 DCHECK(!HasBufferedData());
71 // Writes the data, or buffers it. 71 // Writes the data, or buffers it.
72 WriteData(data, fin); 72 WriteOrBufferData(data, fin);
73 if (!HasBufferedData()) { 73 if (!HasBufferedData()) {
74 return OK; 74 return OK;
75 } 75 }
76 76
77 callback_ = callback; 77 callback_ = callback;
78 return ERR_IO_PENDING; 78 return ERR_IO_PENDING;
79 } 79 }
80 80
81 void QuicReliableClientStream::SetDelegate( 81 void QuicReliableClientStream::SetDelegate(
82 QuicReliableClientStream::Delegate* delegate) { 82 QuicReliableClientStream::Delegate* delegate) {
(...skipping 15 matching lines...) Expand all
98 id() == kCryptoStreamId ? IS_HANDSHAKE : NOT_HANDSHAKE); 98 id() == kCryptoStreamId ? IS_HANDSHAKE : NOT_HANDSHAKE);
99 if (!can_write) { 99 if (!can_write) {
100 session()->MarkWriteBlocked(id(), EffectivePriority()); 100 session()->MarkWriteBlocked(id(), EffectivePriority());
101 DCHECK(callback_.is_null()); 101 DCHECK(callback_.is_null());
102 callback_ = callback; 102 callback_ = callback;
103 } 103 }
104 return can_write; 104 return can_write;
105 } 105 }
106 106
107 } // namespace net 107 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_stream.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698