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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h

Issue 2134323002: Remove threading primitives from ParseHTMLOnMainThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on 405128 Created 4 years, 5 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void evaluateAndPreloadScriptForDocumentWrite(const String& source); 182 void evaluateAndPreloadScriptForDocumentWrite(const String& source);
183 183
184 // Temporary enum for the ParseHTMLOnMainThread experiment. This is used to 184 // Temporary enum for the ParseHTMLOnMainThread experiment. This is used to
185 // annotate whether a given task should post a task or not on the main 185 // annotate whether a given task should post a task or not on the main
186 // thread if the lookahead parser is living on the main thread. 186 // thread if the lookahead parser is living on the main thread.
187 enum LookaheadParserTaskSynchrony { 187 enum LookaheadParserTaskSynchrony {
188 Synchronous, 188 Synchronous,
189 Asynchronous, 189 Asynchronous,
190 }; 190 };
191 191
192 // Setting |sync| to true will just call the closure. Note, this method is 192 // Setting |synchronyPolicy| to Synchronous will just call the function
193 // completely temporary as we need to maintain both threading 193 // with the given parameters. Note, this method is completely temporary
194 // implementations until the ParseHTMLOnMainThread experiment finishes. 194 // as we need to maintain both threading implementations until the
195 void postTaskToLookaheadParser(std::unique_ptr<CrossThreadClosure>, Lookahea dParserTaskSynchrony = Asynchronous); 195 // ParseHTMLOnMainThread experiment finishes.
196 template <typename FunctionType, typename... Ps>
197 void postTaskToLookaheadParser(LookaheadParserTaskSynchrony synchronyPolicy, FunctionType, Ps&&... parameters);
196 198
197 HTMLToken& token() { return *m_token; } 199 HTMLToken& token() { return *m_token; }
198 200
199 HTMLParserOptions m_options; 201 HTMLParserOptions m_options;
200 HTMLInputStream m_input; 202 HTMLInputStream m_input;
201 203
202 std::unique_ptr<HTMLToken> m_token; 204 std::unique_ptr<HTMLToken> m_token;
203 std::unique_ptr<HTMLTokenizer> m_tokenizer; 205 std::unique_ptr<HTMLTokenizer> m_tokenizer;
204 Member<HTMLScriptRunner> m_scriptRunner; 206 Member<HTMLScriptRunner> m_scriptRunner;
205 Member<HTMLTreeBuilder> m_treeBuilder; 207 Member<HTMLTreeBuilder> m_treeBuilder;
(...skipping 24 matching lines...) Expand all
230 bool m_tasksWereSuspended; 232 bool m_tasksWereSuspended;
231 unsigned m_pumpSessionNestingLevel; 233 unsigned m_pumpSessionNestingLevel;
232 unsigned m_pumpSpeculationsSessionNestingLevel; 234 unsigned m_pumpSpeculationsSessionNestingLevel;
233 bool m_isParsingAtLineNumber; 235 bool m_isParsingAtLineNumber;
234 bool m_triedLoadingLinkHeaders; 236 bool m_triedLoadingLinkHeaders;
235 }; 237 };
236 238
237 } // namespace blink 239 } // namespace blink
238 240
239 #endif 241 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698