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

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

Issue 711753003: Pin dictionaries from being deleted while request is outstanding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd past SDCH net-internals CL (423813002) Created 6 years, 1 month 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
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // However, if it's not a supported mime type, then we will attempt to 231 // However, if it's not a supported mime type, then we will attempt to
232 // download it, and in that case, don't decompress .gz/.tgz files. 232 // download it, and in that case, don't decompress .gz/.tgz files.
233 if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) || 233 if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
234 LowerCaseEqualsASCII(extension, ".tgz")) && 234 LowerCaseEqualsASCII(extension, ".tgz")) &&
235 !IsSupportedMimeType(mime_type)) 235 !IsSupportedMimeType(mime_type))
236 encoding_types->clear(); 236 encoding_types->clear();
237 } 237 }
238 } 238 }
239 239
240 // If the request was for SDCH content, then we might need additional fixups. 240 // If the request was for SDCH content, then we might need additional fixups.
241 if (!filter_context.SdchResponseExpected()) { 241 if (!filter_context.SdchDictionariesAdvertised()) {
242 // It was not an SDCH request, so we'll just record stats. 242 // It was not an SDCH request, so we'll just record stats.
243 if (1 < encoding_types->size()) { 243 if (1 < encoding_types->size()) {
244 // Multiple filters were intended to only be used for SDCH (thus far!) 244 // Multiple filters were intended to only be used for SDCH (thus far!)
245 LogSdchProblem(filter_context, SDCH_MULTIENCODING_FOR_NON_SDCH_REQUEST); 245 LogSdchProblem(filter_context, SDCH_MULTIENCODING_FOR_NON_SDCH_REQUEST);
246 } 246 }
247 if ((1 == encoding_types->size()) && 247 if ((1 == encoding_types->size()) &&
248 (FILTER_TYPE_SDCH == encoding_types->front())) { 248 (FILTER_TYPE_SDCH == encoding_types->front())) {
249 LogSdchProblem(filter_context, 249 LogSdchProblem(filter_context,
250 SDCH_SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST); 250 SDCH_SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST);
251 } 251 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 void Filter::PushDataIntoNextFilter() { 425 void Filter::PushDataIntoNextFilter() {
426 IOBuffer* next_buffer = next_filter_->stream_buffer(); 426 IOBuffer* next_buffer = next_filter_->stream_buffer();
427 int next_size = next_filter_->stream_buffer_size(); 427 int next_size = next_filter_->stream_buffer_size();
428 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); 428 last_status_ = ReadFilteredData(next_buffer->data(), &next_size);
429 if (FILTER_ERROR != last_status_) 429 if (FILTER_ERROR != last_status_)
430 next_filter_->FlushStreamBuffer(next_size); 430 next_filter_->FlushStreamBuffer(next_size);
431 } 431 }
432 432
433 } // namespace net 433 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698