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

Unified Diff: content/renderer/render_frame_impl.cc

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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 15debe08d42f079668b8ce8611a0b4961d34cff4..d45121027c0caa3e171758cca6ff9439c8b2aefb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3317,6 +3317,23 @@ void RenderFrameImpl::didCreateDocumentElement(blink::WebLocalFrame* frame) {
DidCreateDocumentElement(frame));
}
+void RenderFrameImpl::runScriptsAtDocumentElementAvailable(
+ blink::WebLocalFrame* frame) {
+ DCHECK(!frame_ || frame_ == frame);
+ base::WeakPtr<RenderFrameImpl> weak_self = weak_factory_.GetWeakPtr();
+
+ MojoBindingsController* mojo_bindings_controller =
+ MojoBindingsController::Get(this);
+ if (mojo_bindings_controller)
+ mojo_bindings_controller->RunScriptsAtDocumentStart();
+
+ if (!weak_self.get())
+ return;
+
+ GetContentClient()->renderer()->RunScriptsAtDocumentStart(this);
+ // Do not use |this| or |frame|! ContentClient might have deleted them by now!
+}
+
void RenderFrameImpl::didReceiveTitle(blink::WebLocalFrame* frame,
const blink::WebString& title,
blink::WebTextDirection direction) {
@@ -3392,6 +3409,21 @@ void RenderFrameImpl::didFinishDocumentLoad(blink::WebLocalFrame* frame,
}
}
+void RenderFrameImpl::runScriptsAtDocumentReady(blink::WebLocalFrame* frame) {
+ base::WeakPtr<RenderFrameImpl> weak_self = weak_factory_.GetWeakPtr();
+
+ MojoBindingsController* mojo_bindings_controller =
+ MojoBindingsController::Get(this);
+ if (mojo_bindings_controller)
+ mojo_bindings_controller->RunScriptsAtDocumentReady();
+
+ if (!weak_self.get())
+ return;
+
+ GetContentClient()->renderer()->RunScriptsAtDocumentEnd(this);
+ // Do not use |this| or |frame|! ContentClient might have deleted them by now!
+}
+
void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
DCHECK_EQ(frame_, frame);
if (!frame->parent()) {
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698