diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 22:46:00 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 22:46:00 +0000 |
commit | c3af26f3314bf48f478cec8128b5c15cc3f98940 (patch) | |
tree | 0d3d0802a3a9b8e05487626f90c7dbf0dcecdea9 /remoting/base/multiple_array_input_stream.h | |
parent | 5bcab699da1cedb4fc666c9f5d0099574a27c2fe (diff) | |
download | chromium_src-c3af26f3314bf48f478cec8128b5c15cc3f98940.zip chromium_src-c3af26f3314bf48f478cec8128b5c15cc3f98940.tar.gz chromium_src-c3af26f3314bf48f478cec8128b5c15cc3f98940.tar.bz2 |
Use new Chromotocol code in host andclient.
1. ProtocolDecoder renamed to MessagesDecoder and moved to remoting/protocol.
2. base/protocol_util.[h|cc] split into base/util.[h|cc] and protocol/util.[h|cc].
3. Added StreamReader and StreamWriter classes for events and video channels.
4. Client and host changed to use the new protocol code.
BUG=None
TEST=Unittests
Review URL: http://codereview.chromium.org/3595012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/multiple_array_input_stream.h')
-rw-r--r-- | remoting/base/multiple_array_input_stream.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/remoting/base/multiple_array_input_stream.h b/remoting/base/multiple_array_input_stream.h index a1b5f01..7747da5 100644 --- a/remoting/base/multiple_array_input_stream.h +++ b/remoting/base/multiple_array_input_stream.h @@ -5,8 +5,9 @@ #ifndef REMOTING_BASE_MULTIPLE_ARRAY_INPUT_STREAM_H_ #define REMOTING_BASE_MULTIPLE_ARRAY_INPUT_STREAM_H_ +#include <vector> + #include "base/basictypes.h" -#include "base/scoped_ptr.h" #include "google/protobuf/io/zero_copy_stream.h" namespace remoting { @@ -19,24 +20,23 @@ class MultipleArrayInputStream : // Construct a MultipleArrayInputStream with |count| backing arrays. // TODO(hclam): Consider adding block size to see if it has a performance // gain. - explicit MultipleArrayInputStream(int count); + MultipleArrayInputStream(); virtual ~MultipleArrayInputStream(); + // Add a new buffer to the list. + void AddBuffer(const char* buffer, int size); + + // google::protobuf::io::ZeroCopyInputStream interface. virtual bool Next(const void** data, int* size); virtual void BackUp(int count); virtual bool Skip(int count); virtual int64 ByteCount() const; - // Set the n-th buffer to be |buffer|. - void SetBuffer(int n, const uint8* buffer, int size); - private: - scoped_array<const uint8*> buffers_; - scoped_array<int> buffer_sizes_; - - const int buffer_count_; + std::vector<const char*> buffers_; + std::vector<int> buffer_sizes_; - int current_buffer_; + size_t current_buffer_; int current_buffer_offset_; int position_; int last_returned_size_; |