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

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

Issue 1320303009: relnote: Allow individual QUIC writers to limit the maximum packet size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0909_1
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_ 5 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_
6 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_ 6 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 29 matching lines...) Expand all
40 const IPAddressNumber& self_address, 40 const IPAddressNumber& self_address,
41 const IPEndPoint& peer_address, 41 const IPEndPoint& peer_address,
42 WriteCallback callback); 42 WriteCallback callback);
43 43
44 void OnWriteComplete(int rv); 44 void OnWriteComplete(int rv);
45 45
46 // QuicPacketWriter implementation: 46 // QuicPacketWriter implementation:
47 bool IsWriteBlockedDataBuffered() const override; 47 bool IsWriteBlockedDataBuffered() const override;
48 bool IsWriteBlocked() const override; 48 bool IsWriteBlocked() const override;
49 void SetWritable() override; 49 void SetWritable() override;
50 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
50 51
51 protected: 52 protected:
52 // Do not call WritePacket on its own -- use WritePacketWithCallback 53 // Do not call WritePacket on its own -- use WritePacketWithCallback
53 WriteResult WritePacket(const char* buffer, 54 WriteResult WritePacket(const char* buffer,
54 size_t buf_len, 55 size_t buf_len,
55 const IPAddressNumber& self_address, 56 const IPAddressNumber& self_address,
56 const IPEndPoint& peer_address) override; 57 const IPEndPoint& peer_address) override;
57 58
58 private: 59 private:
59 UDPServerSocket* socket_; 60 UDPServerSocket* socket_;
60 61
61 // To be notified after every successful asynchronous write. 62 // To be notified after every successful asynchronous write.
62 QuicBlockedWriterInterface* blocked_writer_; 63 QuicBlockedWriterInterface* blocked_writer_;
63 64
64 // To call once the write completes. 65 // To call once the write completes.
65 WriteCallback callback_; 66 WriteCallback callback_;
66 67
67 // Whether a write is currently in flight. 68 // Whether a write is currently in flight.
68 bool write_blocked_; 69 bool write_blocked_;
69 70
70 base::WeakPtrFactory<QuicSimpleServerPacketWriter> weak_factory_; 71 base::WeakPtrFactory<QuicSimpleServerPacketWriter> weak_factory_;
71 72
72 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerPacketWriter); 73 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerPacketWriter);
73 }; 74 };
74 75
75 } // namespace tools 76 } // namespace tools
76 } // namespace net 77 } // namespace net
77 78
78 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_ 79 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_per_connection_packet_writer.cc ('k') | net/tools/quic/quic_simple_server_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698