Bug 231489

Summary: [Build-time perf] Forward-declare more things in Document.h
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, annulen, apinheiro, berto, calvaris, cdumez, cfleizach, cgarcia, changseok, cmarcelo, dmazzoni, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gustavo, gyuyoung.kim, hi, hta, japhet, jcraig, jdiggs, joepeck, kangil.han, kondapallykalyan, macpherson, menard, mifenton, mkwst, mmaxfield, pangle, pdr, philipj, pnormand, ryuan.choi, samuel_white, sergio, tetsuharu.ohzeki, tommyw, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing
ews-feeder: commit-queue-
Patch for landing
none
Patch for landing none

Description Jer Noble 2021-10-10 11:25:37 PDT
[Build-time perf] Forward-declare more things in Document.h
Comment 1 Jer Noble 2021-10-11 11:15:03 PDT
Created attachment 440809 [details]
Patch
Comment 2 Jer Noble 2021-10-11 12:40:40 PDT
Created attachment 440822 [details]
Patch
Comment 3 EWS Watchlist 2021-10-11 16:36:18 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Jer Noble 2021-10-11 22:26:53 PDT
Created attachment 440891 [details]
Patch
Comment 5 Myles C. Maxfield 2021-10-11 22:50:40 PDT
Comment on attachment 440891 [details]
Patch

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

Please make EWS green before landing.

> Source/WebCore/dom/Node.cpp:2296
> -                result.iterator->value |= deliveryOptions;
> +                result.iterator->value.add(deliveryOptions);

Why? (there are other similar things in this patch, too)

> Source/WebCore/page/MediaProducer.h:34
> +enum class MediaProducerMediaState : uint32_t {

Is there really no better name than this?

> Source/WebCore/page/MediaProducer.h:59
> +enum class MediaProducerMediaCaptureKind : uint8_t {

And this
Comment 6 Jer Noble 2021-10-11 22:57:40 PDT
(In reply to Myles C. Maxfield from comment #5)
> Comment on attachment 440891 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440891&action=review
> 
> Please make EWS green before landing.
> 
> > Source/WebCore/dom/Node.cpp:2296
> > -                result.iterator->value |= deliveryOptions;
> > +                result.iterator->value.add(deliveryOptions);
> 
> Why? (there are other similar things in this patch, too)

Because once you make something an "enum class" rather than an "enum", you can no longer do bitwise arithmetic on them (and keep them the underlying type). OptionSet does all this for you, and adds methods for setting (add()) and clearing (remove()) bits from a bitfield.

> > Source/WebCore/page/MediaProducer.h:34
> > +enum class MediaProducerMediaState : uint32_t {
> 
> Is there really no better name than this?

I wasn't trying to answer any hard naming problems in these patches; but rather just move the enum declaration outside the class. So MediaProducer::MediaState -> MediaProducerMediaState. Maybe there's a better name than that, but it's outside the scope (ha!) of this patch.
Comment 7 Jer Noble 2021-10-11 23:08:38 PDT
Created attachment 440894 [details]
Patch for landing
Comment 8 Jer Noble 2021-10-11 23:10:09 PDT
(In reply to Jer Noble from comment #6)
> (In reply to Myles C. Maxfield from comment #5)
> > Comment on attachment 440891 [details]
> > Patch
> > > Source/WebCore/page/MediaProducer.h:34
> > > +enum class MediaProducerMediaState : uint32_t {
> > 
> > Is there really no better name than this?
> 
> I wasn't trying to answer any hard naming problems in these patches; but
> rather just move the enum declaration outside the class. So
> MediaProducer::MediaState -> MediaProducerMediaState. Maybe there's a better
> name than that, but it's outside the scope (ha!) of this patch.

(FWIW, I considered "MediaProducerState", but in the end didn't think it was "better" because "State" feels too generic. Willing to kick this around in a future patch though.)
Comment 9 Jer Noble 2021-10-11 23:29:28 PDT
Created attachment 440896 [details]
Patch for landing
Comment 10 Jer Noble 2021-10-11 23:55:32 PDT
Created attachment 440900 [details]
Patch for landing
Comment 11 Jer Noble 2021-10-12 08:16:55 PDT
Created attachment 440936 [details]
Patch for landing
Comment 12 Jer Noble 2021-10-12 15:00:56 PDT
Created attachment 440991 [details]
Patch for landing
Comment 13 Jer Noble 2021-10-12 15:29:50 PDT
Created attachment 441003 [details]
Patch for landing
Comment 14 Jer Noble 2021-10-12 21:56:14 PDT
Created attachment 441038 [details]
Patch for landing
Comment 15 EWS 2021-10-12 22:54:56 PDT
Committed r284080 (242908@main): <https://commits.webkit.org/242908@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441038 [details].
Comment 16 Radar WebKit Bug Importer 2021-10-12 22:56:19 PDT
<rdar://problem/84182482>
Comment 17 Tetsuharu Ohzeki [UTC+9] 2022-01-19 02:56:07 PST
*** Bug 223675 has been marked as a duplicate of this bug. ***