| 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 // The basic usage of the Filter interface is described in the comment at | 5 // The basic usage of the Filter interface is described in the comment at |
| 6 // the beginning of filter.h. If Filter::Factory is passed a vector of | 6 // the beginning of filter.h. If Filter::Factory is passed a vector of |
| 7 // size greater than 1, that interface is implemented by a series of filters | 7 // size greater than 1, that interface is implemented by a series of filters |
| 8 // connected in a chain. In such a case the first filter | 8 // connected in a chain. In such a case the first filter |
| 9 // in the chain proxies calls to ReadData() so that its return values | 9 // in the chain proxies calls to ReadData() so that its return values |
| 10 // apply to the entire chain. | 10 // apply to the entire chain. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "base/files/file_path.h" | 26 #include "base/files/file_path.h" |
| 27 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
| 28 #include "base/values.h" | 28 #include "base/values.h" |
| 29 #include "net/base/io_buffer.h" | 29 #include "net/base/io_buffer.h" |
| 30 #include "net/base/sdch_net_log_params.h" | 30 #include "net/base/sdch_net_log_params.h" |
| 31 #include "net/filter/brotli_filter.h" | 31 #include "net/filter/brotli_filter.h" |
| 32 #include "net/filter/gzip_filter.h" | 32 #include "net/filter/gzip_filter.h" |
| 33 #include "net/filter/sdch_filter.h" | 33 #include "net/filter/sdch_filter.h" |
| 34 #include "net/log/net_log_event_type.h" | 34 #include "net/log/net_log_event_type.h" |
| 35 #include "net/log/net_log_with_source.h" |
| 35 #include "net/url_request/url_request_context.h" | 36 #include "net/url_request/url_request_context.h" |
| 36 #include "url/gurl.h" | 37 #include "url/gurl.h" |
| 37 | 38 |
| 38 namespace net { | 39 namespace net { |
| 39 | 40 |
| 40 namespace { | 41 namespace { |
| 41 | 42 |
| 42 // Filter types (using canonical lower case only): | 43 // Filter types (using canonical lower case only): |
| 43 const char kBrotli[] = "br"; | 44 const char kBrotli[] = "br"; |
| 44 const char kDeflate[] = "deflate"; | 45 const char kDeflate[] = "deflate"; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 444 |
| 444 void Filter::PushDataIntoNextFilter() { | 445 void Filter::PushDataIntoNextFilter() { |
| 445 IOBuffer* next_buffer = next_filter_->stream_buffer(); | 446 IOBuffer* next_buffer = next_filter_->stream_buffer(); |
| 446 int next_size = next_filter_->stream_buffer_size(); | 447 int next_size = next_filter_->stream_buffer_size(); |
| 447 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); | 448 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); |
| 448 if (FILTER_ERROR != last_status_) | 449 if (FILTER_ERROR != last_status_) |
| 449 next_filter_->FlushStreamBuffer(next_size); | 450 next_filter_->FlushStreamBuffer(next_size); |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace net | 453 } // namespace net |
| OLD | NEW |