OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/filter/sdch_filter.h" | 5 #include "net/filter/sdch_filter.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <limits.h> | 8 #include <limits.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 bool cached, | 92 bool cached, |
93 NetLog::LogLevel log_level) { | 93 NetLog::LogLevel log_level) { |
94 base::DictionaryValue* dict = new base::DictionaryValue(); | 94 base::DictionaryValue* dict = new base::DictionaryValue(); |
95 dict->SetString("cause", ResponseCorruptionDetectionCauseToString(cause)); | 95 dict->SetString("cause", ResponseCorruptionDetectionCauseToString(cause)); |
96 dict->SetBoolean("cached", cached); | 96 dict->SetBoolean("cached", cached); |
97 return dict; | 97 return dict; |
98 } | 98 } |
99 | 99 |
100 } // namespace | 100 } // namespace |
101 | 101 |
102 SdchFilter::SdchFilter(const FilterContext& filter_context) | 102 SdchFilter::SdchFilter(FilterType type, const FilterContext& filter_context) |
103 : filter_context_(filter_context), | 103 : Filter(type), |
| 104 filter_context_(filter_context), |
104 decoding_status_(DECODING_UNINITIALIZED), | 105 decoding_status_(DECODING_UNINITIALIZED), |
105 dictionary_hash_(), | 106 dictionary_hash_(), |
106 dictionary_hash_is_plausible_(false), | 107 dictionary_hash_is_plausible_(false), |
107 dictionary_(NULL), | 108 dictionary_(NULL), |
108 url_request_context_(filter_context.GetURLRequestContext()), | 109 url_request_context_(filter_context.GetURLRequestContext()), |
109 dest_buffer_excess_(), | 110 dest_buffer_excess_(), |
110 dest_buffer_excess_index_(0), | 111 dest_buffer_excess_index_(0), |
111 source_bytes_(0), | 112 source_bytes_(0), |
112 output_bytes_(0), | 113 output_bytes_(0), |
113 possible_pass_through_(false) { | 114 possible_pass_through_(false) { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 500 } |
500 | 501 |
501 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { | 502 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { |
502 SdchManager::SdchErrorRecovery(problem); | 503 SdchManager::SdchErrorRecovery(problem); |
503 filter_context_.GetNetLog().AddEvent( | 504 filter_context_.GetNetLog().AddEvent( |
504 NetLog::TYPE_SDCH_DECODING_ERROR, | 505 NetLog::TYPE_SDCH_DECODING_ERROR, |
505 base::Bind(&NetLogSdchResourceProblemCallback, problem)); | 506 base::Bind(&NetLogSdchResourceProblemCallback, problem)); |
506 } | 507 } |
507 | 508 |
508 } // namespace net | 509 } // namespace net |
OLD | NEW |