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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2845313002: Abort and reschedule if script is not ready during execution time (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 31c1d938deca8f883f86d70c94fe50df1e4631cb..1207c89de1e01ecc11acbb99eb6b712cff922476 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -890,6 +890,15 @@ void ScriptLoader::Execute() {
DCHECK(!will_be_parser_executed_);
DCHECK(async_exec_type_ != ScriptRunner::kNone);
DCHECK(pending_script_->IsExternal());
+
+ // If revalidation occurs after the script is scheduled for execution,
+ // the script may not be ready at this point.
+ // Abort execution and reschedule when the script is ready again.
+ if (!pending_script_->IsReady()) {
+ pending_script_->WatchForLoad(this);
+ return;
+ }
+
bool error_occurred = false;
Script* script = pending_script_->GetSource(KURL(), error_occurred);
const bool wasCanceled = pending_script_->WasCanceled();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698