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

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

Issue 1662433002: Per-packet options now passed through to QuicPacketWriter, instead of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113054959
Patch Set: Fix comments for Patch Set 1 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
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_default_packet_writer.cc » ('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 #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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "net/base/ip_endpoint.h" 11 #include "net/base/ip_endpoint.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 struct WriteResult; 16 struct WriteResult;
17 17
18 18
19 // Default packet writer which wraps QuicSocketUtils WritePacket. 19 // Default packet writer which wraps QuicSocketUtils WritePacket.
20 class QuicDefaultPacketWriter : public QuicPacketWriter { 20 class QuicDefaultPacketWriter : public QuicPacketWriter {
21 public: 21 public:
22 explicit QuicDefaultPacketWriter(int fd); 22 explicit QuicDefaultPacketWriter(int fd);
23 ~QuicDefaultPacketWriter() override; 23 ~QuicDefaultPacketWriter() override;
24 24
25 // QuicPacketWriter 25 // QuicPacketWriter
26 WriteResult WritePacket(const char* buffer, 26 WriteResult WritePacket(const char* buffer,
27 size_t buf_len, 27 size_t buf_len,
28 const IPAddressNumber& self_address, 28 const IPAddressNumber& self_address,
29 const IPEndPoint& peer_address) override; 29 const IPEndPoint& peer_address,
30 PerPacketOptions* options) override;
30 bool IsWriteBlockedDataBuffered() const override; 31 bool IsWriteBlockedDataBuffered() const override;
31 bool IsWriteBlocked() const override; 32 bool IsWriteBlocked() const override;
32 void SetWritable() override; 33 void SetWritable() override;
33 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; 34 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
34 35
35 void set_fd(int fd) { fd_ = fd; } 36 void set_fd(int fd) { fd_ = fd; }
36 37
37 protected: 38 protected:
38 void set_write_blocked(bool is_blocked) { write_blocked_ = is_blocked; } 39 void set_write_blocked(bool is_blocked) { write_blocked_ = is_blocked; }
39 int fd() { return fd_; } 40 int fd() { return fd_; }
40 41
41 private: 42 private:
42 int fd_; 43 int fd_;
43 bool write_blocked_; 44 bool write_blocked_;
44 45
45 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter); 46 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter);
46 }; 47 };
47 48
48 } // namespace net 49 } // namespace net
49 50
50 #endif // NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ 51 #endif // NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_default_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698