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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_test_utils.cc
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index a2ba09f9e0470b766171644ada095868e2de95f4..7fd347fdb75d1aad960fa4246df3ae6b814bc889 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -194,7 +194,19 @@ QuicRandom* MockConnectionHelper::GetRandomGenerator() {
}
QuicAlarm* MockConnectionHelper::CreateAlarm(QuicAlarm::Delegate* delegate) {
- return new MockConnectionHelper::TestAlarm(delegate);
+ return new MockConnectionHelper::TestAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate>(delegate));
+}
+
+QuicArenaScopedPtr<QuicAlarm> MockConnectionHelper::CreateAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
+ QuicConnectionArena* arena) {
+ if (arena != nullptr) {
+ return arena->New<MockConnectionHelper::TestAlarm>(std::move(delegate));
+ } else {
+ return QuicArenaScopedPtr<MockConnectionHelper::TestAlarm>(
+ new TestAlarm(std::move(delegate)));
+ }
}
QuicBufferAllocator* MockConnectionHelper::GetBufferAllocator() {
« 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