Bug 6094 - khtml/css should use RefPtr instead of manual ref() deref()
Summary: khtml/css should use RefPtr instead of manual ref() deref()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-15 02:37 PST by Eric Seidel (no email)
Modified: 2005-12-15 13:38 PST (History)
0 users

See Also:


Attachments
Proposed patch (22.33 KB, patch)
2005-12-15 02:38 PST, Eric Seidel (no email)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-12-15 02:37:07 PST
khtml/css should use RefPtr instead of manual ref() deref()

This patch does just that.  (I'm doing each of the khtml sub-directories one at a time to keep these 
patches small).
Comment 1 Eric Seidel (no email) 2005-12-15 02:38:37 PST
Created attachment 5085 [details]
Proposed patch
Comment 2 Darin Adler 2005-12-15 06:27:06 PST
Comment on attachment 5085 [details]
Proposed patch

To avoid leaks, getPropertyCSSValue should be changed to return a PassRefPtr
rather than a raw pointer.

CSSStyleRuleImpl::setDeclaration doesn't need the != check. It can just be a
one-liner m_style = style.

The changes to CSSPrimitiveValueImpl don't seem like much of an improvement to
me.

~CSSProperty should be removed altogether rather than left declared as an empty
inline.

In this line:

     RefPtr<CSSMutableStyleDeclarationImpl>dummyStyleDeclaration

there's a space missing after the > symbol.

But none of these are major issues, it's fine to land as-is if you like.