OLD | NEW |
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 Loading... |
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 |
OLD | NEW |