Bug 22349 - Loader::Host::didReceiveResponse doesn't clear the client for 304 redirects
Summary: Loader::Host::didReceiveResponse doesn't clear the client for 304 redirects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brett Wilson (Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-18 18:07 PST by Brett Wilson (Google)
Modified: 2008-11-19 12:46 PST (History)
0 users

See Also:


Attachments
Patch (1.27 KB, patch)
2008-11-19 08:22 PST, Brett Wilson (Google)
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Wilson (Google) 2008-11-18 18:07:12 PST
When Loader::Host::didReceiveResponse sees a 304 redirect, it magically removes the load from the list of pending loads, since the load is effectively complete (the cached version is good enough). This means the Host doesn't have a reference to the load that was a 304, but that load is still active.

Under CFNet, didFinishLoading is called immediately after the didReceiveResponse without going back to the message loop. At this time, the Host object (which is the client of the subresource load) is still active and it works OK.

Other platforms' network stack (and this might not even be guaranteed by CFNet) have different timing. On Chromium, our network stack sends the finished loading after you go back to the message loop. This gives a chance for the Host cleaner-uppper to run, which happens on a timer. This can lead to the Host getting deleted before the finished callback is run.

The Host should just clear out the callback when it gets a 304 so there isn't this inconsistent state.
Comment 1 Brett Wilson (Google) 2008-11-19 08:22:24 PST
Created attachment 25268 [details]
Patch

Patch as we discussed on IRC.
Comment 2 Antti Koivisto 2008-11-19 09:54:53 PST
r=me
Comment 3 Brett Wilson (Google) 2008-11-19 12:46:14 PST
Fixed in r38601