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

Unified Diff: net/tools/quic/quic_epoll_connection_helper.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/tools/quic/quic_epoll_connection_helper.h ('k') | net/tools/quic/quic_epoll_connection_helper_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_epoll_connection_helper.cc
diff --git a/net/tools/quic/quic_epoll_connection_helper.cc b/net/tools/quic/quic_epoll_connection_helper.cc
index 853f0d0257195a1d7aa4a18b63bea8add550307c..ec68754b06904add575322c0adaa1f09123c77ca 100644
--- a/net/tools/quic/quic_epoll_connection_helper.cc
+++ b/net/tools/quic/quic_epoll_connection_helper.cc
@@ -21,8 +21,9 @@ namespace {
class QuicEpollAlarm : public QuicAlarm {
public:
- QuicEpollAlarm(EpollServer* epoll_server, QuicAlarm::Delegate* delegate)
- : QuicAlarm(delegate),
+ QuicEpollAlarm(EpollServer* epoll_server,
+ QuicArenaScopedPtr<Delegate> delegate)
+ : QuicAlarm(std::move(delegate)),
epoll_server_(epoll_server),
epoll_alarm_impl_(this) {}
@@ -78,7 +79,19 @@ QuicRandom* QuicEpollConnectionHelper::GetRandomGenerator() {
QuicAlarm* QuicEpollConnectionHelper::CreateAlarm(
QuicAlarm::Delegate* delegate) {
- return new QuicEpollAlarm(epoll_server_, delegate);
+ return new QuicEpollAlarm(epoll_server_,
+ QuicArenaScopedPtr<QuicAlarm::Delegate>(delegate));
+}
+
+QuicArenaScopedPtr<QuicAlarm> QuicEpollConnectionHelper::CreateAlarm(
+ QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
+ QuicConnectionArena* arena) {
+ if (arena != nullptr) {
+ return arena->New<QuicEpollAlarm>(epoll_server_, std::move(delegate));
+ } else {
+ return QuicArenaScopedPtr<QuicAlarm>(
+ new QuicEpollAlarm(epoll_server_, std::move(delegate)));
+ }
}
QuicBufferAllocator* QuicEpollConnectionHelper::GetBufferAllocator() {
« no previous file with comments | « net/tools/quic/quic_epoll_connection_helper.h ('k') | net/tools/quic/quic_epoll_connection_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698