Commit 594e9909 authored by creis's avatar creis Committed by Commit bot

Don't crash after calling frame_->stopLoading().

It's possible for frame_ to be deleted after this call, so add null
checks after call sites.

BUG=639688, 639689
TEST=No more OnStop or NavigateInternal crashes in RenderFrameImpl.

Review-Url: https://codereview.chromium.org/2260383002
Cr-Commit-Position: refs/heads/master@{#413438}
parent 3d44ebe6
......@@ -4500,7 +4500,7 @@ void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) {
void RenderFrameImpl::OnStop() {
DCHECK(frame_);
frame_->stopLoading();
if (!frame_->parent())
if (frame_ && !frame_->parent())
FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, OnStop());
FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnStop());
......@@ -5657,7 +5657,7 @@ void RenderFrameImpl::NavigateInternal(
// send a stop message if the HistoryController is loading in this frame
// nonetheless. This behavior will go away with subframe navigation
// entries.
if (!frame_->isLoading() && !has_history_navigation_in_frame)
if (frame_ && !frame_->isLoading() && !has_history_navigation_in_frame)
Send(new FrameHostMsg_DidStopLoading(routing_id_));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment