Bug 127236

Summary: Modernize HTML parser code
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbates, esprehn+autocc, gyuyoung.kim, japhet
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

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>