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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1657583002: Disallow scripting earlier in LocalFrame::detach(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments and move script forbidden scope. Created 4 years, 11 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/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index beae6dbebe2a6cf950ca2ac67241cdc2203e69cc..9d4064262a3aae427d5fd76f81870857786f393a 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -334,6 +334,10 @@ void LocalFrame::detach(FrameDetachType type)
m_loader.stopAllLoaders();
m_loader.detach();
document()->detach();
+ // This is the earliest that scripting can be disabled:
+ // - FrameLoader::detach() can fire XHR abort events
+ // - Document::detach()'s deferred widget updates can run script.
+ ScriptForbiddenScope forbidScript;
m_loader.clear();
if (!client())
return;
@@ -342,7 +346,6 @@ void LocalFrame::detach(FrameDetachType type)
// Notify ScriptController that the frame is closing, since its cleanup ends up calling
// back to FrameLoaderClient via WindowProxy.
script().clearForClose();
- ScriptForbiddenScope forbidScript;
setView(nullptr);
willDetachFrameHost();
InspectorInstrumentation::frameDetachedFromParent(this);
« 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