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

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

Issue 2666993006: Enable ParseHTMLOnMainThread on TOT (Closed)
Patch Set: clean up virtual test suites Created 3 years, 10 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 std::unique_ptr<HTMLPreloadScanner> createPreloadScanner(); 226 std::unique_ptr<HTMLPreloadScanner> createPreloadScanner();
227 227
228 // Let the given HTMLPreloadScanner scan the input it has, and then preloads 228 // Let the given HTMLPreloadScanner scan the input it has, and then preloads
229 // resources using the resulting PreloadRequests and |m_preloader|. 229 // resources using the resulting PreloadRequests and |m_preloader|.
230 void scanAndPreload(HTMLPreloadScanner*); 230 void scanAndPreload(HTMLPreloadScanner*);
231 void fetchQueuedPreloads(); 231 void fetchQueuedPreloads();
232 232
233 void evaluateAndPreloadScriptForDocumentWrite(const String& source); 233 void evaluateAndPreloadScriptForDocumentWrite(const String& source);
234 234
235 // Temporary enum for the ParseHTMLOnMainThread experiment. This is used to
236 // annotate whether a given task should post a task or not on the main thread
237 // if the lookahead parser is living on the main thread.
238 enum LookaheadParserTaskSynchrony {
239 Synchronous,
240 Asynchronous,
241 };
242
243 // Setting |synchronyPolicy| to Synchronous will just call the function with
244 // the given parameters. Note, this method is completely temporary as we need
245 // to maintain both threading implementations until the ParseHTMLOnMainThread
246 // experiment finishes.
247 template <typename FunctionType, typename... Ps>
248 void postTaskToLookaheadParser(LookaheadParserTaskSynchrony synchronyPolicy,
249 FunctionType,
250 Ps&&... parameters);
251
252 HTMLToken& token() { return *m_token; } 235 HTMLToken& token() { return *m_token; }
253 236
254 HTMLParserOptions m_options; 237 HTMLParserOptions m_options;
255 HTMLInputStream m_input; 238 HTMLInputStream m_input;
256 RefPtr<HTMLParserReentryPermit> m_reentryPermit; 239 RefPtr<HTMLParserReentryPermit> m_reentryPermit;
257 240
258 std::unique_ptr<HTMLToken> m_token; 241 std::unique_ptr<HTMLToken> m_token;
259 std::unique_ptr<HTMLTokenizer> m_tokenizer; 242 std::unique_ptr<HTMLTokenizer> m_tokenizer;
260 Member<HTMLParserScriptRunner> m_scriptRunner; 243 Member<HTMLParserScriptRunner> m_scriptRunner;
261 Member<HTMLTreeBuilder> m_treeBuilder; 244 Member<HTMLTreeBuilder> m_treeBuilder;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 unsigned m_pumpSpeculationsSessionNestingLevel; 285 unsigned m_pumpSpeculationsSessionNestingLevel;
303 bool m_isParsingAtLineNumber; 286 bool m_isParsingAtLineNumber;
304 bool m_triedLoadingLinkHeaders; 287 bool m_triedLoadingLinkHeaders;
305 bool m_addedPendingStylesheetInBody; 288 bool m_addedPendingStylesheetInBody;
306 bool m_isWaitingForStylesheets; 289 bool m_isWaitingForStylesheets;
307 }; 290 };
308 291
309 } // namespace blink 292 } // namespace blink
310 293
311 #endif // HTMLDocumentParser_h 294 #endif // HTMLDocumentParser_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.json5 ('k') | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698