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

Side by Side Diff: net/quic/quartc/quartc_factory.cc

Issue 2634513004: Replace unique_ptr.reset/release with std::move (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | 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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/quic/quartc/quartc_factory.h" 5 #include "net/quic/quartc/quartc_factory.h"
6 6
7 #include "net/quic/core/crypto/quic_random.h" 7 #include "net/quic/core/crypto/quic_random.h"
8 #include "net/quic/quartc/quartc_alarm_factory.h" 8 #include "net/quic/quartc/quartc_alarm_factory.h"
9 #include "net/quic/quartc/quartc_session.h" 9 #include "net/quic/quartc/quartc_session.h"
10 10
(...skipping 23 matching lines...) Expand all
34 // Cancel it if already set. 34 // Cancel it if already set.
35 CancelImpl(); 35 CancelImpl();
36 36
37 int64_t delay_ms = (deadline() - (clock_->Now())).ToMilliseconds(); 37 int64_t delay_ms = (deadline() - (clock_->Now())).ToMilliseconds();
38 if (delay_ms < 0) { 38 if (delay_ms < 0) {
39 delay_ms = 0; 39 delay_ms = 0;
40 } 40 }
41 41
42 DCHECK(task_runner_); 42 DCHECK(task_runner_);
43 DCHECK(!scheduled_task_); 43 DCHECK(!scheduled_task_);
44 scheduled_task_.reset((task_runner_->Schedule(this, delay_ms)).release()); 44 scheduled_task_ = task_runner_->Schedule(this, delay_ms);
45 } 45 }
46 46
47 void CancelImpl() override { 47 void CancelImpl() override {
48 if (scheduled_task_) { 48 if (scheduled_task_) {
49 scheduled_task_->Cancel(); 49 scheduled_task_->Cancel();
50 scheduled_task_.reset(); 50 scheduled_task_.reset();
51 } 51 }
52 } 52 }
53 53
54 // QuartcTaskRunner::Task overrides. 54 // QuartcTaskRunner::Task overrides.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return &buffer_allocator_; 148 return &buffer_allocator_;
149 } 149 }
150 150
151 std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory( 151 std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory(
152 const QuartcFactoryConfig& factory_config) { 152 const QuartcFactoryConfig& factory_config) {
153 return std::unique_ptr<QuartcFactoryInterface>( 153 return std::unique_ptr<QuartcFactoryInterface>(
154 new QuartcFactory(factory_config)); 154 new QuartcFactory(factory_config));
155 } 155 }
156 156
157 } // namespace net 157 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698