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 #ifndef NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ | 5 #ifndef NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ |
6 #define NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ | 6 #define NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const net::IPEndPoint& peer_address) OVERRIDE; | 32 const net::IPEndPoint& peer_address) OVERRIDE; |
33 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE; | 33 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE; |
34 virtual bool IsWriteBlocked() const OVERRIDE; | 34 virtual bool IsWriteBlocked() const OVERRIDE; |
35 virtual void SetWritable() OVERRIDE; | 35 virtual void SetWritable() OVERRIDE; |
36 | 36 |
37 void OnWriteComplete(int rv); | 37 void OnWriteComplete(int rv); |
38 void SetConnection(QuicConnection* connection) { | 38 void SetConnection(QuicConnection* connection) { |
39 connection_ = connection; | 39 connection_ = connection; |
40 } | 40 } |
41 | 41 |
| 42 protected: |
| 43 void set_write_blocked(bool is_blocked) { |
| 44 write_blocked_ = is_blocked; |
| 45 } |
| 46 |
42 private: | 47 private: |
43 base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_; | 48 base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_; |
44 DatagramClientSocket* socket_; | 49 DatagramClientSocket* socket_; |
45 QuicConnection* connection_; | 50 QuicConnection* connection_; |
46 bool write_blocked_; | 51 bool write_blocked_; |
47 | 52 |
48 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter); | 53 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter); |
49 }; | 54 }; |
50 | 55 |
51 } // namespace net | 56 } // namespace net |
52 | 57 |
53 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ | 58 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ |
OLD | NEW |