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

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

Issue 1907773002: Make QuicDispatcher's helper argument be a unique_ptr to make ownership (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119678304
Patch Set: Rebase 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/quic/test_tools/mock_quic_dispatcher.cc ('k') | net/tools/quic/quic_dispatcher.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // A server side dispatcher which dispatches a given client's data to their 5 // A server side dispatcher which dispatches a given client's data to their
6 // stream. 6 // stream.
7 7
8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ 8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_
9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ 9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_
10 10
(...skipping 26 matching lines...) Expand all
37 public ProcessPacketInterface, 37 public ProcessPacketInterface,
38 public QuicBlockedWriterInterface, 38 public QuicBlockedWriterInterface,
39 public QuicFramerVisitorInterface { 39 public QuicFramerVisitorInterface {
40 public: 40 public:
41 // Ideally we'd have a linked_hash_set: the boolean is unused. 41 // Ideally we'd have a linked_hash_set: the boolean is unused.
42 typedef linked_hash_map<QuicBlockedWriterInterface*, 42 typedef linked_hash_map<QuicBlockedWriterInterface*,
43 bool, 43 bool,
44 QuicBlockedWriterInterfacePtrHash> 44 QuicBlockedWriterInterfacePtrHash>
45 WriteBlockedList; 45 WriteBlockedList;
46 46
47 // Due to the way delete_sessions_closure_ is registered, the Dispatcher must
48 // live until server Shutdown. |supported_versions| specifies the std::list
49 // of supported QUIC versions. Takes ownership of |packet_writer_factory|,
50 // which is used to create per-connection writers.
51 QuicDispatcher(const QuicConfig& config, 47 QuicDispatcher(const QuicConfig& config,
52 const QuicCryptoServerConfig* crypto_config, 48 const QuicCryptoServerConfig* crypto_config,
53 const QuicVersionVector& supported_versions, 49 const QuicVersionVector& supported_versions,
54 QuicConnectionHelperInterface* helper); 50 std::unique_ptr<QuicConnectionHelperInterface> helper);
55 51
56 ~QuicDispatcher() override; 52 ~QuicDispatcher() override;
57 53
58 // Takes ownership of |writer|. 54 // Takes ownership of |writer|.
59 void InitializeWithWriter(QuicPacketWriter* writer); 55 void InitializeWithWriter(QuicPacketWriter* writer);
60 56
61 // Process the incoming packet by creating a new session, passing it to 57 // Process the incoming packet by creating a new session, passing it to
62 // an existing session, or passing it to the time wait list. 58 // an existing session, or passing it to the time wait list.
63 void ProcessPacket(const IPEndPoint& server_address, 59 void ProcessPacket(const IPEndPoint& server_address,
64 const IPEndPoint& client_address, 60 const IPEndPoint& client_address,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // The last error set by SetLastError(), which is called by 261 // The last error set by SetLastError(), which is called by
266 // framer_visitor_->OnError(). 262 // framer_visitor_->OnError().
267 QuicErrorCode last_error_; 263 QuicErrorCode last_error_;
268 264
269 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); 265 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher);
270 }; 266 };
271 267
272 } // namespace net 268 } // namespace net
273 269
274 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ 270 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/mock_quic_dispatcher.cc ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698