Bug 30379 - Factor ResourceLoadNotifier out of FrameLoader
Summary: Factor ResourceLoadNotifier out of FrameLoader
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: Nobody
URL:
Keywords:
Depends on:
Blocks: 29947
  Show dependency treegraph
 
Reported: 2009-10-14 22:59 PDT by Adam Barth
Modified: 2009-10-15 23:09 PDT (History)
1 user (show)

See Also:


Attachments
Patch v1 (40.99 KB, patch)
2009-10-14 23:01 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch v1 (38.13 KB, patch)
2009-10-14 23:04 PDT, Adam Barth
darin: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!