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

Side by Side Diff: remoting/base/multiple_array_input_stream.h

Issue 2690003: Copy the (early prototype of) remoting in Chrome into the public tree.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « remoting/base/mock_objects.h ('k') | remoting/base/multiple_array_input_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 REMOTING_BASE_MULTIPLE_ARRAY_INPUT_STREAM_H_
6 #define REMOTING_BASE_MULTIPLE_ARRAY_INPUT_STREAM_H_
7
8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h"
10 #include "google/protobuf/io/zero_copy_stream.h"
11
12 namespace remoting {
13
14 // A MultipleArrayInputStream provides a ZeroCopyInputStream with multiple
15 // backing arrays.
16 class MultipleArrayInputStream :
17 public google::protobuf::io::ZeroCopyInputStream {
18 public:
19 // Construct a MultipleArrayInputStream with |count| backing arrays.
20 // TODO(hclam): Consider adding block size to see if it has a performance
21 // gain.
22 explicit MultipleArrayInputStream(int count);
23 virtual ~MultipleArrayInputStream();
24
25 virtual bool Next(const void** data, int* size);
26 virtual void BackUp(int count);
27 virtual bool Skip(int count);
28 virtual int64 ByteCount() const;
29
30 // Set the n-th buffer to be |buffer|.
31 void SetBuffer(int n, const uint8* buffer, int size);
32
33 private:
34 scoped_array<const uint8*> buffers_;
35 scoped_array<int> buffer_sizes_;
36
37 const int buffer_count_;
38
39 int current_buffer_;
40 int current_buffer_offset_;
41 int position_;
42 int last_returned_size_;
43
44 DISALLOW_COPY_AND_ASSIGN(MultipleArrayInputStream);
45 };
46
47 } // namespace remoting
48
49 #endif // REMOTING_BASE_MULTIPLE_ARRAY_INPUT_STREAM_H_
OLDNEW
« no previous file with comments | « remoting/base/mock_objects.h ('k') | remoting/base/multiple_array_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698