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

Unified Diff: third_party/WebKit/Source/core/html/MediaDocument.cpp

Issue 1642283002: Deal with frame removal by content scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last nits 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/html/MediaDocument.cpp
diff --git a/third_party/WebKit/Source/core/html/MediaDocument.cpp b/third_party/WebKit/Source/core/html/MediaDocument.cpp
index 525d869dbb2ff380d5110f98d9e9b3d3e17ac593..3435ebd037dbe23c5481dda4aebc720cc748087e 100644
--- a/third_party/WebKit/Source/core/html/MediaDocument.cpp
+++ b/third_party/WebKit/Source/core/html/MediaDocument.cpp
@@ -75,8 +75,10 @@ void MediaDocumentParser::createDocumentStructure()
rootElement->insertedByParser();
document()->appendChild(rootElement);
- if (document()->frame())
- document()->frame()->loader().dispatchDocumentElementAvailable();
+ document()->frame()->loader().dispatchDocumentElementAvailable();
+ document()->frame()->loader().runScriptsAtDocumentElementAvailable();
+ if (isDetached())
+ return; // runScriptsAtDocumentElementAvailable can detach the frame.
RefPtrWillBeRawPtr<HTMLHeadElement> head = HTMLHeadElement::create(*document());
RefPtrWillBeRawPtr<HTMLMetaElement> meta = HTMLMetaElement::create(*document());
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageDocument.cpp ('k') | third_party/WebKit/Source/core/html/PluginDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698