Bug 137431 - Use is<>() / downcast<>() for CachedResource subclasses
Summary: Use is<>() / downcast<>() for CachedResource subclasses
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 137056
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-04 22:48 PDT by Chris Dumez
Modified: 2014-10-05 17:31 PDT (History)
6 users (show)

See Also:


Attachments
Patch (18.05 KB, patch)
2014-10-04 23:04 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (18.10 KB, patch)
2014-10-05 16:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-10-04 22:48:02 PDT
Use is<>() / downcast<>() for CachedResource subclasses
Comment 1 Chris Dumez 2014-10-04 23:04:48 PDT
Created attachment 239293 [details]
Patch
Comment 2 Benjamin Poulain 2014-10-05 16:06:09 PDT
Comment on attachment 239293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239293&action=review

> Source/WebCore/loader/cache/CachedResourceLoader.cpp:708
> +            CachedImage& image = downcast<CachedImage>(*resource);
> +            image.load(this, defaultCachedResourceOptions());

Darin would probably prefer this on one line. Personally I like the named temporary here.

Your call.

> Source/WebKit/mac/Misc/WebCache.mm:205
>      if (!cachedResource || !cachedResource->isImage())

Why keep this?
Comment 3 Chris Dumez 2014-10-05 16:46:40 PDT
Comment on attachment 239293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239293&action=review

>> Source/WebCore/loader/cache/CachedResourceLoader.cpp:708
>> +            image.load(this, defaultCachedResourceOptions());
> 
> Darin would probably prefer this on one line. Personally I like the named temporary here.
> 
> Your call.

Will drop the variable.

>> Source/WebKit/mac/Misc/WebCache.mm:205
>>      if (!cachedResource || !cachedResource->isImage())
> 
> Why keep this?

I missed it, will use is<>()
Comment 4 Chris Dumez 2014-10-05 16:47:22 PDT
Created attachment 239304 [details]
Patch
Comment 5 WebKit Commit Bot 2014-10-05 17:31:10 PDT
Comment on attachment 239304 [details]
Patch

Clearing flags on attachment: 239304

Committed r174333: <http://trac.webkit.org/changeset/174333>
Comment 6 WebKit Commit Bot 2014-10-05 17:31:15 PDT
All reviewed patches have been landed.  Closing bug.