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

Unified Diff: Source/core/html/track/vtt/VTTScanner.h

Issue 137033002: Use VTTScanner for VTT region settings parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/html/track/vtt/VTTRegion.cpp ('k') | Source/core/html/track/vtt/VTTScannerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTScanner.h
diff --git a/Source/core/html/track/vtt/VTTScanner.h b/Source/core/html/track/vtt/VTTScanner.h
index 04300e192a69ff6c86d54d464ec3e552fedd1359..89d7e7d955e3878e4553e8e049e5c35495e1a8e9 100644
--- a/Source/core/html/track/vtt/VTTScanner.h
+++ b/Source/core/html/track/vtt/VTTScanner.h
@@ -91,6 +91,10 @@ public:
template<bool characterPredicate(UChar)>
void skipWhile();
+ // Like skipWhile, but using a negated predicate.
+ template<bool characterPredicate(UChar)>
+ void skipUntil();
+
// Return the run of characters for which the specified
// |characterPredicate| returns true. The start of the run will be the
// current input pointer.
@@ -166,6 +170,15 @@ inline void VTTScanner::skipWhile()
}
template<bool characterPredicate(UChar)>
+inline void VTTScanner::skipUntil()
+{
+ if (m_is8Bit)
+ ::skipUntil<LChar, LCharPredicateAdapter<characterPredicate> >(m_data.characters8, m_end.characters8);
+ else
+ ::skipUntil<UChar, characterPredicate>(m_data.characters16, m_end.characters16);
+}
+
+template<bool characterPredicate(UChar)>
inline VTTScanner::Run VTTScanner::collectWhile()
{
if (m_is8Bit) {
« no previous file with comments | « Source/core/html/track/vtt/VTTRegion.cpp ('k') | Source/core/html/track/vtt/VTTScannerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698