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

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

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 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/quic_flow_controller_test.cc ('k') | net/quic/quic_frame_list.cc » ('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 (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 NET_QUIC_QUIC_FRAME_LIST_H_
6 #define NET_QUIC_QUIC_FRAME_LIST_H_
7
8 #include <stddef.h>
9 #include <list>
10 #include <string>
11
12 #include "base/strings/string_piece.h"
13 #include "net/quic/quic_protocol.h"
14 #include "net/quic/quic_stream_sequencer_buffer_interface.h"
15
16 namespace net {
17
18 namespace test {
19 class QuicStreamSequencerPeer;
20 }
21
22 class NET_EXPORT_PRIVATE QuicFrameList
23 : public QuicStreamSequencerBufferInterface {
24 public:
25 // A contiguous segment received by a QUIC stream.
26 struct FrameData {
27 FrameData(QuicStreamOffset offset,
28 std::string segment,
29 const QuicTime timestamp);
30
31 const QuicStreamOffset offset;
32 std::string segment;
33 const QuicTime timestamp;
34 };
35
36 QuicFrameList();
37
38 ~QuicFrameList() override;
39
40 // QuicStreamSequencerBufferInterface implementation
41 void Clear() override;
42 bool Empty() const override;
43 QuicErrorCode OnStreamData(QuicStreamOffset offset,
44 base::StringPiece data,
45 QuicTime timestamp,
46 size_t* bytes_buffered) override;
47 size_t Readv(const struct iovec* iov, size_t iov_len) override;
48 int GetReadableRegions(struct iovec* iov, int iov_len) const override;
49 bool GetReadableRegion(iovec* iov, QuicTime* timestamp) const override;
50 bool MarkConsumed(size_t bytes_used) override;
51 size_t FlushBufferedFrames() override;
52 bool HasBytesToRead() const override;
53 QuicStreamOffset BytesConsumed() const override;
54 size_t BytesBuffered() const override;
55
56 private:
57 friend class test::QuicStreamSequencerPeer;
58
59 std::list<FrameData>::iterator FindInsertionPoint(QuicStreamOffset offset,
60 size_t len);
61
62 bool FrameOverlapsBufferedData(
63 QuicStreamOffset offset,
64 size_t data_len,
65 std::list<FrameData>::const_iterator insertion_point) const;
66
67 bool IsDuplicate(QuicStreamOffset offset,
68 size_t data_len,
69 std::list<FrameData>::const_iterator insertion_point) const;
70
71 std::list<FrameData> frame_list_;
72
73 // Number of bytes in buffer.
74 size_t num_bytes_buffered_ = 0;
75
76 QuicStreamOffset total_bytes_read_ = 0;
77 };
78
79 } // namespace net
80
81 #endif // NET_QUIC_QUIC_FRAME_LIST_H_
OLDNEW
« no previous file with comments | « net/quic/quic_flow_controller_test.cc ('k') | net/quic/quic_frame_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698