summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc')
-rw-r--r--chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc b/chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc
new file mode 100644
index 00000000000..1c2f5b7df9e
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quiche/quic/core/quic_epoll_connection_helper.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "quiche/quic/core/quic_epoll_connection_helper.h"
+
+#include <errno.h>
+#include <sys/socket.h>
+
+#include "quiche/quic/core/crypto/quic_random.h"
+
+namespace quic {
+
+QuicEpollConnectionHelper::QuicEpollConnectionHelper(
+ QuicEpollServer* epoll_server, QuicAllocator allocator_type)
+ : clock_(epoll_server),
+ random_generator_(QuicRandom::GetInstance()),
+ allocator_type_(allocator_type) {}
+
+QuicEpollConnectionHelper::~QuicEpollConnectionHelper() = default;
+
+const QuicClock* QuicEpollConnectionHelper::GetClock() const { return &clock_; }
+
+QuicRandom* QuicEpollConnectionHelper::GetRandomGenerator() {
+ return random_generator_;
+}
+
+quiche::QuicheBufferAllocator*
+QuicEpollConnectionHelper::GetStreamSendBufferAllocator() {
+ if (allocator_type_ == QuicAllocator::BUFFER_POOL) {
+ return &stream_buffer_allocator_;
+ } else {
+ QUICHE_DCHECK(allocator_type_ == QuicAllocator::SIMPLE);
+ return &simple_buffer_allocator_;
+ }
+}
+
+} // namespace quic