WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92748
Web Inspector: add CSSStyleSheet memory instrumentation
https://bugs.webkit.org/show_bug.cgi?id=92748
Summary
Web Inspector: add CSSStyleSheet memory instrumentation
Yury Semikhatsky
Reported
2012-07-31 06:58:19 PDT
It includes instrumenting a bunch of related classes including StyleRule, StylePropertySet etc.
Attachments
Patch
(31.49 KB, patch)
2012-07-31 07:50 PDT
,
Yury Semikhatsky
koivisto
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2012-07-31 07:50:47 PDT
Created
attachment 155537
[details]
Patch
Alexander Pavlov (apavlov)
Comment 2
2012-07-31 08:02:38 PDT
Comment on
attachment 155537
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
> Source/WebCore/css/StyleSheetContents.cpp:445 > +void StyleSheetContents::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
StyleSheetContents can be shared among several CSSStyleSheet's (and will be copied on write). I suggest talking to anttik to sort this out.
Yury Semikhatsky
Comment 3
2012-07-31 08:13:32 PDT
(In reply to
comment #2
)
> (From update of
attachment 155537
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
> > > Source/WebCore/css/StyleSheetContents.cpp:445 > > +void StyleSheetContents::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const > > StyleSheetContents can be shared among several CSSStyleSheet's (and will be copied on write). I suggest talking to anttik to sort this out.
It's not a problem in case of memory instrumentation as we keep a set of all visited objects which prevents double counting.
Ilya Tikhonovsky
Comment 4
2012-08-01 00:50:31 PDT
Comment on
attachment 155537
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
lgtm
> Source/WebCore/css/CSSStyleSheet.cpp:177 > + info.addInstrumentedMember(m_contents); > + info.addString(m_title); > + info.addInstrumentedMember(m_mediaQueries);
why did you skip other members? Node* m_ownerNode; CSSImportRule* m_ownerRule; mutable RefPtr<MediaList> m_mediaCSSOMWrapper; mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
> Source/WebCore/css/StyleSheetContents.cpp:450 > +
empty line
Antti Koivisto
Comment 5
2012-08-01 01:50:00 PDT
Comment on
attachment 155537
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
r=me
> Source/WebCore/css/StylePropertySet.cpp:1084 > + MemoryClassInfo<StylePropertySet> info(memoryObjectInfo, this, MemoryInstrumentation::CSS); > + if (m_isMutable) > + info.addVectorPtr(m_mutablePropertyVector); > + else > + info.addRawBuffer(m_properties, m_arraySize * sizeof(CSSProperty));
CSSProperty contains a CSSValue. You are not taking its size (which may be significant) into account. Is this something you plan to do later?
Yury Semikhatsky
Comment 6
2012-08-01 06:25:57 PDT
(In reply to
comment #4
)
> (From update of
attachment 155537
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
> > lgtm > > > Source/WebCore/css/CSSStyleSheet.cpp:177 > > + info.addInstrumentedMember(m_contents); > > + info.addString(m_title); > > + info.addInstrumentedMember(m_mediaQueries); > > why did you skip other members? > Node* m_ownerNode; > CSSImportRule* m_ownerRule; > > mutable RefPtr<MediaList> m_mediaCSSOMWrapper; > mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; > mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; >
They will be instrumented in the next patch.
> > Source/WebCore/css/StyleSheetContents.cpp:450 > > + > > empty line
Fixed.
Yury Semikhatsky
Comment 7
2012-08-01 06:27:00 PDT
(In reply to
comment #5
)
> (From update of
attachment 155537
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155537&action=review
> > r=me > > > Source/WebCore/css/StylePropertySet.cpp:1084 > > + MemoryClassInfo<StylePropertySet> info(memoryObjectInfo, this, MemoryInstrumentation::CSS); > > + if (m_isMutable) > > + info.addVectorPtr(m_mutablePropertyVector); > > + else > > + info.addRawBuffer(m_properties, m_arraySize * sizeof(CSSProperty)); > > CSSProperty contains a CSSValue. You are not taking its size (which may be significant) into account. Is this something you plan to do later?
I'm planning to instrument it and CSSRule in the next patch to keep the changes small enough for review.
Yury Semikhatsky
Comment 8
2012-08-01 06:30:26 PDT
Committed
r124330
: <
http://trac.webkit.org/changeset/124330
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug