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

Side by Side Diff: remoting/base/compressor_verbatim.cc

Issue 5382008: Refactor ZLib and Verbatim encoders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 10 years 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/compressor_verbatim.h ('k') | remoting/base/compressor_zlib.h » ('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) 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 #include "base/logging.h"
6 #include "remoting/base/compressor_verbatim.h"
7
8 namespace remoting {
9
10 CompressorVerbatim::CompressorVerbatim() {
11 }
12
13 CompressorVerbatim::~CompressorVerbatim() {
14 }
15
16 void CompressorVerbatim::Reset() {
17 }
18
19 bool CompressorVerbatim::Process(const uint8* input_data, int input_size,
20 uint8* output_data, int output_size,
21 CompressorFlush flush, int* consumed,
22 int* written) {
23 DCHECK_GT(output_size, 0);
24 int bytes_to_copy = std::min(input_size, output_size);
25 memcpy(output_data, input_data, bytes_to_copy);
26
27 // Since we're just a memcpy, consumed and written are the same.
28 *consumed = *written = bytes_to_copy;
29 return true;
30 }
31
32 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/compressor_verbatim.h ('k') | remoting/base/compressor_zlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698