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

Side by Side Diff: trunk/src/net/http/http_log_util.cc

Issue 474483002: Revert 289312 "Move StringToUpperASCII and LowerCaseEqualsASCII ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 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 #include "net/http/http_log_util.h" 5 #include "net/http/http_log_util.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "net/http/http_auth_challenge_tokenizer.h" 9 #include "net/http/http_auth_challenge_tokenizer.h"
10 #include "net/http/http_util.h" 10 #include "net/http/http_util.h"
(...skipping 23 matching lines...) Expand all
34 34
35 } // namespace 35 } // namespace
36 36
37 #if defined(SPDY_PROXY_AUTH_ORIGIN) 37 #if defined(SPDY_PROXY_AUTH_ORIGIN)
38 void ElideChromeProxyDirective(const std::string& header_value, 38 void ElideChromeProxyDirective(const std::string& header_value,
39 const std::string& directive, 39 const std::string& directive,
40 std::string::const_iterator* redact_begin, 40 std::string::const_iterator* redact_begin,
41 std::string::const_iterator* redact_end) { 41 std::string::const_iterator* redact_end) {
42 HttpUtil::ValuesIterator it(header_value.begin(), header_value.end(), ','); 42 HttpUtil::ValuesIterator it(header_value.begin(), header_value.end(), ',');
43 while (it.GetNext()) { 43 while (it.GetNext()) {
44 if (base::LowerCaseEqualsASCII(it.value_begin(), 44 if (LowerCaseEqualsASCII(it.value_begin(),
45 it.value_begin() + directive.size(), 45 it.value_begin() + directive.size(),
46 directive.c_str())) { 46 directive.c_str())) {
47 *redact_begin = it.value_begin(); 47 *redact_begin = it.value_begin();
48 *redact_end = it.value_end(); 48 *redact_end = it.value_end();
49 return; 49 return;
50 } 50 }
51 } 51 }
52 } 52 }
53 #endif 53 #endif
54 54
55 std::string ElideHeaderValueForNetLog(NetLog::LogLevel log_level, 55 std::string ElideHeaderValueForNetLog(NetLog::LogLevel log_level,
56 const std::string& header, 56 const std::string& header,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (redact_begin == redact_end) 91 if (redact_begin == redact_end)
92 return value; 92 return value;
93 93
94 return std::string(value.begin(), redact_begin) + 94 return std::string(value.begin(), redact_begin) +
95 base::StringPrintf("[%ld bytes were stripped]", 95 base::StringPrintf("[%ld bytes were stripped]",
96 static_cast<long>(redact_end - redact_begin)) + 96 static_cast<long>(redact_end - redact_begin)) +
97 std::string(redact_end, value.end()); 97 std::string(redact_end, value.end());
98 } 98 }
99 99
100 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/net/http/http_content_disposition.cc ('k') | trunk/src/net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698