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

Side by Side Diff: net/spdy/spdy_read_queue.h

Issue 13990005: [SPDY] Replace SpdyIOBuffer with new SpdyBuffer class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missing include Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.cc ('k') | net/spdy/spdy_read_queue.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) 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_SPDY_SPDY_BUFFER_QUEUE_H_
6 #define NET_SPDY_SPDY_BUFFER_QUEUE_H_
7
8 #include <cstddef>
9 #include <deque>
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "net/base/net_export.h"
14
15 namespace net {
16
17 class SpdyBuffer;
18
19 // A FIFO queue of incoming data from a SPDY connection. Useful for
20 // SpdyStream delegates.
21 class NET_EXPORT_PRIVATE SpdyReadQueue {
22 public:
23 SpdyReadQueue();
24 ~SpdyReadQueue();
25
26 // Returns whether there's anything in the queue.
27 bool IsEmpty() const;
28
29 // Returns the total number of bytes in the queue.
30 size_t GetTotalSize() const;
31
32 // Enqueues the bytes in |buffer|.
33 void Enqueue(scoped_ptr<SpdyBuffer> buffer);
34
35 // Dequeues up to |len| (which must be positive) bytes into
36 // |out|. Returns the number of bytes dequeued.
37 size_t Dequeue(char* out, size_t len);
38
39 // Removes all bytes from the queue.
40 void Clear();
41
42 private:
43 std::deque<SpdyBuffer*> queue_;
44 size_t total_size_;
45
46 DISALLOW_COPY_AND_ASSIGN(SpdyReadQueue);
47 };
48
49 } // namespace net
50
51 #endif // NET_SPDY_SPDY_BUFFER_QUEUE_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.cc ('k') | net/spdy/spdy_read_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698