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

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

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

Powered by Google App Engine
This is Rietveld 408576698