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