Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-02-28 Thread Fujii Hironori via webkit-dev
On Tue, Feb 28, 2023 at 6:22 AM Andres Gonzalez wrote: > > "To use `WeakPtr` or `ThreadSafeWeakPtr`, make the class inherit from > `CanMakeWeakPtr` or `CanMakeThreadSafeWeakPtr`, whichever is > appropriate. Note that classes that want to implement both > `ThreadSafeRefCounted` and

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-02-27 Thread Andres Gonzalez via webkit-dev
Thanks Ryosuke for the wiki page. Can you please clarify: "To use `WeakPtr` or `ThreadSafeWeakPtr`, make the class inherit from `CanMakeWeakPtr` or `CanMakeThreadSafeWeakPtr`, whichever is appropriate. Note that classes that want to implement both `ThreadSafeRefCounted` and

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Ryosuke Niwa via webkit-dev
> On Jan 30, 2023, at 6:29 PM, Fujii Hironori via webkit-dev > wrote: > > On Tue, Jan 31, 2023 at 8:28 AM Ryosuke Niwa via webkit-dev > wrote: >> >> I’ve posted https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Rules >> >> > Very nice. Can I add the following exception for >

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Fujii Hironori via webkit-dev
On Tue, Jan 31, 2023 at 8:28 AM Ryosuke Niwa via webkit-dev < webkit-dev@lists.webkit.org> wrote: > > I’ve posted > https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Rules > > Very nice. Can I add the following exception for webkit.UncountedLambdaCapturesChecker rule?

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Ryosuke Niwa via webkit-dev
> On Jan 30, 2023, at 12:11 PM, Ryosuke Niwa via webkit-dev > wrote: > >> On Jan 30, 2023, at 10:47 AM, Alexey Proskuryakov wrote: >> >> Reviving this old thread, reading it again made me wish for two things: >> >> - a wiki document that describes what we are trying to do, not just a thread

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Ryosuke Niwa via webkit-dev
> On Jan 30, 2023, at 10:47 AM, Alexey Proskuryakov wrote: > > Reviving this old thread, reading it again made me wish for two things: > > - a wiki document that describes what we are trying to do, not just a thread > which patches the proposal with clarifications; Yeah, let me go make one.

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Darin Adler via webkit-dev
I am hoping this ends up being practical. In the CSS code I have recently worked on there are many short-lived references, and in some refactoring I was not able to change them all to smart pointers without a measurable performance degradation in Speedometer, so the code might need redesign to

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2023-01-30 Thread Alexey Proskuryakov via webkit-dev
Hi, Reviving this old thread, reading it again made me wish for two things: - a wiki document that describes what we are trying to do, not just a thread which patches the proposal with clarifications; - a discussion of why we can postpone figuring out what to do with containers (like Vector

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Jan Korous
Hi all, I am an engineer at Security Tools team at Apple responsible for the tooling support for this effort. > On Sep 23, 2020, at 12:34 PM, Darin Adler wrote: > >> On Sep 23, 2020, at 12:18 PM, Ryosuke Niwa wrote: >> >> There are quite a few cases where data members are references but

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Darin Adler
> On Sep 23, 2020, at 12:18 PM, Ryosuke Niwa wrote: > > There are quite a few cases where data members are references but then those > can also be replaced by a simple member function which retrieves the value of > the smart pointer member variable and returns a reference. I think this should

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Ryosuke Niwa
On Wed, Sep 23, 2020 at 10:32 AM Darin Adler wrote: > On Sep 16, 2020, at 11:32 PM, Ryosuke Niwa wrote: > >1. Every data member to a ref counted object must use either Ref, >RefPtr, or WeakPtr. webkit.NoUncountedMemberChecker > >

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Darin Adler
> On Sep 23, 2020, at 10:32 AM, Darin Adler wrote: > >> On Sep 16, 2020, at 11:32 PM, Ryosuke Niwa > > wrote: >> Every data member to a ref counted object must use either Ref, RefPtr, or >> WeakPtr. webkit.NoUncountedMemberChecker >>

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Darin Adler
> On Sep 16, 2020, at 11:32 PM, Ryosuke Niwa wrote: > Every data member to a ref counted object must use either Ref, RefPtr, or > WeakPtr. webkit.NoUncountedMemberChecker > My > only worry here is

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Ryosuke Niwa
On Thu, Sep 17, 2020 at 2:51 AM Emilio Cobos Álvarez wrote: > Interesting. This looks fairly similar to some of the checkers we use in > mozilla-central, fwiw. > > One interesting difference is that we opted for explicitly annotating > the functions that can run script (think

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-23 Thread Ryosuke Niwa
On Thu, Sep 17, 2020 at 2:11 AM Konstantin Tokarev wrote: > > Sounds great! A few questions: > * Do I understand correctly that analyzer is a part of upstream clang and > can work on any platform? > Yes. * Does it require WebKit trunk or can work with older branches? It should work with

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-17 Thread Emilio Cobos Álvarez
Interesting. This looks fairly similar to some of the checkers we use in mozilla-central, fwiw. One interesting difference is that we opted for explicitly annotating the functions that can run script (think updateStyleIfNeeded(), dispatchEvent() etc equivalents) to be able to not warn for

Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-17 Thread Konstantin Tokarev
17.09.2020, 09:35, "Ryosuke Niwa" : > Hi all, > > I’ve been working with Geoff (ggaren) and Jan Korous from Apple's compiler > team to create a static analyzer which detects dangerous use of ref counted > objects, and we’re looking for folks who are interested in trying out this > tool and

[webkit-dev] Smart Pointer Analysis Tool for WebKit

2020-09-17 Thread Ryosuke Niwa
Hi all, I’ve been working with Geoff (ggaren) and Jan Korous from Apple's compiler team to create a static analyzer which detects dangerous use of ref counted objects, and we’re looking for folks who are interested in trying out this tool and helping us refine the tool. Please let me know if