Bug 234988 - Disable CFURLCache in WebKit2
Summary: Disable CFURLCache in WebKit2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-07 14:40 PST by Sihui Liu
Modified: 2022-01-21 17:02 PST (History)
8 users (show)

See Also:


Attachments
Patch (6.49 KB, patch)
2022-01-07 14:46 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (14.35 KB, patch)
2022-01-21 10:48 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (15.35 KB, patch)
2022-01-21 12:03 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (15.46 KB, patch)
2022-01-21 15:59 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2022-01-07 14:40:02 PST
...
Comment 1 Sihui Liu 2022-01-07 14:46:16 PST
Created attachment 448634 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2022-01-14 14:40:25 PST
<rdar://problem/87619196>
Comment 3 Sihui Liu 2022-01-21 10:48:46 PST
Created attachment 449670 [details]
Patch
Comment 4 Sihui Liu 2022-01-21 12:03:37 PST
Created attachment 449681 [details]
Patch
Comment 5 Geoffrey Garen 2022-01-21 14:57:44 PST
Comment on attachment 449681 [details]
Patch

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

r=me

I added some style comments.

> Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h:362
> +void _CFURLStorageSessionDisableCache(CFURLStorageSessionRef);

Can we make this declaration conditional on HAVE(CFNETWORK_DISABLE_CACHE_SPI)? That way you get an easier to understand compiler error, rather than a linker error, if you try to use this function when you shouldn't.

> Source/WebCore/platform/network/NetworkStorageSession.h:123
> +    enum class ShouldDisableURLCache : bool { No, Yes };

I would call this ShouldDisableCFURLCache, since we still enable the WebCore URL cache even when this is true.

> Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp:49
> +    bool isCacheDisabled = false;

Can we just use the shouldDisableURLCache parameter instead of tracking this boolean separately?

> Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:184
> +    bool isCacheDisabled = false;

Can we just use the shouldDisableURLCache parameter instead of tracking this boolean separately?
Comment 6 Sihui Liu 2022-01-21 15:08:19 PST
(In reply to Geoffrey Garen from comment #5)
> Comment on attachment 449681 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449681&action=review
> 
> r=me
> 
> I added some style comments.
> 
> > Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h:362
> > +void _CFURLStorageSessionDisableCache(CFURLStorageSessionRef);
> 
> Can we make this declaration conditional on
> HAVE(CFNETWORK_DISABLE_CACHE_SPI)? That way you get an easier to understand
> compiler error, rather than a linker error, if you try to use this function
> when you shouldn't.

Sure.

> 
> > Source/WebCore/platform/network/NetworkStorageSession.h:123
> > +    enum class ShouldDisableURLCache : bool { No, Yes };
> 
> I would call this ShouldDisableCFURLCache, since we still enable the WebCore
> URL cache even when this is true.

Sure, I didn't add 'CF' as it does not exist on other platforms. 

> > Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp:49
> > +    bool isCacheDisabled = false;
> 
> Can we just use the shouldDisableURLCache parameter instead of tracking this
> boolean separately?

Sure.

> 
> > Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:184
> > +    bool isCacheDisabled = false;
> 
> Can we just use the shouldDisableURLCache parameter instead of tracking this
> boolean separately?

Sure.
Comment 7 Sihui Liu 2022-01-21 15:59:23 PST
Created attachment 449707 [details]
Patch for landing
Comment 8 EWS 2022-01-21 17:02:23 PST
Committed r288389 (246286@main): <https://commits.webkit.org/246286@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449707 [details].