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

Unified Diff: net/tools/quic/quic_epoll_connection_helper.cc

Issue 1908103002: Landing Recent QUIC changes until 4/15/2016 17:20 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 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 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_;
« 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