Bug 85892 - [chromium] Check whether an active document loader exists before accessing it
Summary: [chromium] Check whether an active document loader exists before accessing it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-08 09:56 PDT by jochen
Modified: 2012-05-09 14:17 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.84 KB, patch)
2012-05-08 09:57 PDT, jochen
no flags Details | Formatted Diff | Diff
Patch (2.51 KB, patch)
2012-05-09 12:07 PDT, jochen
no flags Details | Formatted Diff | Diff
Patch (2.51 KB, patch)
2012-05-09 12:49 PDT, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2012-05-08 09:56:14 PDT
[chromium] Check whether an active document loader exists before accessing it
Comment 1 jochen 2012-05-08 09:57:22 PDT
Created attachment 140732 [details]
Patch
Comment 2 Nate Chapin 2012-05-08 12:02:35 PDT
Comment on attachment 140732 [details]
Patch

Any chance of a layout test for this?
Comment 3 Eric Seidel (no email) 2012-05-08 15:38:59 PDT
Comment on attachment 140732 [details]
Patch

It seems like webView->page()->mainFrame()->loader() would be a useful local here. :)

Also, how do we test this?
Comment 4 jochen 2012-05-09 12:07:57 PDT
Created attachment 140992 [details]
Patch
Comment 5 jochen 2012-05-09 12:08:45 PDT
I tried to come up with a test but failed

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 NULL. Lacking any understanding of how this can happen, we do this check here to avoid crashing.
Comment 6 WebKit Review Bot 2012-05-09 12:11:42 PDT
Attachment 140992 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:642:  Use 0 or null instead of NULL (even in *comments*).  [readability/null] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 jochen 2012-05-09 12:49:21 PDT
Created attachment 140999 [details]
Patch
Comment 8 Eric Seidel (no email) 2012-05-09 13:19:04 PDT
Comment on attachment 140999 [details]
Patch

Thank you.  Sometimes we fight the loader and the loader wins.
Comment 9 WebKit Review Bot 2012-05-09 14:16:52 PDT
Comment on attachment 140999 [details]
Patch

Clearing flags on attachment: 140999

Committed r116556: <http://trac.webkit.org/changeset/116556>
Comment 10 WebKit Review Bot 2012-05-09 14:17:00 PDT
All reviewed patches have been landed.  Closing bug.