[Webkit-unassigned] [Bug 139776] New: Add strong typing to RefCounter interface, return value as a bool.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 18 09:48:32 PST 2014


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

            Bug ID: 139776
           Summary: Add strong typing to RefCounter interface, return
                    value as a bool.
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit2
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: barraclough at apple.com

Currently all token vended by a RefCounter have the same type – Ref<RefCounter::Count>. This means there is no compile time type checking to prevent mistakes. Update the count() method to token<>(), templated on type used to identify the token being returned. Calls to token<T>() will return a result of type RefCounter::Token<T>.

There are a few problems with the fact the counter will return you an exact count of the number of outstanding tokens:
  - It is desirable to only fire the callback on zero-edge changes; it is more consistent to do so if the value is only readable as a boolean.
  - It is desirable to provide the value as an argument to the callback, however to make this useful for integer values it is also necessary to indicate the direction of change (0->1 is often interesting where 2->1 is not).
  - There is a mismatch between the precision of returning a count, and the inherent imprecision of a token based mechanism, where it may be difficult to guarantee absolutely no unnecessary refcount churn, and thus unintentional counter values.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141218/4a1886a7/attachment-0002.html>


More information about the webkit-unassigned mailing list