Bug 184478 - Use more r-values in NetworkResourceLoader
Summary: Use more r-values in NetworkResourceLoader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-10 17:18 PDT by youenn fablet
Modified: 2018-04-11 09:57 PDT (History)
4 users (show)

See Also:


Attachments
Patch (12.35 KB, patch)
2018-04-10 17:41 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (12.36 KB, patch)
2018-04-10 17:44 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-04-10 17:18:38 PDT
Use more r-values in NetworkResourceLoader
Comment 1 youenn fablet 2018-04-10 17:41:10 PDT
Created attachment 337661 [details]
Patch
Comment 2 youenn fablet 2018-04-10 17:44:14 PDT
Created attachment 337662 [details]
Patch
Comment 3 Chris Dumez 2018-04-11 09:22:39 PDT
Comment on attachment 337662 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=337662&action=review

r=me with comment.

> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:178
> +    m_cache->retrieve(request, { m_parameters.webPageID, m_parameters.webFrameID }, [this, loader = WTFMove(loader), request = ResourceRequest { request }](auto entry) mutable {

This was already capturing by value, I do not understand why the explicit "= ResourceRequest { request }" would be needed.
Comment 4 youenn fablet 2018-04-11 09:28:55 PDT
Thanks for the review.

> This was already capturing by value, I do not understand why the explicit "=
> ResourceRequest { request }" would be needed.

I had a compilation error if not doing so.
I believe request is captured as a "const ResourceRequest" otherwise.
Comment 5 Chris Dumez 2018-04-11 09:30:03 PDT
(In reply to youenn fablet from comment #4)
> Thanks for the review.
> 
> > This was already capturing by value, I do not understand why the explicit "=
> > ResourceRequest { request }" would be needed.
> 
> I had a compilation error if not doing so.
> I believe request is captured as a "const ResourceRequest" otherwise.

And you sure you had the "mutable" at the time? Still seems odd.
Comment 6 WebKit Commit Bot 2018-04-11 09:56:43 PDT
Comment on attachment 337662 [details]
Patch

Clearing flags on attachment: 337662

Committed r230528: <https://trac.webkit.org/changeset/230528>
Comment 7 WebKit Commit Bot 2018-04-11 09:56:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-04-11 09:57:24 PDT
<rdar://problem/39350780>