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

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

Issue 2869273009: Revert two changes written by non-Googler authors. (Closed)
Patch Set: Created 3 years, 7 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 | net/quic/quartc/quartc_packet_writer.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) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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/platform/api/quic_socket_address.h" 8 #include "net/quic/platform/api/quic_socket_address.h"
9 #include "net/quic/quartc/quartc_session.h" 9 #include "net/quic/quartc/quartc_session.h"
10 10
(...skipping 24 matching lines...) Expand all
35 // Cancel it if already set. 35 // Cancel it if already set.
36 CancelImpl(); 36 CancelImpl();
37 37
38 int64_t delay_ms = (deadline() - (clock_->Now())).ToMilliseconds(); 38 int64_t delay_ms = (deadline() - (clock_->Now())).ToMilliseconds();
39 if (delay_ms < 0) { 39 if (delay_ms < 0) {
40 delay_ms = 0; 40 delay_ms = 0;
41 } 41 }
42 42
43 DCHECK(task_runner_); 43 DCHECK(task_runner_);
44 DCHECK(!scheduled_task_); 44 DCHECK(!scheduled_task_);
45 scheduled_task_ = task_runner_->Schedule(this, delay_ms); 45 scheduled_task_.reset(task_runner_->Schedule(this, delay_ms).release());
46 } 46 }
47 47
48 void CancelImpl() override { 48 void CancelImpl() override {
49 if (scheduled_task_) { 49 if (scheduled_task_) {
50 scheduled_task_->Cancel(); 50 scheduled_task_->Cancel();
51 scheduled_task_.reset(); 51 scheduled_task_.reset();
52 } 52 }
53 } 53 }
54 54
55 // QuartcTaskRunner::Task overrides. 55 // QuartcTaskRunner::Task overrides.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return &buffer_allocator_; 160 return &buffer_allocator_;
161 } 161 }
162 162
163 std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory( 163 std::unique_ptr<QuartcFactoryInterface> CreateQuartcFactory(
164 const QuartcFactoryConfig& factory_config) { 164 const QuartcFactoryConfig& factory_config) {
165 return std::unique_ptr<QuartcFactoryInterface>( 165 return std::unique_ptr<QuartcFactoryInterface>(
166 new QuartcFactory(factory_config)); 166 new QuartcFactory(factory_config));
167 } 167 }
168 168
169 } // namespace net 169 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quartc/quartc_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698