| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |