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

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

Issue 1670863002: QUIC - minor cleanup changes to keep code in sync with the internal source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0204
Patch Set: Created 4 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
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_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_ 5 #ifndef NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
6 #define NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_ 6 #define NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "net/quic/quic_connection.h" 11 #include "net/quic/quic_connection.h"
12 #include "net/quic/quic_packet_writer.h" 12 #include "net/quic/quic_packet_writer.h"
13 13
14 namespace net { 14 namespace net {
15 15
16
17 // A connection-specific packet writer that wraps a shared writer. 16 // A connection-specific packet writer that wraps a shared writer.
18 class QuicPerConnectionPacketWriter : public QuicPacketWriter { 17 class QuicPerConnectionPacketWriter : public QuicPacketWriter {
19 public: 18 public:
20 // Does not take ownership of |shared_writer|. 19 // Does not take ownership of |shared_writer|.
21 QuicPerConnectionPacketWriter(QuicPacketWriter* shared_writer); 20 QuicPerConnectionPacketWriter(QuicPacketWriter* shared_writer);
22 ~QuicPerConnectionPacketWriter() override; 21 ~QuicPerConnectionPacketWriter() override;
23 22
24 QuicPacketWriter* shared_writer() const { return shared_writer_; } 23 QuicPacketWriter* shared_writer() const { return shared_writer_; }
25 24
26 // Default implementation of the QuicPacketWriter interface: Passes everything 25 // Default implementation of the QuicPacketWriter interface: Passes everything
27 // to |shared_writer_|. 26 // to |shared_writer_|.
28 WriteResult WritePacket(const char* buffer, 27 WriteResult WritePacket(const char* buffer,
29 size_t buf_len, 28 size_t buf_len,
30 const IPAddressNumber& self_address, 29 const IPAddressNumber& self_address,
31 const IPEndPoint& peer_address, 30 const IPEndPoint& peer_address,
32 PerPacketOptions* options) override; 31 PerPacketOptions* options) override;
33 bool IsWriteBlockedDataBuffered() const override; 32 bool IsWriteBlockedDataBuffered() const override;
34 bool IsWriteBlocked() const override; 33 bool IsWriteBlocked() const override;
35 void SetWritable() override; 34 void SetWritable() override;
36 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; 35 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
37 36
38 private: 37 private:
39 QuicPacketWriter* shared_writer_; // Not owned. 38 QuicPacketWriter* shared_writer_; // Not owned.
40 39
41 DISALLOW_COPY_AND_ASSIGN(QuicPerConnectionPacketWriter); 40 DISALLOW_COPY_AND_ASSIGN(QuicPerConnectionPacketWriter);
42 }; 41 };
43 42
44
45 } // namespace net 43 } // namespace net
46 44
47 #endif // NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_ 45 #endif // NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_packet_writer_wrapper.h ('k') | net/tools/quic/quic_per_connection_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698