Bug 154699

Summary: RefCounter value changed callback should be called on all changes (not just zero edge).
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: Web Template FrameworkAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP
none
Fix
andersca: review+
Fix ggaren: review+

Description Gavin Barraclough 2016-02-25 15:54:10 PST
.
Comment 1 Gavin Barraclough 2016-02-25 15:54:51 PST
Created attachment 272255 [details]
WIP
Comment 2 Gavin Barraclough 2016-02-25 16:25:53 PST
Created attachment 272261 [details]
Fix
Comment 3 Anders Carlsson 2016-02-25 16:31:36 PST
Comment on attachment 272261 [details]
Fix

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

> Source/WTF/wtf/RefCounter.h:60
> +    enum Event { Decrement, Increment };

I would use enum class here.

> Source/WTF/wtf/RefCounter.h:61
> +    using ValueChangeFunction = std::function<void(Event)>;

Space after the return type.

> Source/WTF/wtf/RefCounter.h:63
> +    RefCounter(ValueChangeFunction = [](bool) { });

Maybe use nullptr here (and check m_valueChangeFunction)
Comment 4 Gavin Barraclough 2016-02-25 17:58:07 PST
Created attachment 272273 [details]
Fix
Comment 5 WebKit Commit Bot 2016-02-25 17:59:16 PST
Attachment 272273 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebProcessPool.cpp:162:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ProcessThrottler.cpp:39:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/RefCounter.h:61:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/VNodeTracker.cpp:43:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/VNodeTracker.cpp:42:  More than one command on the same line in if  [whitespace/parens] [4]
Total errors found: 5 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Geoffrey Garen 2016-02-26 00:15:25 PST
Comment on attachment 272273 [details]
Fix

r=me
Comment 7 Gavin Barraclough 2016-02-26 10:20:12 PST
Transmitting file data ..............
Committed revision 197178.