quic_chromium_connection_helper.cc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "net/quic/quic_chromium_connection_helper.h"
  5. #include "base/no_destructor.h"
  6. namespace net {
  7. namespace {
  8. quiche::QuicheBufferAllocator* GetBufferAllocator() {
  9. static base::NoDestructor<quiche::SimpleBufferAllocator> allocator;
  10. return &*allocator;
  11. }
  12. } // namespace
  13. QuicChromiumConnectionHelper::QuicChromiumConnectionHelper(
  14. const quic::QuicClock* clock,
  15. quic::QuicRandom* random_generator)
  16. : clock_(clock), random_generator_(random_generator) {}
  17. QuicChromiumConnectionHelper::~QuicChromiumConnectionHelper() = default;
  18. const quic::QuicClock* QuicChromiumConnectionHelper::GetClock() const {
  19. return clock_;
  20. }
  21. quic::QuicRandom* QuicChromiumConnectionHelper::GetRandomGenerator() {
  22. return random_generator_;
  23. }
  24. quiche::QuicheBufferAllocator*
  25. QuicChromiumConnectionHelper::GetStreamSendBufferAllocator() {
  26. return GetBufferAllocator();
  27. }
  28. } // namespace net