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

Unified Diff: Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp

Issue 10391159: Merge 116556 - [chromium] Check whether an active document loader exists before accessing it (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (revision 117230)
+++ Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (working copy)
@@ -634,8 +634,14 @@
// didStopLoading only when loader is completed so that we don't fire
// them for fragment redirection that happens in window.onload handler.
// See https://bugs.webkit.org/show_bug.cgi?id=31838
- bool loaderCompleted =
- !webView->page()->mainFrame()->loader()->activeDocumentLoader()->isLoadingInAPISense();
+ //
+ // FIXME: Although FrameLoader::loadInSameDocument which invokes this
+ // method does not have a provisional document loader, we're seeing crashes
+ // where the FrameLoader is in provisional state, and thus
+ // activeDocumentLoader returns 0. Lacking any understanding of how this
+ // can happen, we do this check here to avoid crashing.
+ FrameLoader* loader = webView->page()->mainFrame()->loader();
+ bool loaderCompleted = !(loader->activeDocumentLoader() && loader->activeDocumentLoader()->isLoadingInAPISense());
// Generate didStartLoading if loader is completed.
if (webView->client() && loaderCompleted)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698