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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "net/base/bzip2_filter.h" | 6 #include "net/base/bzip2_filter.h" |
7 | 7 |
8 BZip2Filter::BZip2Filter() | 8 BZip2Filter::BZip2Filter(const FilterContext& filter_context) |
9 : decoding_status_(DECODING_UNINITIALIZED), | 9 : Filter(filter_context), |
| 10 decoding_status_(DECODING_UNINITIALIZED), |
10 bzip2_data_stream_(NULL) { | 11 bzip2_data_stream_(NULL) { |
11 } | 12 } |
12 | 13 |
13 BZip2Filter::~BZip2Filter() { | 14 BZip2Filter::~BZip2Filter() { |
14 if (bzip2_data_stream_.get() && | 15 if (bzip2_data_stream_.get() && |
15 decoding_status_ != DECODING_UNINITIALIZED) { | 16 decoding_status_ != DECODING_UNINITIALIZED) { |
16 BZ2_bzDecompressEnd(bzip2_data_stream_.get()); | 17 BZ2_bzDecompressEnd(bzip2_data_stream_.get()); |
17 } | 18 } |
18 } | 19 } |
19 | 20 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } else if (BZ_STREAM_END == ret) { | 90 } else if (BZ_STREAM_END == ret) { |
90 status = Filter::FILTER_DONE; | 91 status = Filter::FILTER_DONE; |
91 decoding_status_ = DECODING_DONE; | 92 decoding_status_ = DECODING_DONE; |
92 } else { | 93 } else { |
93 decoding_status_ = DECODING_ERROR; | 94 decoding_status_ = DECODING_ERROR; |
94 } | 95 } |
95 | 96 |
96 return status; | 97 return status; |
97 } | 98 } |
98 | 99 |
OLD | NEW |