RESOLVED FIXED 181686
[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
https://bugs.webkit.org/show_bug.cgi?id=181686
Summary [Win] Use switch when converting from ResourceRequestCachePolicy to platform ...
Per Arne Vollan
Reported 2018-01-16 09:20:14 PST
The current implementation of toPlatformRequestCachePolicy is not correct for all cases.
Attachments
Patch (1.90 KB, patch)
2018-01-16 09:23 PST, Per Arne Vollan
no flags
Patch (4.08 KB, patch)
2018-01-16 13:06 PST, Per Arne Vollan
achristensen: review+
Patch (4.14 KB, patch)
2018-01-17 10:40 PST, Per Arne Vollan
commit-queue: commit-queue-
Patch (4.14 KB, patch)
2018-01-17 10:48 PST, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2018-01-16 09:23:08 PST
Brent Fulgham
Comment 2 2018-01-16 09:54:08 PST
Comment on attachment 331393 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331393&action=review Please add a better explanation of why this change is needed, and consider whether more things are needed in the switch statement. > Source/WebCore/ChangeLog:10 > + The current implementation of toPlatformRequestCachePolicy is not correct for all cases. I don't think this is clear enough. Is the issue that the casting operation is returning an incorrect kCFURL* constant? I think you should just say that. Did this stuff break after the Fetch API changes? > Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:202 > + return kCFURLRequestCachePolicyReloadIgnoringCache Do you need to do anything to support 'RefreshAnyCacheData'? It might be better to explicitly call out 'ReloadIgnoringCacheData, and DoNotUseAnyCache' before the 'default' just to show that they map to kCFURL*IgnoringCache.
Alex Christensen
Comment 3 2018-01-16 10:25:43 PST
Let's not have a default at all if possible.
Per Arne Vollan
Comment 4 2018-01-16 12:59:00 PST
(In reply to Brent Fulgham from comment #2) > Comment on attachment 331393 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=331393&action=review > > Please add a better explanation of why this change is needed, and consider > whether more things are needed in the switch statement. > > > Source/WebCore/ChangeLog:10 > > + The current implementation of toPlatformRequestCachePolicy is not correct for all cases. > > I don't think this is clear enough. Is the issue that the casting operation > is returning an incorrect kCFURL* constant? I think you should just say that. > > Did this stuff break after the Fetch API changes? > > > Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:202 > > + return kCFURLRequestCachePolicyReloadIgnoringCache > > Do you need to do anything to support 'RefreshAnyCacheData'? It might be > better to explicitly call out 'ReloadIgnoringCacheData, and > DoNotUseAnyCache' before the 'default' just to show that they map to > kCFURL*IgnoringCache. After looking into this more closely, it turns out that toPlatformRequestCachePolicy is actually implemented correctly as is. It is just not called in all places where it should. I will update the patch. Thanks for reviewing!
Per Arne Vollan
Comment 5 2018-01-16 13:06:31 PST
Alex Christensen
Comment 6 2018-01-17 10:10:48 PST
Comment on attachment 331420 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331420&action=review > Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:150 > + // To avoid MSVC warning: We usually put ASSERT_NOT_REACHED here instead of a comment. Some linux compilers also want such a final return statement.
Per Arne Vollan
Comment 7 2018-01-17 10:14:45 PST
(In reply to Alex Christensen from comment #6) > Comment on attachment 331420 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=331420&action=review > > > Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:150 > > + // To avoid MSVC warning: > > We usually put ASSERT_NOT_REACHED here instead of a comment. Some linux > compilers also want such a final return statement. Thanks for reviewing! I will update the patch before landing.
Per Arne Vollan
Comment 8 2018-01-17 10:40:18 PST
WebKit Commit Bot
Comment 9 2018-01-17 10:45:27 PST
Comment on attachment 331512 [details] Patch Rejecting attachment 331512 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 331512, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!. Full output: http://webkit-queues.webkit.org/results/6107978
Per Arne Vollan
Comment 10 2018-01-17 10:48:17 PST
WebKit Commit Bot
Comment 11 2018-01-17 11:35:25 PST
Comment on attachment 331517 [details] Patch Clearing flags on attachment: 331517 Committed r227077: <https://trac.webkit.org/changeset/227077>
Radar WebKit Bug Importer
Comment 12 2018-01-17 17:10:30 PST
Note You need to log in before you can comment on or make changes to this bug.