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

Unified Diff: Source/core/html/track/vtt/VTTRegion.cpp

Issue 104713002: Use the return value to signal success for VTTParser helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Re-add ASSERT in markFutureAndPastNodes. Created 7 years 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/VTTParser.cpp ('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/vtt/VTTRegion.cpp
diff --git a/Source/core/html/track/vtt/VTTRegion.cpp b/Source/core/html/track/vtt/VTTRegion.cpp
index f0109dbd62913f0d8bc2a91149111c981079b0ea..57b10ef63be89439c41c57ea41603fcc9024e72a 100644
--- a/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/Source/core/html/track/vtt/VTTRegion.cpp
@@ -235,25 +235,22 @@ void VTTRegion::parseSettingValue(RegionSetting setting, const String& value)
{
DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, ("up", AtomicString::ConstructFromLiteral));
- bool isValidSetting;
- String numberAsString;
- int number;
- FloatPoint anchorPosition;
-
switch (setting) {
case Id:
if (value.find("-->") == kNotFound)
m_id = value;
break;
- case Width:
- number = VTTParser::parseFloatPercentageValue(value, isValidSetting);
- if (isValidSetting)
- m_width = number;
+ case Width: {
+ float floatWidth;
+ if (VTTParser::parseFloatPercentageValue(value, floatWidth))
+ m_width = floatWidth;
else
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
break;
+ }
case Height: {
unsigned position = 0;
+ int number;
if (VTTParser::collectDigitsToInt(value, &position, number) && position == value.length())
m_heightInLines = number;
else
@@ -261,17 +258,11 @@ void VTTRegion::parseSettingValue(RegionSetting setting, const String& value)
break;
}
case RegionAnchor:
- anchorPosition = VTTParser::parseFloatPercentageValuePair(value, ',', isValidSetting);
- if (isValidSetting)
- m_regionAnchor = anchorPosition;
- else
+ if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor");
break;
case ViewportAnchor:
- anchorPosition = VTTParser::parseFloatPercentageValuePair(value, ',', isValidSetting);
- if (isValidSetting)
- m_viewportAnchor = anchorPosition;
- else
+ if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor");
break;
case Scroll:
« no previous file with comments | « Source/core/html/track/vtt/VTTParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698