Bug 224221

Summary: Shrink some IndexedDB-related classes
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: DOMAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, beidson, darin, ews-watchlist, ggaren, jsbell, sihui_liu, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Simon Fraser (smfr) 2021-04-05 21:00:25 PDT
Shrink some IndexedDB-related classes
Comment 1 Simon Fraser (smfr) 2021-04-05 21:02:44 PDT
Created attachment 425237 [details]
Patch
Comment 2 Geoffrey Garen 2021-04-06 12:18:01 PDT
Comment on attachment 425237 [details]
Patch

r=me

iOS-wk2 EWS failures seem unrelated
Comment 3 EWS 2021-04-06 13:43:06 PDT
Committed r275547: <https://commits.webkit.org/r275547>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425237 [details].
Comment 4 Radar WebKit Bug Importer 2021-04-06 13:44:17 PDT
<rdar://problem/76282457>
Comment 5 Darin Adler 2021-04-06 14:30:58 PDT
Comment on attachment 425237 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/IndexedDB.h:62
> +enum class VersionNullness : uint8_t {

Why not bool?

> Source/WebCore/Modules/indexeddb/IndexedDB.h:78
> +enum class ObjectStoreRecordType : uint8_t {

Why not bool?

> Source/WebCore/Modules/indexeddb/IndexedDB.h:101
> +enum class GetAllType : uint8_t {

Why not bool?
Comment 6 Simon Fraser (smfr) 2021-04-06 14:48:55 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 425237 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=425237&action=review
> 
> > Source/WebCore/Modules/indexeddb/IndexedDB.h:62
> > +enum class VersionNullness : uint8_t {
> 
> Why not bool?

Do we prefer bool over uint8_t? Both are common in the code. If so, we should put this in the coding guidelines and update the style checker.
Comment 7 Darin Adler 2021-04-06 14:55:08 PDT
(In reply to Simon Fraser (smfr) from comment #6)
> Do we prefer bool over uint8_t? Both are common in the code. If so, we
> should put this in the coding guidelines and update the style checker.

I certainly do for things that are obviously "Yes/No". And I prefer them for anything where there are only two states. But maybe we don’t have consensus.

Makes sense that both are common. Having no type at all is also common.