Bug 208546 - Drop WebsiteDataStore::processPools()'s ensureAPoolExists optional parameter and add a ensureProcessPools() method instead
Summary: Drop WebsiteDataStore::processPools()'s ensureAPoolExists optional parameter ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 208541
  Show dependency treegraph
 
Reported: 2020-03-03 16:35 PST by Chris Dumez
Modified: 2020-03-04 16:13 PST (History)
8 users (show)

See Also:


Attachments
Patch (44.33 KB, patch)
2020-03-03 16:36 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (43.38 KB, patch)
2020-03-04 09:59 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (43.41 KB, patch)
2020-03-04 10:10 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>