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

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

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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
« no previous file with comments | « net/base/net_util.cc ('k') | net/http/http_auth.cc » ('j') | 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 next_stream_data_ = stream_buffer()->data(); 177 next_stream_data_ = stream_buffer()->data();
178 stream_data_len_ = stream_data_len; 178 stream_data_len_ = stream_data_len;
179 last_status_ = FILTER_OK; 179 last_status_ = FILTER_OK;
180 return true; 180 return true;
181 } 181 }
182 182
183 // static 183 // static
184 Filter::FilterType Filter::ConvertEncodingToType( 184 Filter::FilterType Filter::ConvertEncodingToType(
185 const std::string& filter_type) { 185 const std::string& filter_type) {
186 FilterType type_id; 186 FilterType type_id;
187 if (LowerCaseEqualsASCII(filter_type, kDeflate)) { 187 if (base::LowerCaseEqualsASCII(filter_type, kDeflate)) {
188 type_id = FILTER_TYPE_DEFLATE; 188 type_id = FILTER_TYPE_DEFLATE;
189 } else if (LowerCaseEqualsASCII(filter_type, kGZip) || 189 } else if (base::LowerCaseEqualsASCII(filter_type, kGZip) ||
190 LowerCaseEqualsASCII(filter_type, kXGZip)) { 190 base::LowerCaseEqualsASCII(filter_type, kXGZip)) {
191 type_id = FILTER_TYPE_GZIP; 191 type_id = FILTER_TYPE_GZIP;
192 } else if (LowerCaseEqualsASCII(filter_type, kSdch)) { 192 } else if (base::LowerCaseEqualsASCII(filter_type, kSdch)) {
193 type_id = FILTER_TYPE_SDCH; 193 type_id = FILTER_TYPE_SDCH;
194 } else { 194 } else {
195 // Note we also consider "identity" and "uncompressed" UNSUPPORTED as 195 // Note we also consider "identity" and "uncompressed" UNSUPPORTED as
196 // filter should be disabled in such cases. 196 // filter should be disabled in such cases.
197 type_id = FILTER_TYPE_UNSUPPORTED; 197 type_id = FILTER_TYPE_UNSUPPORTED;
198 } 198 }
199 return type_id; 199 return type_id;
200 } 200 }
201 201
202 // static 202 // static
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 void Filter::PushDataIntoNextFilter() { 405 void Filter::PushDataIntoNextFilter() {
406 IOBuffer* next_buffer = next_filter_->stream_buffer(); 406 IOBuffer* next_buffer = next_filter_->stream_buffer();
407 int next_size = next_filter_->stream_buffer_size(); 407 int next_size = next_filter_->stream_buffer_size();
408 last_status_ = ReadFilteredData(next_buffer->data(), &next_size); 408 last_status_ = ReadFilteredData(next_buffer->data(), &next_size);
409 if (FILTER_ERROR != last_status_) 409 if (FILTER_ERROR != last_status_)
410 next_filter_->FlushStreamBuffer(next_size); 410 next_filter_->FlushStreamBuffer(next_size);
411 } 411 }
412 412
413 } // namespace net 413 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | net/http/http_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698