Summary: | Use smart pointer for WebView ownership in DumpRenderTree | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | Tools / Tests | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, darin, ggaren, sam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 222060, 222068 | ||||||
Attachments: |
|
Description
Chris Dumez
2021-02-16 16:33:33 PST
Created attachment 420559 [details]
Patch
Comment on attachment 420559 [details]
Patch
r=me
Comment on attachment 420559 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420559&action=review > Tools/DumpRenderTree/mac/DumpRenderTree.mm:781 > + return webView.leakRef(); Why don't we just make createWebViewAndOffscreenWindow return a RetainPtr? (In reply to Alex Christensen from comment #3) > Comment on attachment 420559 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=420559&action=review > > > Tools/DumpRenderTree/mac/DumpRenderTree.mm:781 > > + return webView.leakRef(); > > Why don't we just make createWebViewAndOffscreenWindow return a RetainPtr? I believe I tried that but this function is declared in the header and I was unable to have the function return a RetainPtr<> in the header (adding the include for Retain.h gave a build error). Comment on attachment 420559 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420559&action=review >>> Tools/DumpRenderTree/mac/DumpRenderTree.mm:781 >>> + return webView.leakRef(); >> >> Why don't we just make createWebViewAndOffscreenWindow return a RetainPtr? > > I believe I tried that but this function is declared in the header and I was unable to have the function return a RetainPtr<> in the header (adding the include for Retain.h gave a build error). Not sure this is important/urgent, but might be able to do it by putting #ifdef __cplusplus around some of the code in the header. (Also, should be Forward.h in the header.) Comment on attachment 420559 [details] Patch Clearing flags on attachment: 420559 Committed r273022 (234223@main): <https://commits.webkit.org/234223@main> All reviewed patches have been landed. Closing bug. (In reply to Darin Adler from comment #5) > Comment on attachment 420559 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=420559&action=review > > >>> Tools/DumpRenderTree/mac/DumpRenderTree.mm:781 > >>> + return webView.leakRef(); > >> > >> Why don't we just make createWebViewAndOffscreenWindow return a RetainPtr? > > > > I believe I tried that but this function is declared in the header and I was unable to have the function return a RetainPtr<> in the header (adding the include for Retain.h gave a build error). > > Not sure this is important/urgent, but might be able to do it by putting > #ifdef __cplusplus around some of the code in the header. (Also, should be > Forward.h in the header.) Oh nice. I'll give that a try, Thanks. I would me much nicer if I could return a RetainPtr<>. (In reply to Darin Adler from comment #5) > Comment on attachment 420559 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=420559&action=review > > >>> Tools/DumpRenderTree/mac/DumpRenderTree.mm:781 > >>> + return webView.leakRef(); > >> > >> Why don't we just make createWebViewAndOffscreenWindow return a RetainPtr? > > > > I believe I tried that but this function is declared in the header and I was unable to have the function return a RetainPtr<> in the header (adding the include for Retain.h gave a build error). > > Not sure this is important/urgent, but might be able to do it by putting > #ifdef __cplusplus around some of the code in the header. (Also, should be > Forward.h in the header.) Also, I think this means adding a forward declaration for RetainPtr in Forward.h because there isn't one currently. |