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

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

Issue 371213002: Fixes for re-enabling more MSVC level 4 warnings: net/quic/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 6 years, 5 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
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/quic/quic_write_blocked_list.h" 10 #include "net/quic/quic_write_blocked_list.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id, 14 QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id,
15 QuicSession* session, 15 QuicSession* session,
16 const BoundNetLog& net_log) 16 const BoundNetLog& net_log)
17 : QuicDataStream(id, session), 17 : QuicDataStream(id, session),
18 net_log_(net_log), 18 net_log_(net_log),
19 delegate_(NULL) { 19 delegate_(NULL) {
20 } 20 }
21 21
22 QuicReliableClientStream::~QuicReliableClientStream() { 22 QuicReliableClientStream::~QuicReliableClientStream() {
23 if (delegate_) 23 if (delegate_)
24 delegate_->OnClose(connection_error()); 24 delegate_->OnClose(connection_error());
25 } 25 }
26 26
27 uint32 QuicReliableClientStream::ProcessData(const char* data, 27 uint32 QuicReliableClientStream::ProcessData(const char* data,
28 uint32 data_len) { 28 uint32 data_len) {
29 // TODO(rch): buffer data if we don't have a delegate. 29 // TODO(rch): buffer data if we don't have a delegate.
30 // !!! Callers seem to assume this will return 0 (or some value less than
31 // |data_len|) on error! Returning a very large positive value may be wrong?
30 if (!delegate_) 32 if (!delegate_)
31 return ERR_ABORTED; 33 return static_cast<uint32>(ERR_ABORTED);
Ryan Hamilton 2014/07/08 03:37:08 Yes, this seems problematic. :> It should probably
Peter Kasting 2014/07/08 06:26:46 So do you want me to just remove the comment and l
Ryan Hamilton 2014/07/08 18:00:57 Either way. The comment is a good reminder in any
Peter Kasting 2014/07/08 18:16:46 I think what I'll do, then, is change to something
Ryan Hamilton 2014/07/08 18:24:01 Sure, that's fine. Or you can simply do: if (!d
Peter Kasting 2014/07/08 18:44:45 Ah! I'd rather let you make the functional change
32 34
33 int rv = delegate_->OnDataReceived(data, data_len); 35 int rv = delegate_->OnDataReceived(data, data_len);
34 if (rv != OK) { 36 if (rv != OK) {
35 DLOG(ERROR) << "Delegate refused data, rv: " << rv; 37 DLOG(ERROR) << "Delegate refused data, rv: " << rv;
36 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 38 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
37 return 0; 39 return 0;
38 } 40 }
39 return data_len; 41 return data_len;
40 } 42 }
41 43
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA); 98 bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA);
97 if (!can_write) { 99 if (!can_write) {
98 session()->MarkWriteBlocked(id(), EffectivePriority()); 100 session()->MarkWriteBlocked(id(), EffectivePriority());
99 DCHECK(callback_.is_null()); 101 DCHECK(callback_.is_null());
100 callback_ = callback; 102 callback_ = callback;
101 } 103 }
102 return can_write; 104 return can_write;
103 } 105 }
104 106
105 } // namespace net 107 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698