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

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

Issue 127503002: Make QuicPacketWriter keep track of socket writability; expose the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 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 #ifndef NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ 5 #ifndef NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
6 #define NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ 6 #define NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/quic/quic_packet_writer.h" 10 #include "net/quic/quic_packet_writer.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 class QuicBlockedWriterInterface; 14 class QuicBlockedWriterInterface;
15 struct WriteResult; 15 struct WriteResult;
16 16
17 namespace tools { 17 namespace tools {
18 18
19 namespace test {
20 class QuicDispatcherPeer;
21 } // namespace test
22
19 // Default packet writer which wraps QuicSocketUtils WritePacket. 23 // Default packet writer which wraps QuicSocketUtils WritePacket.
20 class QuicDefaultPacketWriter : public QuicPacketWriter { 24 class QuicDefaultPacketWriter : public QuicPacketWriter {
21 public: 25 public:
22 explicit QuicDefaultPacketWriter(int fd); 26 explicit QuicDefaultPacketWriter(int fd);
23 virtual ~QuicDefaultPacketWriter(); 27 virtual ~QuicDefaultPacketWriter();
24 28
25 // QuicPacketWriter 29 // QuicPacketWriter
26 virtual WriteResult WritePacket( 30 virtual WriteResult WritePacket(
27 const char* buffer, size_t buf_len, 31 const char* buffer, size_t buf_len,
28 const net::IPAddressNumber& self_address, 32 const net::IPAddressNumber& self_address,
29 const net::IPEndPoint& peer_address, 33 const net::IPEndPoint& peer_address,
30 QuicBlockedWriterInterface* blocked_writer) OVERRIDE; 34 QuicBlockedWriterInterface* blocked_writer) OVERRIDE;
31 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE; 35 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
36 virtual bool IsWriteBlocked() const OVERRIDE;
37 virtual void SetWritable() OVERRIDE;
32 38
33 private: 39 private:
34 int fd_; 40 int fd_;
41 bool write_blocked_;
35 }; 42 };
36 43
37 } // namespace tools 44 } // namespace tools
38 } // namespace net 45 } // namespace net
39 46
40 #endif // NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ 47 #endif // NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698