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

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

Issue 1901723002: Cleanup: Remove references to and unneeded includes of "base/scoped_ptr.h". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119917706
Patch Set: Created 4 years, 8 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/quic_dispatcher.h ('k') | net/tools/quic/quic_server.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 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_PACKET_WRITER_WRAPPER_H_ 5 #ifndef NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_
6 #define NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_ 6 #define NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_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 "base/memory/scoped_ptr.h"
12 #include "net/quic/quic_packet_writer.h" 11 #include "net/quic/quic_packet_writer.h"
13 12
14 namespace net { 13 namespace net {
15 14
16 // Wraps a writer object to allow dynamically extending functionality. Use 15 // Wraps a writer object to allow dynamically extending functionality. Use
17 // cases: replace writer while dispatcher and connections hold on to the 16 // cases: replace writer while dispatcher and connections hold on to the
18 // wrapper; mix in monitoring; mix in mocks in unit tests. 17 // wrapper; mix in monitoring; mix in mocks in unit tests.
19 class QuicPacketWriterWrapper : public QuicPacketWriter { 18 class QuicPacketWriterWrapper : public QuicPacketWriter {
20 public: 19 public:
21 QuicPacketWriterWrapper(); 20 QuicPacketWriterWrapper();
22 explicit QuicPacketWriterWrapper(QuicPacketWriter* writer); 21 explicit QuicPacketWriterWrapper(QuicPacketWriter* writer);
23 ~QuicPacketWriterWrapper() override; 22 ~QuicPacketWriterWrapper() override;
24 23
25 // Default implementation of the QuicPacketWriter interface. Passes everything 24 // Default implementation of the QuicPacketWriter interface. Passes everything
26 // to |writer_|. 25 // to |writer_|.
27 WriteResult WritePacket(const char* buffer, 26 WriteResult WritePacket(const char* buffer,
28 size_t buf_len, 27 size_t buf_len,
29 const IPAddress& self_address, 28 const IPAddress& self_address,
30 const IPEndPoint& peer_address, 29 const IPEndPoint& peer_address,
31 PerPacketOptions* options) override; 30 PerPacketOptions* options) override;
32 bool IsWriteBlockedDataBuffered() const override; 31 bool IsWriteBlockedDataBuffered() const override;
33 bool IsWriteBlocked() const override; 32 bool IsWriteBlocked() const override;
34 void SetWritable() override; 33 void SetWritable() override;
35 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; 34 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
36 35
37 // Takes ownership of |writer|. 36 // Takes ownership of |writer|.
38 void set_writer(QuicPacketWriter* writer); 37 void set_writer(QuicPacketWriter* writer);
39 38
40 private: 39 private:
41 scoped_ptr<QuicPacketWriter> writer_; 40 std::unique_ptr<QuicPacketWriter> writer_;
42 41
43 DISALLOW_COPY_AND_ASSIGN(QuicPacketWriterWrapper); 42 DISALLOW_COPY_AND_ASSIGN(QuicPacketWriterWrapper);
44 }; 43 };
45 44
46 } // namespace net 45 } // namespace net
47 46
48 #endif // NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_ 47 #endif // NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698