RESOLVED FIXED 137824
Use is<>() / downcast<>() for StyleImage
https://bugs.webkit.org/show_bug.cgi?id=137824
Summary Use is<>() / downcast<>() for StyleImage
Chris Dumez
Reported 2014-10-17 10:19:13 PDT
Use is<>() / downcast<>() for StyleImage.
Attachments
Patch (21.59 KB, patch)
2014-10-17 10:42 PDT, Chris Dumez
no flags
Patch (21.59 KB, patch)
2014-10-17 11:45 PDT, Chris Dumez
no flags
Patch (21.59 KB, patch)
2014-10-17 13:28 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2014-10-17 10:42:33 PDT
Chris Dumez
Comment 2 2014-10-17 11:45:22 PDT
Andreas Kling
Comment 3 2014-10-17 12:00:05 PDT
Comment on attachment 240027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240027&action=review r=me > Source/WebCore/css/CSSCursorImageValue.cpp:67 > + if (is<StylePendingImage>(m_image.get())) Can we avoid the .get() here? An overload for RefPtr? Maybe that's overkill. > Source/WebCore/css/CSSImageSetValue.cpp:193 > + CachedResource* cachedResource = downcast<StyleCachedImageSet>(*m_imageSet).cachedImage(); cachedImage() returns a CachedImage*, and we store it in a CachedResource*, losing some type knowledge. It doesn't actually matter in this case, but I'm commenting on it anyway because this is one reason I like auto.
Chris Dumez
Comment 4 2014-10-17 13:23:21 PDT
Comment on attachment 240027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240027&action=review >> Source/WebCore/css/CSSCursorImageValue.cpp:67 >> + if (is<StylePendingImage>(m_image.get())) > > Can we avoid the .get() here? An overload for RefPtr? Maybe that's overkill. It is actually on my TODO list. There are actually not that many call sites that would benefit from it so it is not very high priority. Would still be nice to have though. >> Source/WebCore/css/CSSImageSetValue.cpp:193 >> + CachedResource* cachedResource = downcast<StyleCachedImageSet>(*m_imageSet).cachedImage(); > > cachedImage() returns a CachedImage*, and we store it in a CachedResource*, losing some type knowledge. > It doesn't actually matter in this case, but I'm commenting on it anyway because this is one reason I like auto. Ok, I will use tighter typing. (not a big fan of auto here because the type is not obvious but I understand it would help avoid this kind of loose typing mistakes).
Chris Dumez
Comment 5 2014-10-17 13:28:31 PDT
WebKit Commit Bot
Comment 6 2014-10-17 14:12:47 PDT
Comment on attachment 240033 [details] Patch Clearing flags on attachment: 240033 Committed r174836: <http://trac.webkit.org/changeset/174836>
WebKit Commit Bot
Comment 7 2014-10-17 14:12:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.