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

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

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 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
« no previous file with comments | « net/spdy/spdy_buffer.cc ('k') | net/spdy/spdy_buffer_producer.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_PRODUCER_H_
6 #define NET_SPDY_SPDY_BUFFER_PRODUCER_H_
7
8 #include <memory>
9
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "net/base/net_export.h"
13
14 namespace net {
15
16 class SpdyBuffer;
17
18 // An object which provides a SpdyBuffer for writing. We pass these
19 // around instead of SpdyBuffers since some buffers have to be
20 // generated "just in time".
21 class NET_EXPORT_PRIVATE SpdyBufferProducer {
22 public:
23 SpdyBufferProducer();
24
25 // Produces the buffer to be written. Will be called at most once.
26 virtual std::unique_ptr<SpdyBuffer> ProduceBuffer() = 0;
27
28 virtual ~SpdyBufferProducer();
29
30 // Returns the estimate of dynamically allocated memory in bytes.
31 virtual size_t EstimateMemoryUsage() const = 0;
32
33 private:
34 DISALLOW_COPY_AND_ASSIGN(SpdyBufferProducer);
35 };
36
37 // A simple wrapper around a single SpdyBuffer.
38 class NET_EXPORT_PRIVATE SimpleBufferProducer : public SpdyBufferProducer {
39 public:
40 explicit SimpleBufferProducer(std::unique_ptr<SpdyBuffer> buffer);
41
42 ~SimpleBufferProducer() override;
43
44 std::unique_ptr<SpdyBuffer> ProduceBuffer() override;
45
46 size_t EstimateMemoryUsage() const override;
47
48 private:
49 std::unique_ptr<SpdyBuffer> buffer_;
50
51 DISALLOW_COPY_AND_ASSIGN(SimpleBufferProducer);
52 };
53
54 } // namespace net
55
56 #endif // NET_SPDY_SPDY_BUFFER_PRODUCER_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_buffer.cc ('k') | net/spdy/spdy_buffer_producer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698