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

Side by Side Diff: net/quic/quic_alarm_factory.h

Issue 1898793003: Make QuicDispatcher's helper and alarm factory arguments unique_ptrs to make ownership clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119871679
Patch Set: fixing rebase 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 unified diff | Download patch
« no previous file with comments | « net/quic/p2p/quic_p2p_session_test.cc ('k') | net/quic/quic_chromium_alarm_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 NET_QUIC_QUIC_ALARM_FACTORY_H_
6 #define NET_QUIC_QUIC_ALARM_FACTORY_H_
7
8 #include "net/quic/quic_alarm.h"
9 #include "net/quic/quic_one_block_arena.h"
10
11 namespace net {
12
13 // QuicConnections currently use around 1KB of polymorphic types which would
14 // ordinarily be on the heap. Instead, store them inline in an arena.
15 using QuicConnectionArena = QuicOneBlockArena<1024>;
16
17 // Creates platform-specific alarms used throughout QUIC.
18 class QuicAlarmFactory {
19 public:
20 virtual ~QuicAlarmFactory() {}
21
22 // Creates a new platform-specific alarm which will be configured to notify
23 // |delegate| when the alarm fires. Returns an alarm allocated on the heap.
24 // Caller takes ownership of the new alarm, which will not yet be "set" to
25 // fire.
26 virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) = 0;
27
28 // Creates a new platform-specific alarm which will be configured to notify
29 // |delegate| when the alarm fires. Caller takes ownership of the new alarm,
30 // which will not yet be "set" to fire. If |arena| is null, then the alarm
31 // will be created on the heap. Otherwise, it will be created in |arena|.
32 virtual QuicArenaScopedPtr<QuicAlarm> CreateAlarm(
33 QuicArenaScopedPtr<QuicAlarm::Delegate> delegate,
34 QuicConnectionArena* arena) = 0;
35 };
36
37 } // namespace net
38
39 #endif // NET_QUIC_QUIC_ALARM_FACTORY_H_
OLDNEW
« no previous file with comments | « net/quic/p2p/quic_p2p_session_test.cc ('k') | net/quic/quic_chromium_alarm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698