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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp

Issue 2724533003: Avoid conflict between 2 enums named Mode and 2 values named None. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
index b9bf2507e090c072b8fb49ffe5355d6d081a7238..e3ede9d365cdfedf540d197a81d34276e9be399b 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -398,7 +398,7 @@ String extractCharset(const String& value) {
return "";
}
-enum Mode {
+enum class MetaAttribute {
None,
Charset,
Pragma,
@@ -407,7 +407,7 @@ enum Mode {
WTF::TextEncoding encodingFromMetaAttributes(
const HTMLAttributeList& attributes) {
bool gotPragma = false;
- Mode mode = None;
+ MetaAttribute mode = MetaAttribute::None;
String charset;
for (const auto& htmlAttribute : attributes) {
@@ -420,16 +420,17 @@ WTF::TextEncoding encodingFromMetaAttributes(
} else if (charset.isEmpty()) {
if (threadSafeMatch(attributeName, charsetAttr)) {
charset = attributeValue;
- mode = Charset;
+ mode = MetaAttribute::Charset;
} else if (threadSafeMatch(attributeName, contentAttr)) {
charset = extractCharset(attributeValue);
if (charset.length())
- mode = Pragma;
+ mode = MetaAttribute::Pragma;
}
}
}
- if (mode == Charset || (mode == Pragma && gotPragma))
+ if (mode == MetaAttribute::Charset ||
+ (mode == MetaAttribute::Pragma && gotPragma))
return WTF::TextEncoding(stripLeadingAndTrailingHTMLSpaces(charset));
return WTF::TextEncoding();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698