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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 void* iter = NULL; 340 void* iter = NULL;
341 std::string name; 341 std::string name;
342 std::string value; 342 std::string value;
343 while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) { 343 while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) {
344 std::string name_lowercase(name); 344 std::string name_lowercase(name);
345 base::StringToLowerASCII(&name_lowercase); 345 base::StringToLowerASCII(&name_lowercase);
346 346
347 bool header_found = false; 347 bool header_found = false;
348 for (ResponseHeaders::const_iterator i = new_response_headers->begin(); 348 for (ResponseHeaders::const_iterator i = new_response_headers->begin();
349 i != new_response_headers->end(); ++i) { 349 i != new_response_headers->end(); ++i) {
350 if (LowerCaseEqualsASCII(i->first, name_lowercase.c_str()) && 350 if (base::LowerCaseEqualsASCII(i->first, name_lowercase.c_str()) &&
351 value == i->second) { 351 value == i->second) {
352 header_found = true; 352 header_found = true;
353 break; 353 break;
354 } 354 }
355 } 355 }
356 if (!header_found) 356 if (!header_found)
357 result->deleted_response_headers.push_back(ResponseHeader(name, value)); 357 result->deleted_response_headers.push_back(ResponseHeader(name, value));
358 } 358 }
359 } 359 }
360 360
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 return net::HttpUtil::IsToken(name); 1247 return net::HttpUtil::IsToken(name);
1248 } 1248 }
1249 1249
1250 bool IsValidHeaderValue(const std::string& value) { 1250 bool IsValidHeaderValue(const std::string& value) {
1251 // Just a sanity check: disallow NUL and CRLF. 1251 // Just a sanity check: disallow NUL and CRLF.
1252 return value.find('\0') == std::string::npos && 1252 return value.find('\0') == std::string::npos &&
1253 value.find("\r\n") == std::string::npos; 1253 value.find("\r\n") == std::string::npos;
1254 } 1254 }
1255 1255
1256 } // namespace extension_web_request_api_helpers 1256 } // namespace extension_web_request_api_helpers
OLDNEW
« no previous file with comments | « chrome/browser/download/download_extensions.cc ('k') | chrome/browser/history/visitsegment_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698