RESOLVED FIXED 213415
[AppSSO] Should do null check on m_page in dismissViewController()
https://bugs.webkit.org/show_bug.cgi?id=213415
Summary [AppSSO] Should do null check on m_page in dismissViewController()
Jiewen Tan
Reported 2020-06-19 16:30:48 PDT
Use protectedThis for dismissViewController().
Attachments
Patch (2.47 KB, patch)
2020-06-19 16:34 PDT, Jiewen Tan
no flags
Patch (1.68 KB, patch)
2020-06-19 19:07 PDT, Jiewen Tan
no flags
Patch (1.70 KB, patch)
2020-06-20 00:41 PDT, Jiewen Tan
no flags
Jiewen Tan
Comment 1 2020-06-19 16:31:00 PDT
Jiewen Tan
Comment 2 2020-06-19 16:34:28 PDT
Darin Adler
Comment 3 2020-06-19 17:10:12 PDT
Comment on attachment 402343 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402343&action=review > Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:305 > - dismissViewController(); > + protectedThis->dismissViewController(); There are tons of cases where we capture "this" in protectedThis, but then use "this" relying on the protection indirectly. Why is it important to change this one? I see no reason to make this change, but to leave the code two lines later using this to null out m_presentingWindowDidDeminiaturizeObserver. I like the idea of always using protectedThis, but I would do this and not even capture this, and even then, I am not sure we need to make a change. It’s a repeating pattern in a lot of different code in WebKit.
Jiewen Tan
Comment 4 2020-06-19 18:58:55 PDT
Comment on attachment 402343 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402343&action=review >> Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:305 >> + protectedThis->dismissViewController(); > > There are tons of cases where we capture "this" in protectedThis, but then use "this" relying on the protection indirectly. Why is it important to change this one? I see no reason to make this change, but to leave the code two lines later using this to null out m_presentingWindowDidDeminiaturizeObserver. > > I like the idea of always using protectedThis, but I would do this and not even capture this, and even then, I am not sure we need to make a change. It’s a repeating pattern in a lot of different code in WebKit. Thanks for pointing it out. I was confused as well. I have received a crash report indicating Line 317 could crash, and therefore this is the most reasonable patch I could come out with. Now after reading other crash logs, it turns out that those crashed at a different place which actually makes sense. Will upload another patch.
Jiewen Tan
Comment 5 2020-06-19 19:07:38 PDT
Alexey Proskuryakov
Comment 6 2020-06-19 19:38:50 PDT
Comment on attachment 402370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402370&action=review > Source/WebKit/ChangeLog:3 > + [AppSSO] Use protectedThis for dismissViewController() This is not what this patch is about.
Jiewen Tan
Comment 7 2020-06-20 00:40:56 PDT
Comment on attachment 402370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402370&action=review >> Source/WebKit/ChangeLog:3 >> + [AppSSO] Use protectedThis for dismissViewController() > > This is not what this patch is about. Oops. Forgot to update the change log.
Jiewen Tan
Comment 8 2020-06-20 00:41:19 PDT
Alexey Proskuryakov
Comment 9 2020-06-20 12:39:38 PDT
Comment on attachment 402379 [details] Patch That's one of the reasons why it's better to put the symptom/motivation into radar title, not a description of what change is being made.
Jiewen Tan
Comment 10 2020-06-20 23:06:06 PDT
(In reply to Alexey Proskuryakov from comment #9) > Comment on attachment 402379 [details] > Patch > > That's one of the reasons why it's better to put the symptom/motivation into > radar title, not a description of what change is being made. Got you. Will do that next time.
Jiewen Tan
Comment 11 2020-06-20 23:06:41 PDT
Comment on attachment 402379 [details] Patch Thanks Alexey for r+ this patch.
EWS
Comment 12 2020-06-20 23:10:41 PDT
Committed r263324: <https://trac.webkit.org/changeset/263324> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402379 [details].
Note You need to log in before you can comment on or make changes to this bug.