| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 UMA_HISTOGRAM_PERCENTAGE("Sdch3.Network_Decode_Ratio_a", | 170 UMA_HISTOGRAM_PERCENTAGE("Sdch3.Network_Decode_Ratio_a", |
| 171 static_cast<int>( | 171 static_cast<int>( |
| 172 (filter_context_.GetByteReadCount() * 100) / output_bytes_)); | 172 (filter_context_.GetByteReadCount() * 100) / output_bytes_)); |
| 173 UMA_HISTOGRAM_COUNTS("Sdch3.Network_Decode_Bytes_VcdiffOut_a", | 173 UMA_HISTOGRAM_COUNTS("Sdch3.Network_Decode_Bytes_VcdiffOut_a", |
| 174 output_bytes_); | 174 output_bytes_); |
| 175 filter_context_.RecordPacketStats(FilterContext::SDCH_DECODE); | 175 filter_context_.RecordPacketStats(FilterContext::SDCH_DECODE); |
| 176 | 176 |
| 177 // Allow latency experiments to proceed. | 177 // Allow latency experiments to proceed. |
| 178 url_request_context_->sdch_manager()->SetAllowLatencyExperiment( | 178 url_request_context_->sdch_manager()->SetAllowLatencyExperiment( |
| 179 url_, true); | 179 url_, true); |
| 180 |
| 181 // Notify successful dictionary usage. |
| 182 url_request_context_->sdch_manager()->OnDictionaryUsed( |
| 183 dictionary_->server_hash()); |
| 184 |
| 180 return; | 185 return; |
| 181 } | 186 } |
| 182 case PASS_THROUGH: { | 187 case PASS_THROUGH: { |
| 183 filter_context_.RecordPacketStats(FilterContext::SDCH_PASSTHROUGH); | 188 filter_context_.RecordPacketStats(FilterContext::SDCH_PASSTHROUGH); |
| 184 return; | 189 return; |
| 185 } | 190 } |
| 186 case DECODING_UNINITIALIZED: { | 191 case DECODING_UNINITIALIZED: { |
| 187 LogSdchProblem(SDCH_UNINITIALIZED); | 192 LogSdchProblem(SDCH_UNINITIALIZED); |
| 188 return; | 193 return; |
| 189 } | 194 } |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 536 } |
| 532 | 537 |
| 533 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { | 538 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { |
| 534 SdchManager::SdchErrorRecovery(problem); | 539 SdchManager::SdchErrorRecovery(problem); |
| 535 filter_context_.GetNetLog().AddEvent( | 540 filter_context_.GetNetLog().AddEvent( |
| 536 NetLog::TYPE_SDCH_DECODING_ERROR, | 541 NetLog::TYPE_SDCH_DECODING_ERROR, |
| 537 base::Bind(&NetLogSdchResourceProblemCallback, problem)); | 542 base::Bind(&NetLogSdchResourceProblemCallback, problem)); |
| 538 } | 543 } |
| 539 | 544 |
| 540 } // namespace net | 545 } // namespace net |
| OLD | NEW |