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

Unified Diff: third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp

Issue 2682333002: Implement VTTCue.region and sync the VTTRegion interface (Closed)
Patch Set: Add DCHECK Created 3 years, 10 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: third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
index d8aec262ea7a555059957e83f72a38b0309e60c4..b8b751e80517f7e2cbfd837111b6511fac276ca3 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
@@ -111,6 +111,7 @@ void VTTParser::flush() {
m_lineReader.setEndOfStream();
parse();
flushPendingCue();
+ m_regionMap.clear();
}
void VTTParser::parse() {
@@ -376,7 +377,7 @@ void VTTParser::createNewCue() {
VTTCue* cue = VTTCue::create(*m_document, m_currentStartTime,
m_currentEndTime, m_currentContent.toString());
cue->setId(m_currentId);
- cue->parseSettings(m_currentSettings);
+ cue->parseSettings(&m_regionMap, m_currentSettings);
m_cueList.push_back(cue);
if (m_client)
@@ -410,6 +411,10 @@ void VTTParser::createNewRegion(const String& headerValue) {
// Step 12.5.11
m_regionList.push_back(region);
+
+ if (region->id().isEmpty())
+ return;
+ m_regionMap.set(region->id(), region);
}
bool VTTParser::collectTimeStamp(const String& line, double& timeStamp) {
@@ -577,6 +582,7 @@ DEFINE_TRACE(VTTParser) {
visitor->trace(m_document);
visitor->trace(m_client);
visitor->trace(m_cueList);
+ visitor->trace(m_regionMap);
visitor->trace(m_regionList);
}
« no previous file with comments | « third_party/WebKit/Source/core/html/track/vtt/VTTParser.h ('k') | third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698