[Webkit-unassigned] [Bug 91313] New: Increase the readability of Functional related to handling wrapping/unwrapping RefPtr and PassRefPtr.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 13 23:48:00 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91313

           Summary: Increase the readability of Functional related to
                    handling wrapping/unwrapping RefPtr and PassRefPtr.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: luxtella at company100.net


There are two changes.

1. Partial template specialization of RefAndDeref on RefPtr and PassRefPtr.
Currently, RefAndDeref<RefPtr<T>, true>::ref(m_p1) bounds RefAndDeref<T*, true>.
"static void ref(T* t) { t->ref(); }" does work correctly because m_p1->ref() is
legal, but it is hard to read. It is why this patch specialized on RefPtr and
PassRefPtr also.

2. ParamStorageTraits<(RefPtr|PassRefPtr)<T> >::unref returns PassRefPtr instead of raw pointer.
The raw pointer is eventually casted to PassRefPtr, so it is better to return
PassRefPtr for both performance and readability.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list