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

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

Issue 483093004: Rename QuicConnection::OnPacketSent to OnWriteError, to reflect it's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Refactor_async_write_behavior_73648585
Patch Set: Created 6 years, 4 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
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_per_connection_packet_writer.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_default_packet_writer.h" 5 #include "net/quic/quic_default_packet_writer.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return write_blocked_; 58 return write_blocked_;
59 } 59 }
60 60
61 void QuicDefaultPacketWriter::SetWritable() { 61 void QuicDefaultPacketWriter::SetWritable() {
62 write_blocked_ = false; 62 write_blocked_ = false;
63 } 63 }
64 64
65 void QuicDefaultPacketWriter::OnWriteComplete(int rv) { 65 void QuicDefaultPacketWriter::OnWriteComplete(int rv) {
66 DCHECK_NE(rv, ERR_IO_PENDING); 66 DCHECK_NE(rv, ERR_IO_PENDING);
67 write_blocked_ = false; 67 write_blocked_ = false;
68 WriteResult result(rv < 0 ? WRITE_STATUS_ERROR : WRITE_STATUS_OK, rv); 68 if (rv < 0) {
69 connection_->OnPacketSent(result); 69 connection_->OnWriteError(rv);
70 }
70 connection_->OnCanWrite(); 71 connection_->OnCanWrite();
71 } 72 }
72 73
73 } // namespace net 74 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_per_connection_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698