Bug 137431

Summary: Use is<>() / downcast<>() for CachedResource subclasses
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Page LoadingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, japhet, kling, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 137056    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

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.