Current implementation of StyleRuleBase::reportMemoryUsage has a switch by the rule type, then casts it to the corresponding descendant type and calls reportMemoryUsage on it. This scheme can be accidentally broken by adding another type to the switch: if the descendant doesn't provide its own reportMemoryUsage implementation we will end up with recursive call to StyleRuleBase::reportMemoryUsage. Compiler won't help us in that case. This can be fixed by changing the name of the method that actually provides the memory instrumentation in the descendants.
Created attachment 156021 [details] Patch
Comment on attachment 156021 [details] Patch lgtm
Comment on attachment 156021 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156021&action=review > Source/WebCore/ChangeLog:9 > + StyleRuleBase to avoid accidental recurive calls to StyleRuleBase::reportMemoryUsage recurive -> recursive
(In reply to comment #3) > (From update of attachment 156021 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=156021&action=review > > > Source/WebCore/ChangeLog:9 > > + StyleRuleBase to avoid accidental recurive calls to StyleRuleBase::reportMemoryUsage > > recurive -> recursive Done.
Committed r124435: <http://trac.webkit.org/changeset/124435>