Bug 208546

Summary: Drop WebsiteDataStore::processPools()'s ensureAPoolExists optional parameter and add a ensureProcessPools() method instead
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, ggaren, katherine_cheney, sam, simon.fraser, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=208610
Bug Depends on:    
Bug Blocks: 208541    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2020-03-03 16:35:03 PST
Make WebsiteDataStore::processPools() parameter mandatory to make it clear it may create a process pool. Otherwise, people call processPools() to iterate over existing process pools and do not realize that it actually creates a process pool.
Comment 1 Chris Dumez 2020-03-03 16:36:21 PST
Created attachment 392348 [details]
Patch
Comment 2 Sam Weinig 2020-03-03 18:58:46 PST
Comment on attachment 392348 [details]
Patch

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

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:304
> +    enum class EnsureHasProcessPool : bool { No, Yes };
> +    HashSet<RefPtr<WebProcessPool>> processPools(EnsureHasProcessPool, size_t limit = std::numeric_limits<size_t>::max()) const;

The idiom we often use for things like this is to have two functions:
1) ensureProcessPools()
2) existingProcessPools() or possibly just processPools().
Comment 3 Chris Dumez 2020-03-04 09:59:28 PST
Created attachment 392434 [details]
Patch
Comment 4 Chris Dumez 2020-03-04 10:10:01 PST
Created attachment 392436 [details]
Patch
Comment 5 Chris Dumez 2020-03-04 10:21:12 PST
Comment on attachment 392436 [details]
Patch

Clearing flags on attachment: 392436

Committed r257855: <https://trac.webkit.org/changeset/257855>
Comment 6 Chris Dumez 2020-03-04 10:21:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2020-03-04 10:22:18 PST
<rdar://problem/60045083>