| 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/filter.h" | 5 #include "net/filter/filter.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "net/base/filename_util.h" |
| 9 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| 10 #include "net/base/mime_util.h" | 11 #include "net/base/mime_util.h" |
| 11 #include "net/base/net_util.h" | |
| 12 #include "net/filter/gzip_filter.h" | 12 #include "net/filter/gzip_filter.h" |
| 13 #include "net/filter/sdch_filter.h" | 13 #include "net/filter/sdch_filter.h" |
| 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 // Filter types (using canonical lower case only): | 18 // Filter types (using canonical lower case only): |
| 18 const char kDeflate[] = "deflate"; | 19 const char kDeflate[] = "deflate"; |
| 19 const char kGZip[] = "gzip"; | 20 const char kGZip[] = "gzip"; |
| 20 const char kXGZip[] = "x-gzip"; | 21 const char kXGZip[] = "x-gzip"; |
| 21 const char kSdch[] = "sdch"; | 22 const char kSdch[] = "sdch"; |
| 22 // compress and x-compress are currently not supported. If we decide to support | 23 // compress and x-compress are currently not supported. If we decide to support |
| 23 // them, we'll need the same mime type compatibility hack we have for gzip. For | 24 // them, we'll need the same mime type compatibility hack we have for gzip. For |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 399 |
| 399 void Filter::PushDataIntoNextFilter() { | 400 void Filter::PushDataIntoNextFilter() { |
| 400 IOBuffer* next_buffer = next_filter_->stream_buffer(); | 401 IOBuffer* next_buffer = next_filter_->stream_buffer(); |
| 401 int next_size = next_filter_->stream_buffer_size(); | 402 int next_size = next_filter_->stream_buffer_size(); |
| 402 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); | 403 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); |
| 403 if (FILTER_ERROR != last_status_) | 404 if (FILTER_ERROR != last_status_) |
| 404 next_filter_->FlushStreamBuffer(next_size); | 405 next_filter_->FlushStreamBuffer(next_size); |
| 405 } | 406 } |
| 406 | 407 |
| 407 } // namespace net | 408 } // namespace net |
| OLD | NEW |