Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/filter.h" | 5 #include "net/base/filter.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/base/gzip_filter.h" | 9 #include "net/base/gzip_filter.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| 11 #include "net/base/mime_util.h" | 11 #include "net/base/mime_util.h" |
| 12 #include "net/base/sdch_filter.h" | 12 #include "net/base/sdch_filter.h" |
| 13 | 13 |
| 14 namespace net { | |
|
tfarina
2011/03/08 20:54:49
Please, could you move this to line 42?
adamk
2011/03/08 21:35:20
Done.
| |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 // Filter types (using canonical lower case only): | 17 // Filter types (using canonical lower case only): |
| 17 const char kDeflate[] = "deflate"; | 18 const char kDeflate[] = "deflate"; |
| 18 const char kGZip[] = "gzip"; | 19 const char kGZip[] = "gzip"; |
| 19 const char kXGZip[] = "x-gzip"; | 20 const char kXGZip[] = "x-gzip"; |
| 20 const char kSdch[] = "sdch"; | 21 const char kSdch[] = "sdch"; |
| 21 // compress and x-compress are currently not supported. If we decide to support | 22 // compress and x-compress are currently not supported. If we decide to support |
| 22 // them, we'll need the same mime type compatibility hack we have for gzip. For | 23 // them, we'll need the same mime type compatibility hack we have for gzip. For |
| 23 // more information, see Firefox's nsHttpChannel::ProcessNormal. | 24 // more information, see Firefox's nsHttpChannel::ProcessNormal. |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 stream_buffer_size_ = buffer_size; | 394 stream_buffer_size_ = buffer_size; |
| 394 } | 395 } |
| 395 | 396 |
| 396 void Filter::PushDataIntoNextFilter() { | 397 void Filter::PushDataIntoNextFilter() { |
| 397 net::IOBuffer* next_buffer = next_filter_->stream_buffer(); | 398 net::IOBuffer* next_buffer = next_filter_->stream_buffer(); |
| 398 int next_size = next_filter_->stream_buffer_size(); | 399 int next_size = next_filter_->stream_buffer_size(); |
| 399 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); | 400 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); |
| 400 if (FILTER_ERROR != last_status_) | 401 if (FILTER_ERROR != last_status_) |
| 401 next_filter_->FlushStreamBuffer(next_size); | 402 next_filter_->FlushStreamBuffer(next_size); |
| 402 } | 403 } |
| 404 | |
| 405 } // namespace net | |
| OLD | NEW |