blob: 0e0ce332b99d7fe2ad9b3aed6b5723d913cff34a [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2015 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
5#ifndef QUICHE_QUIC_CORE_QUIC_ALARM_FACTORY_H_
6#define QUICHE_QUIC_CORE_QUIC_ALARM_FACTORY_H_
7
8#include "net/third_party/quiche/src/quic/core/quic_alarm.h"
9#include "net/third_party/quiche/src/quic/core/quic_one_block_arena.h"
10#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
11
12namespace quic {
13
14// Creates platform-specific alarms used throughout QUIC.
15class QUIC_EXPORT_PRIVATE QuicAlarmFactory {
16 public:
17 virtual ~QuicAlarmFactory() {}
18
19 // Creates a new platform-specific alarm which will be configured to notify
20 // |delegate| when the alarm fires. Returns an alarm allocated on the heap.
21 // Caller takes ownership of the new alarm, which will not yet be "set" to
22 // fire.
23 virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) = 0;
24
25 // Creates a new platform-specific alarm which will be configured to notify
26 // |delegate| when the alarm fires. Caller takes ownership of the new alarm,
27 // which will not yet be "set" to fire. If |arena| is null, then the alarm
28 // will be created on the heap. Otherwise, it will be created in |arena|.
29 virtual QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
30 QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
31 QuicConnectionArena* arena) = 0;
32};
33
34} // namespace quic
35
36#endif // QUICHE_QUIC_CORE_QUIC_ALARM_FACTORY_H_