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

Unified Diff: Source/core/html/track/WebVTTParser.h

Issue 54203003: Use TextResourceDecoder for the WebVTTParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
Index: Source/core/html/track/WebVTTParser.h
diff --git a/Source/core/html/track/WebVTTParser.h b/Source/core/html/track/WebVTTParser.h
index 60e098e0eeded7e4fc093d0c38f41966d290e89c..a8ca811b168e2fc509313b97f0d519b03017c520 100644
--- a/Source/core/html/track/WebVTTParser.h
+++ b/Source/core/html/track/WebVTTParser.h
@@ -34,6 +34,7 @@
#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "core/dom/DocumentFragment.h"
+#include "core/fetch/TextResourceDecoder.h"
#include "core/html/track/TextTrackCue.h"
#include "core/html/track/TextTrackRegion.h"
#include "core/html/track/WebVTTTokenizer.h"
@@ -114,10 +115,10 @@ private:
Document* m_document;
ParseState m_state;
- bool hasRequiredFileIdentifier();
+ bool hasRequiredFileIdentifier(const String& line);
ParseState collectCueId(const String&);
ParseState collectTimingsAndSettings(const String&);
- ParseState collectCueText(const String&, unsigned length, unsigned);
+ ParseState collectCueText(const String&, bool);
ParseState ignoreBadCue(const String&);
void createNewCue();
@@ -127,15 +128,15 @@ private:
void createNewRegion();
void skipWhiteSpace(const String&, unsigned*);
- static void skipLineTerminator(const char* data, unsigned length, unsigned*);
- static String collectNextLine(const char* data, unsigned length, unsigned*);
+ static void skipLineTerminator(const String& data, unsigned*);
+ static String collectNextLine(const String& data, unsigned*);
void constructTreeFromToken(Document&);
String m_currentHeaderName;
String m_currentHeaderValue;
- Vector<char> m_identifierData;
+ RefPtr<TextResourceDecoder> m_decoder;
String m_currentId;
double m_currentStartTime;
double m_currentEndTime;
« no previous file with comments | « LayoutTests/media/track/opera/track/webvtt/parsing/001-expected.txt ('k') | Source/core/html/track/WebVTTParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698