Bug 55559 - Remove LOOSE_PASS_OWN_ARRAY_PTR from OwnPtr.h and PassOwnPtr.h
Summary: Remove LOOSE_PASS_OWN_ARRAY_PTR from OwnPtr.h and PassOwnPtr.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 00:25 PST by Ryosuke Niwa
Modified: 2011-11-09 17:14 PST (History)
4 users (show)

See Also:


Attachments
work in progress (5.19 KB, patch)
2011-03-02 00:27 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
correct work in progress patch (15.36 KB, patch)
2011-03-02 00:29 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-03-02 00:25:10 PST
We should remove LOOSE_PASS_OWN_ARRAY_PTR from OwnPtr.h and PassOwnPtr.h
Comment 1 Ryosuke Niwa 2011-03-02 00:27:39 PST
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.
Comment 2 Ryosuke Niwa 2011-03-02 00:29:18 PST
Created attachment 84379 [details]
correct work in progress patch

Oops, wrong patch.
Comment 3 Darin Adler 2011-03-02 10:08:08 PST
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 4 Darin Adler 2011-03-02 10:09:55 PST
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;
Comment 5 Ryosuke Niwa 2011-03-02 21:46:03 PST
(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.
Comment 6 Darin Adler 2011-03-03 12:35:53 PST
(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.
Comment 7 Darin Adler 2011-11-09 17:14:57 PST
I did this a while back.