Summary: | Use smart pointers in UIDelegate and NavigationState | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||||||||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | cdumez, ggaren, webkit-bug-importer | ||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Attachments: |
|
Description
Alex Christensen
2021-01-06 17:47:55 PST
Created attachment 417144 [details]
Patch
Comment on attachment 417144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=417144&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:4770 > + auto protectedThis = makeRef(*this); This is unnecessary in functions called via IPC. We solved it at a global level years ago. If you look at WebPageProxy::didReceiveMessage() in generated code, you will see: auto protectedThis = makeRef(*this); We protect the WebPageProxy while calling every function due to an IPC message. Created attachment 417187 [details]
Patch
Created attachment 417189 [details]
Patch
Created attachment 417192 [details]
Patch
Created attachment 417198 [details]
Patch
Comment on attachment 417198 [details]
Patch
r=me
Smart pointer is definitely better than raw pointer here. Would be nice in the future just to make this lifetime mismatch impossible.
Comment on attachment 417198 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=417198&action=review > Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:408 > - return; > + return completionHandler(false); Surprisingly this changed behavior in an undesirable way. Will revert. Created attachment 417209 [details]
Patch
Committed r271264: <https://trac.webkit.org/changeset/271264> All reviewed patches have been landed. Closing bug and clearing flags on attachment 417209 [details]. |