OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/base/sdch_filter.h" | 10 #include "net/base/sdch_filter.h" |
11 #include "net/base/sdch_manager.h" | 11 #include "net/base/sdch_manager.h" |
12 | 12 |
13 #include "google/vcdecoder.h" | 13 #include "sdch/open_vcdiff/depot/opensource/open-vcdiff/src/google/vcdecoder.h" |
14 | 14 |
15 SdchFilter::SdchFilter() | 15 SdchFilter::SdchFilter() |
16 : decoding_status_(DECODING_UNINITIALIZED), | 16 : decoding_status_(DECODING_UNINITIALIZED), |
17 vcdiff_streaming_decoder_(NULL), | 17 vcdiff_streaming_decoder_(NULL), |
18 dictionary_(NULL), | 18 dictionary_(NULL), |
19 dest_buffer_excess_(), | 19 dest_buffer_excess_(), |
20 dest_buffer_excess_index_(0), | 20 dest_buffer_excess_index_(0), |
21 source_bytes_(0), | 21 source_bytes_(0), |
22 output_bytes_(0) { | 22 output_bytes_(0) { |
23 } | 23 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 memcpy(dest_buffer, dest_buffer_excess_.data() + dest_buffer_excess_index_, | 161 memcpy(dest_buffer, dest_buffer_excess_.data() + dest_buffer_excess_index_, |
162 amount); | 162 amount); |
163 dest_buffer_excess_index_ += amount; | 163 dest_buffer_excess_index_ += amount; |
164 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) { | 164 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) { |
165 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_); | 165 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_); |
166 dest_buffer_excess_.clear(); | 166 dest_buffer_excess_.clear(); |
167 dest_buffer_excess_index_ = 0; | 167 dest_buffer_excess_index_ = 0; |
168 } | 168 } |
169 return amount; | 169 return amount; |
170 } | 170 } |
OLD | NEW |