Bug 94962 - Don't create a new ResourceRequest if delegate returns the same NSURLRequest we passed it
Summary: Don't create a new ResourceRequest if delegate returns the same NSURLRequest ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-08-24 11:32 PDT by Pratik Solanki
Modified: 2012-08-25 00:10 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.52 KB, patch)
2012-08-24 12:48 PDT, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (2.52 KB, patch)
2012-08-24 12:52 PDT, Pratik Solanki
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2012-08-24 11:32:28 PDT
WebFrameLoaderClient::dispatchWillSendRequest does

     if (implementations->willSendRequestFunc)
        request = (NSURLRequest *)CallResourceLoadDelegate(implementations->willSendRequestFunc, webView, @selector(webView:resource:willSendRequest:redirectResponse:fromDataS

request in this case is a ResourceRequest& that is passed in. This means we always create a new ResourceRequest. This can be wasteful in cases where the client decides to return us the exact same NSURLRequest without modifying it.
Comment 1 Pratik Solanki 2012-08-24 11:37:32 PDT
<rdar://problem/12163053>
Comment 2 Pratik Solanki 2012-08-24 12:48:06 PDT
Created attachment 160480 [details]
Patch
Comment 3 Pratik Solanki 2012-08-24 12:52:19 PDT
Created attachment 160482 [details]
Patch
Comment 4 Geoffrey Garen 2012-08-24 14:48:33 PDT
Comment on attachment 160482 [details]
Patch

r=me!
Comment 5 Pratik Solanki 2012-08-24 20:42:33 PDT
Committed r126678: <http://trac.webkit.org/changeset/126678>
Comment 6 Benjamin Poulain 2012-08-25 00:10:07 PDT
That's great!