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

Side by Side Diff: net/quic/test_tools/quic_stream_sequencer_buffer_peer.h

Issue 2387753002: Release read buffer of QuicCryptoStream when incoming message become less frequent. Protected by --… (Closed)
Patch Set: enable quic crypto stream release buffer Created 4 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2016 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_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
7
8 #include "net/quic/core/quic_stream_sequencer_buffer.h"
9
10 namespace net {
11
12 namespace test {
13
14 class QuicStreamSequencerBufferPeer {
15 public:
16 explicit QuicStreamSequencerBufferPeer(
17 net::QuicStreamSequencerBuffer* buffer);
18
19 // Read from this buffer_ into the given destination buffer_ up to the
20 // size of the destination. Returns the number of bytes read. Reading from
21 // an empty buffer_->returns 0.
22 size_t Read(char* dest_buffer, size_t size);
23
24 // If buffer is empty, the blocks_ array must be empty, which means all
25 // blocks are deallocated.
26 bool CheckEmptyInvariants();
27
28 bool IsBlockArrayEmpty();
29
30 bool CheckInitialState();
31
32 bool CheckBufferInvariants();
33
34 size_t GetInBlockOffset(QuicStreamOffset offset);
35
36 net::QuicStreamSequencerBuffer::BufferBlock* GetBlock(size_t index);
37
38 int GapSize();
39
40 std::list<net::QuicStreamSequencerBuffer::Gap> GetGaps();
41
42 size_t max_buffer_capacity();
43
44 size_t ReadableBytes();
45
46 std::map<QuicStreamOffset, net::QuicStreamSequencerBuffer::FrameInfo>*
47 frame_arrival_time_map();
48
49 void set_total_bytes_read(QuicStreamOffset total_bytes_read);
50
51 void set_gaps(const std::list<net::QuicStreamSequencerBuffer::Gap>& gaps);
52
53 bool IsBufferAllocated();
54
55 private:
56 net::QuicStreamSequencerBuffer* buffer_;
57 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencerBufferPeer);
58 };
59
60 } // namespace test
61 } // namespace net
62
63 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer_buffer_test.cc ('k') | net/quic/test_tools/quic_stream_sequencer_buffer_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698