[Webkit-unassigned] [Bug 109566] New: Invalid resource identifier in callbacks after a 304 response in the main resource
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Feb 12 04:50:02 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=109566
Summary: Invalid resource identifier in callbacks after a 304
response in the main resource
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Page Loading
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: cgarcia at igalia.com
CC: japhet at chromium.org
The problem is that when the clients are switched to revalidate the resource, the revalidated resource is set for the main resource loader and the loader of such result is NULL. This makes MainResourceLoader::identifier() to return 0. The sequence of events is something like this:
PROVISIONAL
assignIdentifierToInitialRequest: 2
dispatchDidReceiveResponse: 0
COMMITTED
dispatchDidFinishLoading: 0
FINISHED
dispatchDidReceiveResponse: 2
dispatchDidFinishLoading: 2
didReceiveContentLength is also called after the 304, which I think it's wrong.
This happens because in SubresourceLoader::didReceiveResponse(), when the response is a 304, MemoryCache::revalidationSucceeded() is called. That makes the clients to be switched and responseReceived() and dataReceived() are called in CachedRawResource::didAddClient() and notifyFinished() in CachedResource::didAddClient(). These callbacks are emitted with resource identifier = 0, because the current resource in main resource loader doesnt' have a loader. After this, SubresourceLoader::didReceiveResponse() continues and ResourceLoader::didReceiveResponse() is called with the valid resource identifier, but the frame load has been committed and finished already.
I think we shouldn't call responseReceived(), dataReceived() and notifyFinished() in case of 304 response or while switching clients, and committed and finished should be emitted after the resource callbacks.
This can be reproduced with http://renevier.net/misc/webkit_109225.php, see also bug https://bugs.webkit.org/show_bug.cgi?id=109287
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list