We should remove LOOSE_PASS_OWN_ARRAY_PTR from OwnPtr.h and PassOwnPtr.h
Created attachment 84378 [details] work in progress I still have 600+ errors in WebCore. It seems like we need to wait a little until WebCore code gets cleaner.
Created attachment 84379 [details] correct work in progress patch Oops, wrong patch.
The general idea is to deploy adoptPtr and friends a lot more in each patch, but not actually throw the switch. Since OwnPtr is used in some code outside WebKit too, we need to make sure we keep the loose mode even if we turn it off by default.
Comment on attachment 84379 [details] correct work in progress patch View in context: https://bugs.webkit.org/attachment.cgi?id=84379&action=review I think we should land a bunch of these fixes even without turning off loose mode. So we can make progress in this direction. I’d love you to turn this work in progress patch into a partial patch we can land. > Source/WebCore/page/ContextMenuController.cpp:90 > + m_contextMenu.clear(); The preferred idiom here is: m_contextMenu = nullptr;
(In reply to comment #4) > (From update of attachment 84379 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=84379&action=review > > I think we should land a bunch of these fixes even without turning off loose mode. So we can make progress in this direction. I’d love you to turn this work in progress patch into a partial patch we can land. Ok. Is there a away to define LOOSE_PASS_OWN_ARRAY_PTR only outside of JSC? My patch as is gets rid of the use of loose pointer in JSC.
(In reply to comment #5) > Is there a way to define LOOSE_PASS_OWN_ARRAY_PTR only outside of JSC? My patch as is gets rid of the use of loose pointer in JSC. It’s OK to fix all these uses without turning off the loose flag at all. We can always double check everything is still tight when we go to turn the flag off. But if you want to switch to setting that flag per-project instead of setting it in PassOwnArrayPtr.h itself, it can be done but probably involves rebuilding the world since you have to add this to a header included across the entire project. Something with config.h almost certainly will work.
I did this a while back.