Re: [webkit-dev] Compile times and class-scoped enums
> On Jan 23, 2023, at 11:05 AM, Geoffrey Garen wrote: > >>> However, this change requires moving class-scoped enums out into the >>> namespace scope. >> >> Seems worthwhile. Doesn’t seem to me like it would have far reaching effects. > > I agree. > >> +using Type = DOMAudioSessionType; > > Did you do this to make the patch smaller, or do you prefer this style? Yes to both. IMO, there’s nothing inherently wrong with having an enum scoped to a class apart from that makes it impossible to forward declare. If there was some language supported mechanism to forward-declare class-scoped enums, we’d probably just do that instead. So, this pattern of declaring the enum outside of a class and pulling it into the class with a using declaration is a bit ugly, insofar as it pollutes the global namespace, but it does allow you to continue to use the type as if it were file scoped. -Jer___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Stop Using Raw Pointers & References in New Code
Is the idea that a checker failure should block landing a patch, or just that it should start a conversation with your patch reviewer about why this case is an exception? Maybe the ’should’ clause in the error message could clarify. In general, I do think it’s helpful to flag any new raw pointer usage in a member variable. But I also agree that it might not be practical to get that number to true zero. Thanks, Geoff > On Jan 21, 2023, at 12:12 PM, Michael Catanzaro via webkit-dev > wrote: > > On Fri, Jan 20 2023 at 06:15:38 PM -0800, Ryosuke Niwa via webkit-dev > wrote: >> Here´s a PR to make the style checker look for raw pointers & references in >> data members: https://github.com/WebKit/WebKit/pull/8907 >> I suggest we land this PR in 5 business days from now on unless someone >> objects. > > I'm not sure how this would work as a style check rule since there's always > going to be exceptions. E.g. we probably don't want to convert GObject priv > pointers to use CheckedRef: that would be silly. > > I think we can follow this rule in most of WebCore and maybe most of WebKit > and WTF as well. Probably not going to work for bmalloc. Not sure about JSC. > > Michael > > > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Compile times and class-scoped enums
>> However, this change requires moving class-scoped enums out into the >> namespace scope. > > Seems worthwhile. Doesn’t seem to me like it would have far reaching effects. I agree. > +using Type = DOMAudioSessionType; Did you do this to make the patch smaller, or do you prefer this style? Thanks, Geoff___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev