Bug 154691

Summary: Should template RefCounter instead of RefCounter::Token
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: Web Template FrameworkAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix andersca: review+

Description Gavin Barraclough 2016-02-25 13:49:56 PST
My real goal here is to make the counter accurate. Currently returning a Token from token<>() results in ref-count churn. Fixing this either means changing the return value, or improving Token (which will probably mean replacing it with RefPtr). Either way would break the current type checking. Move type tag to RefCount so this can still be enforced.
Comment 1 Gavin Barraclough 2016-02-25 13:57:24 PST
Created attachment 272235 [details]
Fix
Comment 2 Anders Carlsson 2016-02-25 14:15:33 PST
Comment on attachment 272235 [details]
Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=272235&action=review

> Source/WTF/wtf/RefCounter.h:172
> +inline typename RefCounter<T>::Token& RefCounter<T>::Token::operator=(const RefCounter<T>::Token& token)

I think this can be

inline auto RefCounter<T>::Token::operator=(const RefCounter<T>::Token& token) -> Token&
Comment 3 Gavin Barraclough 2016-02-25 14:58:02 PST
Transmitting file data ................
Committed revision 197132.
Comment 4 Gavin Barraclough 2016-02-25 16:45:48 PST
Speculative windows fix:
Transmitting file data ..
Committed revision 197146.