Bug 166628

Summary: Remove PassRefPtr use from the "css" directory, related cleanup
Product: WebKit Reporter: Darin Adler <darin>
Component: New BugsAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch achristensen: review+

Darin Adler
Reported 2016-12-30 19:03:50 PST
Remove PassRefPtr use from the "css" directory, related cleanup
Attachments
Patch (60.04 KB, patch)
2016-12-30 19:23 PST, Darin Adler
achristensen: review+
Darin Adler
Comment 1 2016-12-30 19:23:28 PST
Alex Christensen
Comment 2 2016-12-30 22:01:03 PST
Comment on attachment 297867 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297867&action=review > Source/WebCore/css/CSSGradientValue.cpp:98 > + ASSERT(is<CSSRadialGradientValue>(value)); If we add conical gradients but forget to update this, then this assertion will no longer necessarily be true. I liked the old design. It was safer. If only we could switch(type) or something... > Source/WebCore/css/CSSImageGeneratorValue.cpp:73 > - m_clients.add(renderer); > + m_clients.add(&renderer); Can we make m_clients a HashCountedSet<std::reference_wrapper<RenderElement>> ? > Source/WebCore/rendering/style/StyleGeneratedImage.cpp:103 > + ASSERT(renderer); It seems like we should make the parameter type a RenderElement& instead of this.
Darin Adler
Comment 3 2016-12-31 01:17:45 PST
Comment on attachment 297867 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297867&action=review >> Source/WebCore/css/CSSGradientValue.cpp:98 >> + ASSERT(is<CSSRadialGradientValue>(value)); > > If we add conical gradients but forget to update this, then this assertion will no longer necessarily be true. I liked the old design. It was safer. If only we could switch(type) or something... A tiny bit safer in theory, but also an untested unreachable code path. I definitely did not like the old design. Maybe we should talk in person? >> Source/WebCore/css/CSSImageGeneratorValue.cpp:73 >> + m_clients.add(&renderer); > > Can we make m_clients a HashCountedSet<std::reference_wrapper<RenderElement>> ? I have no idea; this is a recurring pattern elsewhere so we should try that at some point. >> Source/WebCore/rendering/style/StyleGeneratedImage.cpp:103 >> + ASSERT(renderer); > > It seems like we should make the parameter type a RenderElement& instead of this. Absolutely; we can keep pulling on the thread of the functions that take pointers that should be references. I didn’t want to go even further in my refactoring in this patch, so this is one of the places where I drew the line.
Darin Adler
Comment 4 2016-12-31 01:18:29 PST
Note You need to log in before you can comment on or make changes to this bug.