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

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

Issue 65343003: Make metadata state local in the WebVTT parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/WebVTTParser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/WebVTTParser.cpp
diff --git a/Source/core/html/track/WebVTTParser.cpp b/Source/core/html/track/WebVTTParser.cpp
index b3f0632def09785ca527886cc6e981a44ed51bf9..80915b00ad9eab7a53ba9d4a3b0016a7d3d262b1 100644
--- a/Source/core/html/track/WebVTTParser.cpp
+++ b/Source/core/html/track/WebVTTParser.cpp
@@ -247,13 +247,13 @@ void WebVTTParser::collectMetadataHeader(const String& line)
return;
unsigned colonPosition = line.find(":");
- m_currentHeaderName = line.substring(0, colonPosition);
+ String headerName = line.substring(0, colonPosition);
// 15.5 If metadata's name equals "Region":
- if (m_currentHeaderName == regionHeaderName) {
- m_currentHeaderValue = line.substring(colonPosition + 1, line.length() - 1);
+ if (headerName == regionHeaderName) {
+ String headerValue = line.substring(colonPosition + 1);
// 15.5.1 - 15.5.8 Region creation: Let region be a new text track region [...]
- createNewRegion();
+ createNewRegion(headerValue);
}
}
@@ -393,13 +393,13 @@ void WebVTTParser::resetCueValues()
m_currentContent.clear();
}
-void WebVTTParser::createNewRegion()
+void WebVTTParser::createNewRegion(const String& headerValue)
{
- if (!m_currentHeaderValue.length())
+ if (headerValue.isEmpty())
return;
RefPtr<VTTRegion> region = VTTRegion::create();
- region->setRegionSettings(m_currentHeaderValue);
+ region->setRegionSettings(headerValue);
// 15.5.10 If the text track list of regions regions contains a region
// with the same region identifier value as region, remove that region.
« no previous file with comments | « Source/core/html/track/WebVTTParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698