OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_policy_delegate.h" | 5 #include "net/filter/sdch_policy_delegate.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/sdch_problem_codes.h" | 10 #include "net/base/sdch_problem_codes.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 int response_code, | 126 int response_code, |
127 const NetLogWithSource& net_log) | 127 const NetLogWithSource& net_log) |
128 : possible_pass_through_(possible_pass_through), | 128 : possible_pass_through_(possible_pass_through), |
129 job_(job), | 129 job_(job), |
130 mime_type_(mime_type), | 130 mime_type_(mime_type), |
131 url_(url), | 131 url_(url), |
132 is_cached_content_(is_cached_content), | 132 is_cached_content_(is_cached_content), |
133 sdch_manager_(sdch_manager), | 133 sdch_manager_(sdch_manager), |
134 dictionary_set_(std::move(dictionary_set)), | 134 dictionary_set_(std::move(dictionary_set)), |
135 response_code_(response_code), | 135 response_code_(response_code), |
136 net_log_(net_log) {} | 136 net_log_(net_log) { |
| 137 DCHECK(sdch_manager_); |
| 138 } |
137 | 139 |
138 SdchPolicyDelegate::~SdchPolicyDelegate() {} | 140 SdchPolicyDelegate::~SdchPolicyDelegate() {} |
139 | 141 |
140 // static | 142 // static |
141 void SdchPolicyDelegate::FixUpSdchContentEncodings( | 143 void SdchPolicyDelegate::FixUpSdchContentEncodings( |
142 const NetLogWithSource& net_log, | 144 const NetLogWithSource& net_log, |
143 const std::string& mime_type, | 145 const std::string& mime_type, |
144 SdchManager::DictionarySet* dictionary_set, | 146 SdchManager::DictionarySet* dictionary_set, |
145 std::vector<SourceStream::SourceType>* types) { | 147 std::vector<SourceStream::SourceType>* types) { |
146 if (!dictionary_set) { | 148 if (!dictionary_set) { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // correct content. | 445 // correct content. |
444 sdch_manager_->BlacklistDomain(url_, SDCH_META_REFRESH_RECOVERY); | 446 sdch_manager_->BlacklistDomain(url_, SDCH_META_REFRESH_RECOVERY); |
445 SdchManager::LogSdchProblem(net_log_, SDCH_META_REFRESH_RECOVERY); | 447 SdchManager::LogSdchProblem(net_log_, SDCH_META_REFRESH_RECOVERY); |
446 } | 448 } |
447 | 449 |
448 *replace_output = std::string(kRefreshHtml, strlen(kRefreshHtml)); | 450 *replace_output = std::string(kRefreshHtml, strlen(kRefreshHtml)); |
449 return REPLACE_OUTPUT; | 451 return REPLACE_OUTPUT; |
450 } | 452 } |
451 | 453 |
452 } // namespace net | 454 } // namespace net |
OLD | NEW |