Bug 92966 - Web Inspector: rename reportMemoryUsage to reportDescendantMemoryUsage in StyleRuleBase descendants
Summary: Web Inspector: rename reportMemoryUsage to reportDescendantMemoryUsage in Sty...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on: 92748
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-02 02:48 PDT by Yury Semikhatsky
Modified: 2012-08-02 03:16 PDT (History)
14 users (show)

See Also:


Attachments
Patch (10.97 KB, patch)
2012-08-02 02:50 PDT, Yury Semikhatsky
apavlov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2012-08-02 02:48:40 PDT
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.
Comment 1 Yury Semikhatsky 2012-08-02 02:50:37 PDT
Created attachment 156021 [details]
Patch
Comment 2 Ilya Tikhonovsky 2012-08-02 02:55:56 PDT
Comment on attachment 156021 [details]
Patch

lgtm
Comment 3 Alexander Pavlov (apavlov) 2012-08-02 03:11:47 PDT
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
Comment 4 Yury Semikhatsky 2012-08-02 03:12:52 PDT
(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.
Comment 5 Yury Semikhatsky 2012-08-02 03:16:55 PDT
Committed r124435: <http://trac.webkit.org/changeset/124435>