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

Side by Side Diff: sky/engine/core/html/parser/HTMLDocumentParser.h

Issue 814173005: The Sky parser should yield before start tags (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 OwnPtr<CompactHTMLTokenStream> tokens; 79 OwnPtr<CompactHTMLTokenStream> tokens;
80 }; 80 };
81 void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>); 81 void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
82 82
83 // From DocumentParser: 83 // From DocumentParser:
84 void detach() override final; 84 void detach() override final;
85 void prepareToStopParsing() override final; 85 void prepareToStopParsing() override final;
86 void stopParsing() override final; 86 void stopParsing() override final;
87 bool isWaitingForScripts() const override final; 87 bool isWaitingForScripts() const override final;
88 bool isExecutingScript() const override final; 88 bool isExecutingScript() const override final;
89 void executeScriptsWaitingForResources() override final; 89 void resumeAfterWaitingForImports() override final;
90 90
91 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); } 91 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); }
92 92
93 private: 93 private:
94 HTMLDocumentParser(HTMLDocument&, bool reportErrors); 94 HTMLDocumentParser(HTMLDocument&, bool reportErrors);
95 95
96 HTMLTreeBuilder* treeBuilder() const { return m_treeBuilder.get(); } 96 HTMLTreeBuilder* treeBuilder() const { return m_treeBuilder.get(); }
97 97
98 bool hasInsertionPoint(); 98 bool hasInsertionPoint();
99 99
100 void startBackgroundParser();
101 void stopBackgroundParser(); 100 void stopBackgroundParser();
102 void validateSpeculations(PassOwnPtr<ParsedChunk> lastChunk);
103 void processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>); 101 void processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
104 void pumpPendingSpeculations(); 102 void pumpPendingSpeculations();
105 103
106 Document* contextForParsingSession(); 104 Document* contextForParsingSession();
107 105
108 void constructTreeFromHTMLToken(HTMLToken&); 106 void constructTreeFromHTMLToken(HTMLToken&);
109 void constructTreeFromCompactHTMLToken(const CompactHTMLToken&); 107 void constructTreeFromCompactHTMLToken(const CompactHTMLToken&);
110 108
111 void runScriptsForPausedTreeBuilder(); 109 void runScriptsForPausedTreeBuilder();
112 void resumeParsingAfterScriptExecution();
113 110
114 void attemptToEnd(); 111 void attemptToEnd();
115 void endIfDelayed(); 112 void endIfDelayed();
116 void end(); 113 void end();
117 114
118 bool isParsingFragment() const; 115 bool isParsingFragment() const;
119 bool isScheduledForResume() const; 116 bool isScheduledForResume() const;
120 bool inPumpSession() const { return m_pumpSessionNestingLevel > 0; } 117 bool inPumpSession() const { return m_pumpSessionNestingLevel > 0; }
121 bool shouldDelayEnd() const { return inPumpSession() || isWaitingForScripts( ) || isScheduledForResume() || isExecutingScript(); } 118 bool shouldDelayEnd() const { return inPumpSession() || isWaitingForScripts( ) || isScheduledForResume() || isExecutingScript(); }
122 119
(...skipping 12 matching lines...) Expand all
135 132
136 bool m_isFragment; 133 bool m_isFragment;
137 bool m_endWasDelayed; 134 bool m_endWasDelayed;
138 bool m_haveBackgroundParser; 135 bool m_haveBackgroundParser;
139 unsigned m_pumpSessionNestingLevel; 136 unsigned m_pumpSessionNestingLevel;
140 }; 137 };
141 138
142 } 139 }
143 140
144 #endif // SKY_ENGINE_CORE_HTML_PARSER_HTMLDOCUMENTPARSER_H_ 141 #endif // SKY_ENGINE_CORE_HTML_PARSER_HTMLDOCUMENTPARSER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/html/parser/BackgroundHTMLParser.cpp ('k') | sky/engine/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698