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

Unified Diff: net/http/http_util.cc

Issue 273072: Adding a Find method to the HeadersIterator class.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_util.h ('k') | net/http/http_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
===================================================================
--- net/http/http_util.cc (revision 29169)
+++ net/http/http_util.cc (working copy)
@@ -642,6 +642,20 @@
return false;
}
+bool HttpUtil::HeadersIterator::AdvanceTo(const char* name) {
+ DCHECK(name != NULL);
+ DCHECK_EQ(0, StringToLowerASCII<std::string>(name).compare(name))
+ << "the header name must be in all lower case";
+
+ while (GetNext()) {
+ if (LowerCaseEqualsASCII(name_begin_, name_end_, name)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
HttpUtil::ValuesIterator::ValuesIterator(
string::const_iterator values_begin,
string::const_iterator values_end,
« no previous file with comments | « net/http/http_util.h ('k') | net/http/http_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698