Owner: tzik@chromium.org Status: Started (was: Available)
A status update:
> 1. Remove `using WTF::AdoptRef` and replace AdoptRef with fully qualified WTF::AdoptRef.
> This is needed to do (2), since bare AdoptRef conflicts to base::AdoptRef on ADL.
Done.
> 3. Move HashTable support of WTF::RefPtr out to a HashTraits.
> WTF::RefPtr has a built-in HashTable support, i.e. HashTableDeletedValue handling, which should not be brought to base/.
> So we should move it out of class, and move to HashTraits<>.
Done.
> 2. Make WTF::RefCounted a subclass of base::RefCounted.
> So that scoped_refptr<> can handle WTF::RefCounted, and we can provide a conversion function from WTF::RefPtr
> to scoped_refptr.
> 4. Convert WTF::RefPtr to a wrapper of scoped_refptr.
WIP. https://chromium-review.googlesource.com/c/chromium/src/+/672324
> 5. Rename WTF::RefPtr methods with corresponding scoped_refptr methods.
> E.g. Swap() -> swap(), Clear() -> reset() and Get() -> get().
Swap() and Clear() are done.
Get() is WIP: https://chromium-review.googlesource.com/c/chromium/src/+/686515
LeakRef() is pending.
> 6. Remove WTF::RefPtr impl, and replace it with an alias of scoped_refptr<>.
> 7. Inline the alias to the users.
Pending.
Another status update:
> 1. Remove `using WTF::AdoptRef` and replace AdoptRef with fully qualified WTF::AdoptRef.
> This is needed to do (2), since bare AdoptRef conflicts to base::AdoptRef on ADL.
>
> 2. Make WTF::RefCounted a subclass of base::RefCounted.
> So that scoped_refptr<> can handle WTF::RefCounted, and we can provide a conversion function from WTF::RefPtr
> to scoped_refptr.
>
> 3. Move HashTable support of WTF::RefPtr out to a HashTraits.
> WTF::RefPtr has a built-in HashTable support, i.e. HashTableDeletedValue handling, which should not be brought to base/.
> So we should move it out of class, and move to HashTraits<>.
>
> 4. Convert WTF::RefPtr to a wrapper of scoped_refptr.
>
> 5. Rename WTF::RefPtr methods with corresponding scoped_refptr methods.
> E.g. Swap() -> swap(), Clear() -> reset() and Get() -> get().
>
1-5 are done. Now WTF::RefPtr is a wrapper of scoped_refptr, and RefPtr has almost same interface to scoped_refptr.
However, I have a concern if it causes a performance regression. So, before proceeding to step 6, I'd hold it for a few days until the perf bot catches up to that change.
> 6. Remove WTF::RefPtr impl, and replace it with an alias of scoped_refptr<>.
WIP: http://crrev.com/c/700334
> 7. Inline the alias to the users.
Pending.
@tzik, I have a question as below,
>6. Remove WTF::RefPtr impl, and replace it with an alias of scoped_refptr<>.
I know that you have been replacing WTF::RefPtr with scoped_refptr<>. But it looks you didn't include "base/memory/scoped_refptr.h" directly in the modified files. So I wonder if you will keep using wtf/RefPtr.h file in the blink. If not, wouldn't it good to include "base/memory/scoped_refptr.h" in the modified files? Because, as far as I know, Chromium has preferred to use direct include rather than indirect include.