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

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

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/quic/quic_data_stream_test.cc ('k') | net/quic/quic_dispatcher.h » ('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_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"
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 #include "net/quic/quic_protocol.h" 13 #include "net/quic/quic_protocol.h"
14 #include "net/udp/datagram_client_socket.h" 14 #include "net/udp/datagram_client_socket.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 struct WriteResult; 18 struct WriteResult;
19 19
20 // Chrome specific packet writer which uses a DatagramClientSocket for writing 20 // Chrome specific packet writer which uses a DatagramClientSocket for writing
21 // data. 21 // data.
22 class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter { 22 class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
23 public: 23 public:
24 QuicDefaultPacketWriter(); 24 QuicDefaultPacketWriter();
25 explicit QuicDefaultPacketWriter(DatagramClientSocket* socket); 25 explicit QuicDefaultPacketWriter(DatagramClientSocket* socket);
26 virtual ~QuicDefaultPacketWriter(); 26 ~QuicDefaultPacketWriter() override;
27 27
28 // QuicPacketWriter 28 // QuicPacketWriter
29 virtual WriteResult WritePacket(const char* buffer, 29 WriteResult WritePacket(const char* buffer,
30 size_t buf_len, 30 size_t buf_len,
31 const IPAddressNumber& self_address, 31 const IPAddressNumber& self_address,
32 const IPEndPoint& peer_address) override; 32 const IPEndPoint& peer_address) override;
33 virtual bool IsWriteBlockedDataBuffered() const override; 33 bool IsWriteBlockedDataBuffered() const override;
34 virtual bool IsWriteBlocked() const override; 34 bool IsWriteBlocked() const override;
35 virtual void SetWritable() override; 35 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: 42 protected:
43 void set_write_blocked(bool is_blocked) { 43 void set_write_blocked(bool is_blocked) {
44 write_blocked_ = is_blocked; 44 write_blocked_ = is_blocked;
45 } 45 }
46 46
47 private: 47 private:
48 DatagramClientSocket* socket_; 48 DatagramClientSocket* socket_;
49 QuicConnection* connection_; 49 QuicConnection* connection_;
50 50
51 // Whether a write is currently in flight. 51 // Whether a write is currently in flight.
52 bool write_blocked_; 52 bool write_blocked_;
53 53
54 base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_; 54 base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter); 56 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter);
57 }; 57 };
58 58
59 } // namespace net 59 } // namespace net
60 60
61 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ 61 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_data_stream_test.cc ('k') | net/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698