Bug 136654 - Clean up some ENABLE(PICTURE_SIZES) stuff, don't change function signatures inside #ifdefs
Summary: Clean up some ENABLE(PICTURE_SIZES) stuff, don't change function signatures i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on: 136942
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-08 18:27 PDT by Simon Fraser (smfr)
Modified: 2014-09-19 01:47 PDT (History)
6 users (show)

See Also:


Attachments
Patch (11.49 KB, patch)
2014-09-08 18:28 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (12.92 KB, patch)
2014-09-09 15:13 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2014-09-08 18:27:04 PDT
Clean up some ENABLE(PICTURE_SIZES) stuff, don't change function signatures inside #ifdefs
Comment 1 Simon Fraser (smfr) 2014-09-08 18:28:36 PDT
Created attachment 237828 [details]
Patch
Comment 2 Darin Adler 2014-09-08 19:41:51 PDT
Comment on attachment 237828 [details]
Patch

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

> Source/WebCore/html/parser/HTMLDocumentParser.cpp:329
> +        m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL(), document()->renderView(), document()->frame());

Seems bizarre to pass both a RenderView* and a Frame*. Why not just pass a Document& instead? It seems to me that SourceSizeList::parseSizesAttribute should also just take a Document&. And the same for every level in between.
Comment 3 Simon Fraser (smfr) 2014-09-08 23:01:21 PDT
Yes, I thought the same thing. I'll do that.
Comment 4 Simon Fraser (smfr) 2014-09-09 15:13:34 PDT
Created attachment 237862 [details]
Patch
Comment 5 Darin Adler 2014-09-10 08:28:40 PDT
Comment on attachment 237862 [details]
Patch

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

> Source/WebCore/html/parser/HTMLPreloadScanner.cpp:102
>          for (HTMLToken::AttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter) {

Opportunity for new-style for loop.

> Source/WebCore/html/parser/HTMLPreloadScanner.cpp:112
> +            sourceSize = SourceSizeList::parseSizesAttribute(m_sizesAttribute, document.renderView(), document.frame());

I suggest pushing down Document& even further, and changing the interface to SourceSizeList to take Document&.

> Source/WebCore/html/parser/HTMLPreloadScanner.h:50
> +    void scan(const HTMLToken&, PreloadRequestStream& requests, Document&);

I don’t think the argument name “requests” adds anything here.

> Source/WebCore/html/parser/HTMLPreloadScanner.h:130
> +    void scan(HTMLResourcePreloader*, Document&);

Should be HTMLResourcePreloader&.
Comment 6 WebKit Commit Bot 2014-09-10 08:54:47 PDT
Comment on attachment 237862 [details]
Patch

Clearing flags on attachment: 237862

Committed r173464: <http://trac.webkit.org/changeset/173464>
Comment 7 WebKit Commit Bot 2014-09-10 08:54:51 PDT
All reviewed patches have been landed.  Closing bug.