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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 case RESPONSE_ENCODING_LIE: | 83 case RESPONSE_ENCODING_LIE: |
84 cause_string = "ENCODING_LIE"; | 84 cause_string = "ENCODING_LIE"; |
85 break; | 85 break; |
86 case RESPONSE_MAX: | 86 case RESPONSE_MAX: |
87 cause_string = "<Error: max enum value>"; | 87 cause_string = "<Error: max enum value>"; |
88 break; | 88 break; |
89 } | 89 } |
90 return cause_string; | 90 return cause_string; |
91 } | 91 } |
92 | 92 |
93 base::Value* NetLogSdchResponseCorruptionDetectionCallback( | 93 scoped_ptr<base::Value> NetLogSdchResponseCorruptionDetectionCallback( |
94 ResponseCorruptionDetectionCause cause, | 94 ResponseCorruptionDetectionCause cause, |
95 bool cached, | 95 bool cached, |
96 NetLogCaptureMode capture_mode) { | 96 NetLogCaptureMode capture_mode) { |
97 base::DictionaryValue* dict = new base::DictionaryValue(); | 97 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
98 dict->SetString("cause", ResponseCorruptionDetectionCauseToString(cause)); | 98 dict->SetString("cause", ResponseCorruptionDetectionCauseToString(cause)); |
99 dict->SetBoolean("cached", cached); | 99 dict->SetBoolean("cached", cached); |
100 return dict; | 100 return dict.Pass(); |
101 } | 101 } |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 SdchFilter::SdchFilter(FilterType type, const FilterContext& filter_context) | 105 SdchFilter::SdchFilter(FilterType type, const FilterContext& filter_context) |
106 : Filter(type), | 106 : Filter(type), |
107 filter_context_(filter_context), | 107 filter_context_(filter_context), |
108 decoding_status_(DECODING_UNINITIALIZED), | 108 decoding_status_(DECODING_UNINITIALIZED), |
109 dictionary_hash_(), | 109 dictionary_hash_(), |
110 dictionary_hash_is_plausible_(false), | 110 dictionary_hash_is_plausible_(false), |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 } | 560 } |
561 | 561 |
562 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { | 562 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { |
563 SdchManager::SdchErrorRecovery(problem); | 563 SdchManager::SdchErrorRecovery(problem); |
564 filter_context_.GetNetLog().AddEvent( | 564 filter_context_.GetNetLog().AddEvent( |
565 NetLog::TYPE_SDCH_DECODING_ERROR, | 565 NetLog::TYPE_SDCH_DECODING_ERROR, |
566 base::Bind(&NetLogSdchResourceProblemCallback, problem)); | 566 base::Bind(&NetLogSdchResourceProblemCallback, problem)); |
567 } | 567 } |
568 | 568 |
569 } // namespace net | 569 } // namespace net |
OLD | NEW |