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

Unified Diff: Source/platform/ParsingUtilities.h

Issue 656063002: Subresource Integrity: Improve parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Feedback. Created 6 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 | « Source/core/frame/SubresourceIntegrityTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/ParsingUtilities.h
diff --git a/Source/platform/ParsingUtilities.h b/Source/platform/ParsingUtilities.h
index 882b800bf398e9e951aa39e1ff22bf40c48243ad..3ba75629a2d4d8437f62e4649c7c8d975117eeea 100644
--- a/Source/platform/ParsingUtilities.h
+++ b/Source/platform/ParsingUtilities.h
@@ -51,7 +51,24 @@ bool skipExactly(const CharType*& position, const CharType* end)
return false;
}
-template<typename CharType>
+template <typename CharType>
+bool skipToken(const CharType*& position, const CharType* end, const char* token)
+{
+ const CharType* current = position;
+ while (current < end && *token) {
+ if (*current != *token)
+ return false;
+ ++current;
+ ++token;
+ }
+ if (*token)
+ return false;
+
+ position = current;
+ return true;
+}
+
+template <typename CharType>
void skipUntil(const CharType*& position, const CharType* end, CharType delimiter)
{
while (position < end && *position != delimiter)
« no previous file with comments | « Source/core/frame/SubresourceIntegrityTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698