Changeset 264501 in webkit
- Timestamp:
- Jul 16, 2020, 11:39:08 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
dom/DocumentParser.cpp (modified) (2 diffs)
-
dom/DocumentParser.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r264499 r264501 1 2020-07-16 Rob Buis <rbuis@igalia.com> 2 3 Make DocumentParser.ParserState an enum class 4 https://bugs.webkit.org/show_bug.cgi?id=214416 5 6 Reviewed by Darin Adler. 7 8 Make DocumentParser.ParserState an enum class since it is more readable. 9 10 * dom/DocumentParser.cpp: 11 (WebCore::DocumentParser::DocumentParser): 12 (WebCore::DocumentParser::startParsing): 13 (WebCore::DocumentParser::prepareToStopParsing): 14 (WebCore::DocumentParser::stopParsing): 15 (WebCore::DocumentParser::detach): 16 * dom/DocumentParser.h: 17 (WebCore::DocumentParser::isParsing const): 18 (WebCore::DocumentParser::isStopping const): 19 (WebCore::DocumentParser::isStopped const): 20 (WebCore::DocumentParser::isDetached const): 21 (): Deleted. 22 1 23 2020-07-16 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 24 -
trunk/Source/WebCore/dom/DocumentParser.cpp
r244115 r264501 33 33 34 34 DocumentParser::DocumentParser(Document& document) 35 : m_state(Pars ingState)35 : m_state(ParserState::Parsing) 36 36 , m_documentWasLoadedAsPartOfNavigation(false) 37 37 , m_document(makeWeakPtr(document)) … … 49 49 void DocumentParser::startParsing() 50 50 { 51 m_state = Pars ingState;51 m_state = ParserState::Parsing; 52 52 } 53 53 54 54 void DocumentParser::prepareToStopParsing() 55 55 { 56 ASSERT(m_state == Pars ingState);57 m_state = StoppingState;56 ASSERT(m_state == ParserState::Parsing); 57 m_state = ParserState::Stopping; 58 58 } 59 59 60 60 void DocumentParser::stopParsing() 61 61 { 62 m_state = StoppedState;62 m_state = ParserState::Stopped; 63 63 } 64 64 65 65 void DocumentParser::detach() 66 66 { 67 m_state = DetachedState;67 m_state = ParserState::Detached; 68 68 m_document = nullptr; 69 69 } -
trunk/Source/WebCore/dom/DocumentParser.h
r246596 r264501 66 66 Document* document() const { ASSERT(m_document); return m_document.get(); } 67 67 68 bool isParsing() const { return m_state == Pars ingState; }69 bool isStopping() const { return m_state == StoppingState; }70 bool isStopped() const { return m_state >= StoppedState; }71 bool isDetached() const { return m_state == DetachedState; }68 bool isParsing() const { return m_state == ParserState::Parsing; } 69 bool isStopping() const { return m_state == ParserState::Stopping; } 70 bool isStopped() const { return m_state >= ParserState::Stopped; } 71 bool isDetached() const { return m_state == ParserState::Detached; } 72 72 73 73 // FIXME: Is this necessary? Does XMLDocumentParserLibxml2 really need to set this? … … 105 105 106 106 private: 107 enum ParserState{108 Parsing State,109 Stopping State,110 Stopped State,111 Detached State107 enum class ParserState : uint8_t { 108 Parsing, 109 Stopping, 110 Stopped, 111 Detached 112 112 }; 113 113 ParserState m_state;
Note:
See TracChangeset
for help on using the changeset viewer.