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

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

Issue 2137913002: Yield HTMLDocumentParser after executing parser blocking script Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: repeat10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 } 930 }
931 931
932 void HTMLDocumentParser::resumeParsingAfterScriptExecution() 932 void HTMLDocumentParser::resumeParsingAfterScriptExecution()
933 { 933 {
934 ASSERT(!isExecutingScript()); 934 ASSERT(!isExecutingScript());
935 ASSERT(!isWaitingForScripts()); 935 ASSERT(!isWaitingForScripts());
936 936
937 if (m_haveBackgroundParser) { 937 if (m_haveBackgroundParser) {
938 validateSpeculations(std::move(m_lastChunkBeforeScript)); 938 validateSpeculations(std::move(m_lastChunkBeforeScript));
939 ASSERT(!m_lastChunkBeforeScript); 939 ASSERT(!m_lastChunkBeforeScript);
940 pumpPendingSpeculations(); 940 if (true || RuntimeEnabledFeatures::yieldAfterScriptExecutionEnabled()) {
941 m_parserScheduler->scheduleForResume();
942 } else {
943 pumpPendingSpeculations();
944 }
941 return; 945 return;
942 } 946 }
943 947
944 m_insertionPreloadScanner.reset(); 948 m_insertionPreloadScanner.reset();
945 pumpTokenizerIfPossible(); 949 pumpTokenizerIfPossible();
946 endIfDelayed(); 950 endIfDelayed();
947 } 951 }
948 952
949 void HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan() 953 void HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan()
950 { 954 {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 (*closure)(); 1143 (*closure)();
1140 return; 1144 return;
1141 case Asynchronous: 1145 case Asynchronous:
1142 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, std::move(closure)); 1146 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, std::move(closure));
1143 return; 1147 return;
1144 } 1148 }
1145 NOTREACHED(); 1149 NOTREACHED();
1146 } 1150 }
1147 1151
1148 } // namespace blink 1152 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698