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

Side by Side Diff: net/spdy/spdy_io_buffer.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_http_stream.cc ('k') | net/spdy/spdy_io_buffer.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) 2012 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_IO_BUFFER_H_
6 #define NET_SPDY_SPDY_IO_BUFFER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "net/base/io_buffer.h"
10 #include "net/base/net_export.h"
11
12 namespace net {
13
14 class SpdyStream;
15
16 // A class for managing SPDY write buffers. These write buffers need
17 // to track the SpdyStream which they are associated with so that the
18 // session can activate the stream lazily and also notify the stream
19 // on completion of the write.
20 class NET_EXPORT_PRIVATE SpdyIOBuffer {
21 public:
22 SpdyIOBuffer();
23
24 // Constructor
25 // |buffer| is the actual data buffer.
26 // |size| is the size of the data buffer.
27 // |stream| is a pointer to the stream which is managing this buffer
28 // (can be NULL if the write is for the session itself).
29 SpdyIOBuffer(IOBuffer* buffer, int size, SpdyStream* stream);
30
31 // Declare this instead of using the default so that we avoid needing to
32 // include spdy_stream.h.
33 SpdyIOBuffer(const SpdyIOBuffer& rhs);
34
35 ~SpdyIOBuffer();
36
37 // Declare this instead of using the default so that we avoid needing to
38 // include spdy_stream.h.
39 SpdyIOBuffer& operator=(const SpdyIOBuffer& rhs);
40
41 void Swap(SpdyIOBuffer* other);
42
43 void Release();
44
45 // Accessors.
46 DrainableIOBuffer* buffer() const { return buffer_; }
47 const scoped_refptr<SpdyStream>& stream() const { return stream_; }
48
49 private:
50 scoped_refptr<DrainableIOBuffer> buffer_;
51 scoped_refptr<SpdyStream> stream_;
52 };
53
54 } // namespace net
55
56 #endif // NET_SPDY_SPDY_IO_BUFFER_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_stream.cc ('k') | net/spdy/spdy_io_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698