Bug 231489 - [Build-time perf] Forward-declare more things in Document.h
Summary: [Build-time perf] Forward-declare more things in Document.h
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: Jer Noble
URL:
Keywords: InRadar
: 223675 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-10 11:25 PDT by Jer Noble
Modified: 2022-01-19 02:56 PST (History)
42 users (show)

See Also:


Attachments
Patch (245.24 KB, patch)
2021-10-11 11:15 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (261.56 KB, patch)
2021-10-11 12:40 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (269.99 KB, patch)
2021-10-11 22:26 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (271.21 KB, patch)
2021-10-11 23:08 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (271.93 KB, patch)
2021-10-11 23:29 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (272.05 KB, patch)
2021-10-11 23:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (273.24 KB, patch)
2021-10-12 08:16 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (273.15 KB, patch)
2021-10-12 15:00 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (273.02 KB, patch)
2021-10-12 15:29 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (272.94 KB, patch)
2021-10-12 21:56 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

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