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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/test_tools/quic_stream_sequencer_buffer_peer.h
diff --git a/net/quic/test_tools/quic_stream_sequencer_buffer_peer.h b/net/quic/test_tools/quic_stream_sequencer_buffer_peer.h
new file mode 100644
index 0000000000000000000000000000000000000000..68944f52dce3172b86c99be6f743b591d80f7507
--- /dev/null
+++ b/net/quic/test_tools/quic_stream_sequencer_buffer_peer.h
@@ -0,0 +1,63 @@
+// Copyright 2016 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.
+
+#ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
+#define NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
+
+#include "net/quic/core/quic_stream_sequencer_buffer.h"
+
+namespace net {
+
+namespace test {
+
+class QuicStreamSequencerBufferPeer {
+ public:
+ explicit QuicStreamSequencerBufferPeer(
+ net::QuicStreamSequencerBuffer* buffer);
+
+ // Read from this buffer_ into the given destination buffer_ up to the
+ // size of the destination. Returns the number of bytes read. Reading from
+ // an empty buffer_->returns 0.
+ size_t Read(char* dest_buffer, size_t size);
+
+ // If buffer is empty, the blocks_ array must be empty, which means all
+ // blocks are deallocated.
+ bool CheckEmptyInvariants();
+
+ bool IsBlockArrayEmpty();
+
+ bool CheckInitialState();
+
+ bool CheckBufferInvariants();
+
+ size_t GetInBlockOffset(QuicStreamOffset offset);
+
+ net::QuicStreamSequencerBuffer::BufferBlock* GetBlock(size_t index);
+
+ int GapSize();
+
+ std::list<net::QuicStreamSequencerBuffer::Gap> GetGaps();
+
+ size_t max_buffer_capacity();
+
+ size_t ReadableBytes();
+
+ std::map<QuicStreamOffset, net::QuicStreamSequencerBuffer::FrameInfo>*
+ frame_arrival_time_map();
+
+ void set_total_bytes_read(QuicStreamOffset total_bytes_read);
+
+ void set_gaps(const std::list<net::QuicStreamSequencerBuffer::Gap>& gaps);
+
+ bool IsBufferAllocated();
+
+ private:
+ net::QuicStreamSequencerBuffer* buffer_;
+ DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencerBufferPeer);
+};
+
+} // namespace test
+} // namespace net
+
+#endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_
« 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