| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef HTMLDocumentParser_h | 26 #ifndef HTMLDocumentParser_h |
| 27 #define HTMLDocumentParser_h | 27 #define HTMLDocumentParser_h |
| 28 | 28 |
| 29 #include "base/memory/weak_ptr.h" | 29 #include "base/memory/weak_ptr.h" |
| 30 #include "core/dom/DocumentParser.h" | 30 #include "core/dom/DocumentParser.h" |
| 31 #include "core/fetch/ResourceClient.h" | 31 #include "core/fetch/ResourceClient.h" |
| 32 #include "core/frame/UseCounter.h" | 32 #include "core/frame/UseCounter.h" |
| 33 #include "core/html/parser/CompactHTMLToken.h" | 33 #include "core/html/parser/CompactHTMLToken.h" |
| 34 #include "core/html/parser/HTMLInputStream.h" | 34 #include "core/html/parser/HTMLInputStream.h" |
| 35 #include "core/html/parser/HTMLParserOptions.h" | |
| 36 #include "core/html/parser/HTMLScriptRunner.h" | 35 #include "core/html/parser/HTMLScriptRunner.h" |
| 37 #include "core/html/parser/HTMLToken.h" | 36 #include "core/html/parser/HTMLToken.h" |
| 38 #include "core/html/parser/HTMLTokenizer.h" | 37 #include "core/html/parser/HTMLTokenizer.h" |
| 39 #include "core/html/parser/TextResourceDecoder.h" | 38 #include "core/html/parser/TextResourceDecoder.h" |
| 40 #include "platform/text/SegmentedString.h" | 39 #include "platform/text/SegmentedString.h" |
| 41 #include "wtf/Deque.h" | 40 #include "wtf/Deque.h" |
| 42 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 43 #include "wtf/WeakPtr.h" | 42 #include "wtf/WeakPtr.h" |
| 44 #include "wtf/text/TextPosition.h" | 43 #include "wtf/text/TextPosition.h" |
| 45 | 44 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void constructTreeFromHTMLToken(HTMLToken&); | 110 void constructTreeFromHTMLToken(HTMLToken&); |
| 112 void constructTreeFromCompactHTMLToken(const CompactHTMLToken&); | 111 void constructTreeFromCompactHTMLToken(const CompactHTMLToken&); |
| 113 | 112 |
| 114 void runScriptsForPausedTreeBuilder(); | 113 void runScriptsForPausedTreeBuilder(); |
| 115 void resumeParsingAfterScriptExecution(); | 114 void resumeParsingAfterScriptExecution(); |
| 116 | 115 |
| 117 void attemptToEnd(); | 116 void attemptToEnd(); |
| 118 void endIfDelayed(); | 117 void endIfDelayed(); |
| 119 void end(); | 118 void end(); |
| 120 | 119 |
| 121 bool shouldUseThreading() const { return m_options.useThreading; } | |
| 122 | |
| 123 bool isParsingFragment() const; | 120 bool isParsingFragment() const; |
| 124 bool isScheduledForResume() const; | 121 bool isScheduledForResume() const; |
| 125 bool inPumpSession() const { return m_pumpSessionNestingLevel > 0; } | 122 bool inPumpSession() const { return m_pumpSessionNestingLevel > 0; } |
| 126 bool shouldDelayEnd() const { return inPumpSession() || isWaitingForScripts(
) || isScheduledForResume() || isExecutingScript(); } | 123 bool shouldDelayEnd() const { return inPumpSession() || isWaitingForScripts(
) || isScheduledForResume() || isExecutingScript(); } |
| 127 | 124 |
| 128 HTMLParserOptions m_options; | |
| 129 | |
| 130 OwnPtrWillBeMember<HTMLTreeBuilder> m_treeBuilder; | 125 OwnPtrWillBeMember<HTMLTreeBuilder> m_treeBuilder; |
| 131 OwnPtr<HTMLParserScheduler> m_parserScheduler; | 126 OwnPtr<HTMLParserScheduler> m_parserScheduler; |
| 132 TextPosition m_textPosition; | 127 TextPosition m_textPosition; |
| 133 | 128 |
| 134 HTMLScriptRunner m_scriptRunner; | 129 HTMLScriptRunner m_scriptRunner; |
| 135 | 130 |
| 136 OwnPtr<ParsedChunk> m_lastChunkBeforeScript; | 131 OwnPtr<ParsedChunk> m_lastChunkBeforeScript; |
| 137 Deque<OwnPtr<ParsedChunk> > m_speculations; | 132 Deque<OwnPtr<ParsedChunk> > m_speculations; |
| 138 WeakPtrFactory<HTMLDocumentParser> m_weakFactory; | 133 WeakPtrFactory<HTMLDocumentParser> m_weakFactory; |
| 139 base::WeakPtr<BackgroundHTMLParser> m_backgroundParser; | 134 base::WeakPtr<BackgroundHTMLParser> m_backgroundParser; |
| 140 | 135 |
| 141 bool m_isFragment; | 136 bool m_isFragment; |
| 142 bool m_endWasDelayed; | 137 bool m_endWasDelayed; |
| 143 bool m_haveBackgroundParser; | 138 bool m_haveBackgroundParser; |
| 144 unsigned m_pumpSessionNestingLevel; | 139 unsigned m_pumpSessionNestingLevel; |
| 145 }; | 140 }; |
| 146 | 141 |
| 147 } | 142 } |
| 148 | 143 |
| 149 #endif | 144 #endif |
| OLD | NEW |