Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: net/filter/filter.cc

Issue 877323009: Extracted media mime type checks from net/base/ into media/base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fixes #1 Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« net/base/mime_util.cc ('K') | « net/base/mime_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 LowerCaseEqualsASCII(extension, ".tgz") || 243 LowerCaseEqualsASCII(extension, ".tgz") ||
244 LowerCaseEqualsASCII(extension, ".svgz")) 244 LowerCaseEqualsASCII(extension, ".svgz"))
245 encoding_types->clear(); 245 encoding_types->clear();
246 } else { 246 } else {
247 // When the user does not explicitly ask to download a file, if we get a 247 // When the user does not explicitly ask to download a file, if we get a
248 // supported mime type, then we attempt to decompress in order to view it. 248 // supported mime type, then we attempt to decompress in order to view it.
249 // However, if it's not a supported mime type, then we will attempt to 249 // However, if it's not a supported mime type, then we will attempt to
250 // download it, and in that case, don't decompress .gz/.tgz files. 250 // download it, and in that case, don't decompress .gz/.tgz files.
251 if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) || 251 if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
252 LowerCaseEqualsASCII(extension, ".tgz")) && 252 LowerCaseEqualsASCII(extension, ".tgz")) &&
253 !IsSupportedMimeType(mime_type)) 253 !IsSupportedMimeType_deprecated(mime_type))
254 encoding_types->clear(); 254 encoding_types->clear();
255 } 255 }
256 } 256 }
257 257
258 // If the request was for SDCH content, then we might need additional fixups. 258 // If the request was for SDCH content, then we might need additional fixups.
259 if (!filter_context.SdchDictionariesAdvertised()) { 259 if (!filter_context.SdchDictionariesAdvertised()) {
260 // It was not an SDCH request, so we'll just record stats. 260 // It was not an SDCH request, so we'll just record stats.
261 if (1 < encoding_types->size()) { 261 if (1 < encoding_types->size()) {
262 // Multiple filters were intended to only be used for SDCH (thus far!) 262 // Multiple filters were intended to only be used for SDCH (thus far!)
263 LogSdchProblem(filter_context, SDCH_MULTIENCODING_FOR_NON_SDCH_REQUEST); 263 LogSdchProblem(filter_context, SDCH_MULTIENCODING_FOR_NON_SDCH_REQUEST);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 void Filter::PushDataIntoNextFilter() { 453 void Filter::PushDataIntoNextFilter() {
454 IOBuffer* next_buffer = next_filter_->stream_buffer(); 454 IOBuffer* next_buffer = next_filter_->stream_buffer();
455 int next_size = next_filter_->stream_buffer_size(); 455 int next_size = next_filter_->stream_buffer_size();
456 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); 456 last_status_ = ReadFilteredData(next_buffer->data(), &next_size);
457 if (FILTER_ERROR != last_status_) 457 if (FILTER_ERROR != last_status_)
458 next_filter_->FlushStreamBuffer(next_size); 458 next_filter_->FlushStreamBuffer(next_size);
459 } 459 }
460 460
461 } // namespace net 461 } // namespace net
OLDNEW
« net/base/mime_util.cc ('K') | « net/base/mime_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698