Bug 30379

Summary: Factor ResourceLoadNotifier out of FrameLoader
Product: WebKit Reporter: Adam Barth <abarth>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 29947    
Attachments:
Description Flags
Patch v1
none
Patch v1 darin: review+, commit-queue: commit-queue-

Description Adam Barth 2009-10-14 22:59:56 PDT
As discussed on webkit-dev.
Comment 1 Adam Barth 2009-10-14 23:01:36 PDT
Created attachment 41210 [details]
Patch v1
Comment 2 Adam Barth 2009-10-14 23:04:07 PDT
Created attachment 41211 [details]
Patch v1
Comment 3 Darin Adler 2009-10-15 09:23:51 PDT
Comment on attachment 41211 [details]
Patch v1

>  void FrameLoader::sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse& response, int length, const ResourceError& error)

I'm surprised you left this function in FrameLoader. Seems to me it belongs in ResourceLoadNotifier, although you might have to add a document loader argument.

> @@ -3526,11 +3487,11 @@ void FrameLoader::requestFromDelegate(ResourceRequest& request, unsigned long& i

This function also seems to belong in ResourceLoadNotifier. I didn't look closely at other functions outside the patch.

> +void ResourceLoadNotifier::assignIdentifierToInitialRequest(unsigned long identifier, const ResourceRequest& clientRequest)
> +{
> +    dispatchAssignIdentifierToInitialRequest(identifier, activeDocumentLoader(), clientRequest);
> +}

We may want to consider passing the document loader here instead of having the notifier get the active document loader.

> +void ResourceLoadNotifier::didReceiveResponse(ResourceLoader* loader, const ResourceResponse& r)
> +{
> +    activeDocumentLoader()->addResponse(r);
> +
> +    if (Page* page = m_frame->page())
> +        page->progress()->incrementProgress(loader->identifier(), r);
> +
> +    dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r);
> +}

Here too, and then we could eliminate the activeDocumentLoader() function.

r=me
Comment 4 Adam Barth 2009-10-15 22:05:38 PDT
Those are all good points.  If you don't mind, I'd like to handle them in a follow-up patch though.
Comment 5 WebKit Commit Bot 2009-10-15 22:20:13 PDT
Comment on attachment 41211 [details]
Patch v1

Rejecting patch 41211 from commit-queue.

Patch https://bugs.webkit.org/attachment.cgi?id=41211 from bug 30379 failed to download and apply.
Comment 6 Adam Barth 2009-10-15 22:32:34 PDT
Committed r49671: <http://trac.webkit.org/changeset/49671>
Comment 7 Sam Weinig 2009-10-15 23:03:10 PDT
Please note for the future, that the style guidelines where recently updated and the contents inside a namespace in a header should no longer be indented.
Comment 8 Adam Barth 2009-10-15 23:09:17 PDT
(In reply to comment #7)
> Please note for the future, that the style guidelines where recently updated
> and the contents inside a namespace in a header should no longer be indented.

Praise be to the style guide!