Title: [264501] trunk/Source/WebCore
- Revision
- 264501
- Author
- [email protected]
- Date
- 2020-07-16 23:39:08 -0700 (Thu, 16 Jul 2020)
Log Message
Make DocumentParser.ParserState an enum class
https://bugs.webkit.org/show_bug.cgi?id=214416
Patch by Rob Buis <[email protected]> on 2020-07-16
Reviewed by Darin Adler.
Make DocumentParser.ParserState an enum class since it is more readable.
* dom/DocumentParser.cpp:
(WebCore::DocumentParser::DocumentParser):
(WebCore::DocumentParser::startParsing):
(WebCore::DocumentParser::prepareToStopParsing):
(WebCore::DocumentParser::stopParsing):
(WebCore::DocumentParser::detach):
* dom/DocumentParser.h:
(WebCore::DocumentParser::isParsing const):
(WebCore::DocumentParser::isStopping const):
(WebCore::DocumentParser::isStopped const):
(WebCore::DocumentParser::isDetached const):
(): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (264500 => 264501)
--- trunk/Source/WebCore/ChangeLog 2020-07-17 06:07:57 UTC (rev 264500)
+++ trunk/Source/WebCore/ChangeLog 2020-07-17 06:39:08 UTC (rev 264501)
@@ -1,3 +1,25 @@
+2020-07-16 Rob Buis <[email protected]>
+
+ Make DocumentParser.ParserState an enum class
+ https://bugs.webkit.org/show_bug.cgi?id=214416
+
+ Reviewed by Darin Adler.
+
+ Make DocumentParser.ParserState an enum class since it is more readable.
+
+ * dom/DocumentParser.cpp:
+ (WebCore::DocumentParser::DocumentParser):
+ (WebCore::DocumentParser::startParsing):
+ (WebCore::DocumentParser::prepareToStopParsing):
+ (WebCore::DocumentParser::stopParsing):
+ (WebCore::DocumentParser::detach):
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::isParsing const):
+ (WebCore::DocumentParser::isStopping const):
+ (WebCore::DocumentParser::isStopped const):
+ (WebCore::DocumentParser::isDetached const):
+ (): Deleted.
+
2020-07-16 Xabier Rodriguez Calvar <[email protected]>
Rename createBoxPtr into adoptBoxPtr
Modified: trunk/Source/WebCore/dom/DocumentParser.cpp (264500 => 264501)
--- trunk/Source/WebCore/dom/DocumentParser.cpp 2020-07-17 06:07:57 UTC (rev 264500)
+++ trunk/Source/WebCore/dom/DocumentParser.cpp 2020-07-17 06:39:08 UTC (rev 264501)
@@ -32,7 +32,7 @@
namespace WebCore {
DocumentParser::DocumentParser(Document& document)
- : m_state(ParsingState)
+ : m_state(ParserState::Parsing)
, m_documentWasLoadedAsPartOfNavigation(false)
, m_document(makeWeakPtr(document))
{
@@ -48,23 +48,23 @@
void DocumentParser::startParsing()
{
- m_state = ParsingState;
+ m_state = ParserState::Parsing;
}
void DocumentParser::prepareToStopParsing()
{
- ASSERT(m_state == ParsingState);
- m_state = StoppingState;
+ ASSERT(m_state == ParserState::Parsing);
+ m_state = ParserState::Stopping;
}
void DocumentParser::stopParsing()
{
- m_state = StoppedState;
+ m_state = ParserState::Stopped;
}
void DocumentParser::detach()
{
- m_state = DetachedState;
+ m_state = ParserState::Detached;
m_document = nullptr;
}
Modified: trunk/Source/WebCore/dom/DocumentParser.h (264500 => 264501)
--- trunk/Source/WebCore/dom/DocumentParser.h 2020-07-17 06:07:57 UTC (rev 264500)
+++ trunk/Source/WebCore/dom/DocumentParser.h 2020-07-17 06:39:08 UTC (rev 264501)
@@ -65,10 +65,10 @@
// document() will return 0 after detach() is called.
Document* document() const { ASSERT(m_document); return m_document.get(); }
- bool isParsing() const { return m_state == ParsingState; }
- bool isStopping() const { return m_state == StoppingState; }
- bool isStopped() const { return m_state >= StoppedState; }
- bool isDetached() const { return m_state == DetachedState; }
+ bool isParsing() const { return m_state == ParserState::Parsing; }
+ bool isStopping() const { return m_state == ParserState::Stopping; }
+ bool isStopped() const { return m_state >= ParserState::Stopped; }
+ bool isDetached() const { return m_state == ParserState::Detached; }
// FIXME: Is this necessary? Does XMLDocumentParserLibxml2 really need to set this?
virtual void startParsing();
@@ -104,11 +104,11 @@
explicit DocumentParser(Document&);
private:
- enum ParserState {
- ParsingState,
- StoppingState,
- StoppedState,
- DetachedState
+ enum class ParserState : uint8_t {
+ Parsing,
+ Stopping,
+ Stopped,
+ Detached
};
ParserState m_state;
bool m_documentWasLoadedAsPartOfNavigation;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes