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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 1572353002: QuicAlarms are now allocated out of an arena in QuicConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge recent changes. Created 4 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 | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_epoll_connection_helper.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 (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/quic/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "base/sha1.h" 7 #include "base/sha1.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/crypto/crypto_framer.h" 10 #include "net/quic/crypto/crypto_framer.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 const QuicClock* MockConnectionHelper::GetClock() const { 188 const QuicClock* MockConnectionHelper::GetClock() const {
189 return &clock_; 189 return &clock_;
190 } 190 }
191 191
192 QuicRandom* MockConnectionHelper::GetRandomGenerator() { 192 QuicRandom* MockConnectionHelper::GetRandomGenerator() {
193 return &random_generator_; 193 return &random_generator_;
194 } 194 }
195 195
196 QuicAlarm* MockConnectionHelper::CreateAlarm(QuicAlarm::Delegate* delegate) { 196 QuicAlarm* MockConnectionHelper::CreateAlarm(QuicAlarm::Delegate* delegate) {
197 return new MockConnectionHelper::TestAlarm(delegate); 197 return new MockConnectionHelper::TestAlarm(
198 QuicArenaScopedPtr<QuicAlarm::Delegate>(delegate));
199 }
200
201 QuicArenaScopedPtr<QuicAlarm> MockConnectionHelper::CreateAlarm(
202 QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
203 QuicConnectionArena* arena) {
204 if (arena != nullptr) {
205 return arena->New<MockConnectionHelper::TestAlarm>(std::move(delegate));
206 } else {
207 return QuicArenaScopedPtr<MockConnectionHelper::TestAlarm>(
208 new TestAlarm(std::move(delegate)));
209 }
198 } 210 }
199 211
200 QuicBufferAllocator* MockConnectionHelper::GetBufferAllocator() { 212 QuicBufferAllocator* MockConnectionHelper::GetBufferAllocator() {
201 return &buffer_allocator_; 213 return &buffer_allocator_;
202 } 214 }
203 215
204 void MockConnectionHelper::AdvanceTime(QuicTime::Delta delta) { 216 void MockConnectionHelper::AdvanceTime(QuicTime::Delta delta) {
205 clock_.AdvanceTime(delta); 217 clock_.AdvanceTime(delta);
206 } 218 }
207 219
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 // strike register worries that we've just overflowed a uint32_t time. 770 // strike register worries that we've just overflowed a uint32_t time.
759 (*server_connection)->AdvanceTime(connection_start_time); 771 (*server_connection)->AdvanceTime(connection_start_time);
760 } 772 }
761 773
762 QuicStreamId QuicClientDataStreamId(int i) { 774 QuicStreamId QuicClientDataStreamId(int i) {
763 return kClientDataStreamId1 + 2 * i; 775 return kClientDataStreamId1 + 2 * i;
764 } 776 }
765 777
766 } // namespace test 778 } // namespace test
767 } // namespace net 779 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_epoll_connection_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698