| 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()) {
|
|
|