Bug 175524

Summary: Drop non-const getter for CachedResource::resourceRequest()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, dbates, japhet, sam, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2017-08-13 10:22:04 PDT
Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource after it has been cached. Exposing such a getter is therefore a footgun.
Comment 1 Chris Dumez 2017-08-13 10:23:48 PDT
Created attachment 318011 [details]
Patch
Comment 2 youenn fablet 2017-08-13 12:49:28 PDT
Comment on attachment 318011 [details]
Patch

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

> Source/WebCore/loader/LinkLoader.cpp:227
>      CachedResourceRequest linkRequest(WTFMove(resourceRequest), CachedResourceLoader::defaultCachedResourceOptions(), CachedResource::defaultPriorityForResourceType(type.value()));

Could probably be rewritten to CachedResourceRequest linkRequest(document.completeURL(href),...) or CachedResourceRequest linkRequest(ResourceRequest(document.completeURL(href),...) if we do not like creating implicitly requests from urls.
Comment 3 Chris Dumez 2017-08-13 13:26:16 PDT
Created attachment 318015 [details]
Patch
Comment 4 WebKit Commit Bot 2017-08-13 14:07:59 PDT
Comment on attachment 318015 [details]
Patch

Clearing flags on attachment: 318015

Committed r220632: <http://trac.webkit.org/changeset/220632>
Comment 5 WebKit Commit Bot 2017-08-13 14:08:01 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2017-08-13 14:08:34 PDT
<rdar://problem/33868034>