| 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> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "net/base/sdch_manager.h" | 15 #include "net/base/sdch_manager.h" |
| 16 #include "net/base/sdch_net_log_params.h" | 16 #include "net/base/sdch_net_log_params.h" |
| 17 #include "net/base/sdch_problem_codes.h" | 17 #include "net/base/sdch_problem_codes.h" |
| 18 #include "net/log/net_log_capture_mode.h" |
| 18 #include "net/log/net_log_event_type.h" | 19 #include "net/log/net_log_event_type.h" |
| 20 #include "net/log/net_log_with_source.h" |
| 19 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
| 20 #include "sdch/open-vcdiff/src/google/vcdecoder.h" | 22 #include "sdch/open-vcdiff/src/google/vcdecoder.h" |
| 21 | 23 |
| 22 namespace net { | 24 namespace net { |
| 23 | 25 |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 const size_t kServerIdLength = 9; // Dictionary hash plus null from server. | 28 const size_t kServerIdLength = 9; // Dictionary hash plus null from server. |
| 27 | 29 |
| 28 // Disambiguate various types of responses that trigger a meta-refresh, | 30 // Disambiguate various types of responses that trigger a meta-refresh, |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 562 } |
| 561 | 563 |
| 562 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { | 564 void SdchFilter::LogSdchProblem(SdchProblemCode problem) { |
| 563 SdchManager::SdchErrorRecovery(problem); | 565 SdchManager::SdchErrorRecovery(problem); |
| 564 filter_context_.GetNetLog().AddEvent( | 566 filter_context_.GetNetLog().AddEvent( |
| 565 NetLogEventType::SDCH_DECODING_ERROR, | 567 NetLogEventType::SDCH_DECODING_ERROR, |
| 566 base::Bind(&NetLogSdchResourceProblemCallback, problem)); | 568 base::Bind(&NetLogSdchResourceProblemCallback, problem)); |
| 567 } | 569 } |
| 568 | 570 |
| 569 } // namespace net | 571 } // namespace net |
| OLD | NEW |