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

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

Issue 146033003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 6 years, 10 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
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.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 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/tools/quic/quic_default_packet_writer.h" 5 #include "net/tools/quic/quic_default_packet_writer.h"
6 6
7 #include "net/tools/quic/quic_socket_utils.h" 7 #include "net/tools/quic/quic_socket_utils.h"
8 8
9 namespace net { 9 namespace net {
10 namespace tools { 10 namespace tools {
11 11
12 QuicDefaultPacketWriter::QuicDefaultPacketWriter(int fd) 12 QuicDefaultPacketWriter::QuicDefaultPacketWriter(int fd)
13 : fd_(fd), 13 : fd_(fd),
14 write_blocked_(false) {} 14 write_blocked_(false) {}
15 15
16 QuicDefaultPacketWriter::~QuicDefaultPacketWriter() {} 16 QuicDefaultPacketWriter::~QuicDefaultPacketWriter() {}
17 17
18 WriteResult QuicDefaultPacketWriter::WritePacket( 18 WriteResult QuicDefaultPacketWriter::WritePacket(
19 const char* buffer, size_t buf_len, 19 const char* buffer, size_t buf_len,
20 const net::IPAddressNumber& self_address, 20 const net::IPAddressNumber& self_address,
21 const net::IPEndPoint& peer_address, 21 const net::IPEndPoint& peer_address) {
22 QuicBlockedWriterInterface* blocked_writer) {
23 DCHECK(!IsWriteBlocked()); 22 DCHECK(!IsWriteBlocked());
24 WriteResult result = QuicSocketUtils::WritePacket( 23 WriteResult result = QuicSocketUtils::WritePacket(
25 fd_, buffer, buf_len, self_address, peer_address); 24 fd_, buffer, buf_len, self_address, peer_address);
26 if (result.status == WRITE_STATUS_BLOCKED) { 25 if (result.status == WRITE_STATUS_BLOCKED) {
27 write_blocked_ = true; 26 write_blocked_ = true;
28 } 27 }
29 return result; 28 return result;
30 } 29 }
31 30
32 bool QuicDefaultPacketWriter::IsWriteBlockedDataBuffered() const { 31 bool QuicDefaultPacketWriter::IsWriteBlockedDataBuffered() const {
33 return false; 32 return false;
34 } 33 }
35 34
36 bool QuicDefaultPacketWriter::IsWriteBlocked() const { 35 bool QuicDefaultPacketWriter::IsWriteBlocked() const {
37 return write_blocked_; 36 return write_blocked_;
38 } 37 }
39 38
40 void QuicDefaultPacketWriter::SetWritable() { 39 void QuicDefaultPacketWriter::SetWritable() {
41 write_blocked_ = false; 40 write_blocked_ = false;
42 } 41 }
43 42
44 } // namespace tools 43 } // namespace tools
45 } // namespace net 44 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698