Commit 40e35903 authored by sky@chromium.org's avatar sky@chromium.org

Fixes crash when swapping frames

m_documentLoader is null. Here's the trace:

html_viewer.mojo!blink::DocumentLoader::isCommittedButEmpty() Line 105
html_viewer.mojo!blink::FrameLoader::finishedParsing() Line 485
html_viewer.mojo!blink::FrameLoader::stopAllLoaders() Line 981
html_viewer.mojo!blink::LocalFrame::detach(blink::FrameDetachType type) Line 281
html_viewer.mojo!blink::WebFrame::swap(blink::WebFrame * frame) Line 114

BUG=521663
TEST=none
R=japhet@chromium.org

Review URL: https://codereview.chromium.org/1298643003

git-svn-id: svn://svn.chromium.org/blink/trunk@201027 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 854a1cec
......@@ -482,7 +482,7 @@ void FrameLoader::finishedParsing()
m_progressTracker->finishedParsing();
if (client())
client()->dispatchDidFinishDocumentLoad(m_documentLoader->isCommittedButEmpty());
client()->dispatchDidFinishDocumentLoad(m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
checkCompleted();
......@@ -1257,7 +1257,7 @@ void FrameLoader::processFragment(const KURL& url, LoadStartType loadStartType)
// If scroll position is restored from history fragment then we should not override it unless
// this is a same document reload.
bool shouldScrollToFragment = (loadStartType == NavigationWithinSameDocument && !isBackForwardLoadType(m_loadType))
|| !documentLoader()->initialScrollState().didRestoreFromHistory;
|| (documentLoader() && !documentLoader()->initialScrollState().didRestoreFromHistory);
view->processUrlFragment(url, shouldScrollToFragment ?
FrameView::UrlFragmentScroll : FrameView::UrlFragmentDontScroll);
......
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