OLD | NEW |
(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 |
OLD | NEW |