Bug 127236 - Modernize HTML parser code
Summary: Modernize HTML parser code
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: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-18 14:27 PST by Anders Carlsson
Modified: 2014-01-18 14:44 PST (History)
5 users (show)

See Also:


Attachments
Patch (37.67 KB, patch)
2014-01-18 14:28 PST, Anders Carlsson
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2014-01-18 14:27:41 PST
Modernize HTML parser code
Comment 1 Anders Carlsson 2014-01-18 14:28:25 PST
Created attachment 221571 [details]
Patch
Comment 2 Andreas Kling 2014-01-18 14:35:48 PST
Comment on attachment 221571 [details]
Patch

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

r=me

> Source/WebCore/html/parser/CSSPreloadScanner.cpp:214
> -            OwnPtr<PreloadRequest> request = PreloadRequest::create("css", url, baseElementURL, CachedResource::CSSStyleSheet);
> +
> +            auto request = std::make_unique<PreloadRequest>("css", url, baseElementURL, CachedResource::CSSStyleSheet, String());
>              // FIXME: Should this be including the charset in the preload request?
> -            m_requests->append(request.release());
> +            m_requests->append(std::move(request));

I'd lose the temporary.

> Source/WebCore/html/parser/HTMLDocumentParser.cpp:388
> -            m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url(), document()->deviceScaleFactor()));
> +            m_insertionPreloadScanner = std::make_unique< HTMLPreloadScanner>(m_options, document()->url(), document()->deviceScaleFactor());

Extra space after < here.

> Source/WebCore/html/parser/HTMLResourcePreloader.cpp:66
>  void HTMLResourcePreloader::takeAndPreload(PreloadRequestStream& r)
>  {
> -    PreloadRequestStream requests;
> -    requests.swap(r);
> +    PreloadRequestStream requests = std::move(r);

This is a bit awkward.
Comment 3 Anders Carlsson 2014-01-18 14:44:29 PST
Committed r162275: <http://trac.webkit.org/changeset/162275>