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

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

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/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_dispatcher_test.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 #include "net/tools/quic/quic_dispatcher.h" 5 #include "net/tools/quic/quic_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 23 matching lines...) Expand all
34 34
35 private: 35 private:
36 // Not owned. 36 // Not owned.
37 QuicDispatcher* dispatcher_; 37 QuicDispatcher* dispatcher_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm); 39 DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm);
40 }; 40 };
41 41
42 } // namespace 42 } // namespace
43 43
44 QuicDispatcher::QuicDispatcher(const QuicConfig& config, 44 QuicDispatcher::QuicDispatcher(
45 const QuicCryptoServerConfig* crypto_config, 45 const QuicConfig& config,
46 const QuicVersionVector& supported_versions, 46 const QuicCryptoServerConfig* crypto_config,
47 QuicConnectionHelperInterface* helper) 47 const QuicVersionVector& supported_versions,
48 std::unique_ptr<QuicConnectionHelperInterface> helper)
48 : config_(config), 49 : config_(config),
49 crypto_config_(crypto_config), 50 crypto_config_(crypto_config),
50 compressed_certs_cache_( 51 compressed_certs_cache_(
51 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), 52 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize),
52 helper_(helper), 53 helper_(std::move(helper)),
53 delete_sessions_alarm_( 54 delete_sessions_alarm_(
54 helper_->CreateAlarm(new DeleteSessionsAlarm(this))), 55 helper_->CreateAlarm(new DeleteSessionsAlarm(this))),
55 supported_versions_(supported_versions), 56 supported_versions_(supported_versions),
56 current_packet_(nullptr), 57 current_packet_(nullptr),
57 framer_(supported_versions, 58 framer_(supported_versions,
58 /*unused*/ QuicTime::Zero(), 59 /*unused*/ QuicTime::Zero(),
59 Perspective::IS_SERVER), 60 Perspective::IS_SERVER),
60 last_error_(QUIC_NO_ERROR) { 61 last_error_(QUIC_NO_ERROR) {
61 framer_.set_visitor(this); 62 framer_.set_visitor(this);
62 } 63 }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 482
482 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { 483 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() {
483 return new QuicPerConnectionPacketWriter(writer_.get()); 484 return new QuicPerConnectionPacketWriter(writer_.get());
484 } 485 }
485 486
486 void QuicDispatcher::SetLastError(QuicErrorCode error) { 487 void QuicDispatcher::SetLastError(QuicErrorCode error) {
487 last_error_ = error; 488 last_error_ = error;
488 } 489 }
489 490
490 } // namespace net 491 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698