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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 1825873002: Deal with frame removal by content scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index c04ce6ba981bb5fbdd1c7c76256e19bd0460672b..8bcca75ce95ae37b496f2ea1143073e72fb172ee 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -83,6 +83,7 @@
#include "core/xml/parser/XMLDocumentParser.h"
#include "platform/Logging.h"
#include "platform/PluginScriptForbiddenScope.h"
+#include "platform/ScriptForbiddenScope.h"
#include "platform/UserGestureIndicator.h"
#include "platform/network/HTTPParsers.h"
#include "platform/network/ResourceRequest.h"
@@ -492,8 +493,13 @@ void FrameLoader::finishedParsing()
m_progressTracker->finishedParsing();
- if (client())
+ if (client()) {
+ ScriptForbiddenScope forbidScripts;
client()->dispatchDidFinishDocumentLoad(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
+ }
+
+ if (client())
+ client()->runScriptsAtDocumentReady();
checkCompleted();
@@ -1495,9 +1501,16 @@ bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const
void FrameLoader::dispatchDocumentElementAvailable()
{
+ ScriptForbiddenScope forbidScripts;
client()->documentElementAvailable();
}
+void FrameLoader::runScriptsAtDocumentElementAvailable()
+{
+ client()->runScriptsAtDocumentElementAvailable();
+ // The frame might be detached at this point.
+}
+
void FrameLoader::dispatchDidClearDocumentOfWindowObject()
{
if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | third_party/WebKit/Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698