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 2534ade5787f6b74640d73d54e937fc102fdf45c..eec8fc5fd7393d468833f238eaf6d67992adfaec 100644 |
--- a/net/tools/quic/quic_epoll_connection_helper.cc |
+++ b/net/tools/quic/quic_epoll_connection_helper.cc |
@@ -16,55 +16,9 @@ |
namespace net { |
-namespace { |
- |
-class QuicEpollAlarm : public QuicAlarm { |
- public: |
- QuicEpollAlarm(EpollServer* epoll_server, |
- QuicArenaScopedPtr<Delegate> delegate) |
- : QuicAlarm(std::move(delegate)), |
- epoll_server_(epoll_server), |
- epoll_alarm_impl_(this) {} |
- |
- protected: |
- void SetImpl() override { |
- DCHECK(deadline().IsInitialized()); |
- epoll_server_->RegisterAlarm( |
- deadline().Subtract(QuicTime::Zero()).ToMicroseconds(), |
- &epoll_alarm_impl_); |
- } |
- |
- void CancelImpl() override { |
- DCHECK(!deadline().IsInitialized()); |
- epoll_alarm_impl_.UnregisterIfRegistered(); |
- } |
- |
- private: |
- class EpollAlarmImpl : public EpollAlarm { |
- public: |
- explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {} |
- |
- int64_t OnAlarm() override { |
- EpollAlarm::OnAlarm(); |
- alarm_->Fire(); |
- // Fire will take care of registering the alarm, if needed. |
- return 0; |
- } |
- |
- private: |
- QuicEpollAlarm* alarm_; |
- }; |
- |
- EpollServer* epoll_server_; |
- EpollAlarmImpl epoll_alarm_impl_; |
-}; |
- |
-} // namespace |
- |
QuicEpollConnectionHelper::QuicEpollConnectionHelper(EpollServer* epoll_server, |
QuicAllocator type) |
- : epoll_server_(epoll_server), |
- clock_(epoll_server), |
+ : clock_(epoll_server), |
random_generator_(QuicRandom::GetInstance()), |
allocator_type_(type) {} |
@@ -78,23 +32,6 @@ QuicRandom* QuicEpollConnectionHelper::GetRandomGenerator() { |
return random_generator_; |
} |
-QuicAlarm* QuicEpollConnectionHelper::CreateAlarm( |
- QuicAlarm::Delegate* 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() { |
if (allocator_type_ == QuicAllocator::BUFFER_POOL) { |
return &buffer_allocator_; |