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

Side by Side Diff: third_party/WebKit/Source/platform/network/HTTPParsers.cpp

Issue 2227903002: String::contains should use StringView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/AtomicString.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
5 * Copyright (C) 2009 Google Inc. All rights reserved. 5 * Copyright (C) 2009 Google Inc. All rights reserved.
6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 option = String(begin, length); 179 option = String(begin, length);
180 return position + 1; 180 return position + 1;
181 } 181 }
182 182
183 183
184 bool isValidHTTPHeaderValue(const String& name) 184 bool isValidHTTPHeaderValue(const String& name)
185 { 185 {
186 // FIXME: This should really match name against 186 // FIXME: This should really match name against
187 // field-value in section 4.2 of RFC 2616. 187 // field-value in section 4.2 of RFC 2616.
188 188
189 return name.containsOnlyLatin1() && !name.contains('\r') && !name.contains(' \n') && !name.contains(static_cast<UChar>('\0')); 189 return name.containsOnlyLatin1()
esprehn 2016/08/09 04:39:04 There's no reason to upcast to UChar here, we just
190 && !name.contains('\r')
191 && !name.contains('\n')
192 && !name.contains('\0');
190 } 193 }
191 194
192 // See RFC 7230, Section 3.2. 195 // See RFC 7230, Section 3.2.
193 // Checks whether |value| matches field-content in RFC 7230. 196 // Checks whether |value| matches field-content in RFC 7230.
194 // link: http://tools.ietf.org/html/rfc7230#section-3.2 197 // link: http://tools.ietf.org/html/rfc7230#section-3.2
195 bool isValidHTTPFieldContentRFC7230(const String& value) 198 bool isValidHTTPFieldContentRFC7230(const String& value)
196 { 199 {
197 if (value.isEmpty()) 200 if (value.isEmpty())
198 return false; 201 return false;
199 202
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (option == Suborigin::SuboriginPolicyOptions::None) 749 if (option == Suborigin::SuboriginPolicyOptions::None)
747 messages.append("Ignoring unknown suborigin policy option " + option Name + "."); 750 messages.append("Ignoring unknown suborigin policy option " + option Name + ".");
748 else 751 else
749 suborigin->addPolicyOption(option); 752 suborigin->addPolicyOption(option);
750 } 753 }
751 754
752 return true; 755 return true;
753 } 756 }
754 757
755 } // namespace blink 758 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/AtomicString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698