Bug 163398 - Get rid of the HistoryItemVector typedef
Summary: Get rid of the HistoryItemVector typedef
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 11:46 PDT by Anders Carlsson
Modified: 2016-10-13 12:29 PDT (History)
4 users (show)

See Also:


Attachments
Patch (13.34 KB, patch)
2016-10-13 11:48 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (13.33 KB, patch)
2016-10-13 12:11 PDT, Anders Carlsson
bdakin: 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 2016-10-13 11:46:52 PDT
Get rid of the HistoryItemVector typedef
Comment 1 Anders Carlsson 2016-10-13 11:48:15 PDT
Created attachment 291501 [details]
Patch
Comment 2 Anders Carlsson 2016-10-13 12:11:03 PDT
Created attachment 291504 [details]
Patch
Comment 3 Darin Adler 2016-10-13 12:16:32 PDT
Comment on attachment 291504 [details]
Patch

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

> Source/WebCore/history/BackForwardList.h:59
> +    WEBCORE_EXPORT void backListWithLimit(int, Vector<Ref<HistoryItem>>&);
> +    WEBCORE_EXPORT void forwardListWithLimit(int, Vector<Ref<HistoryItem>>&);

Shouldn't these be return values instead of out arguments?

> Source/WebCore/loader/HistoryController.cpp:789
> +    const auto& childItems = item->children();

I would have just used auto& here.

> Source/WebKit/mac/History/WebHistoryItem.mm:238
> +        const auto& children = coreItem->children();

Ditto.

> Source/WebKit/mac/History/WebHistoryItem.mm:459
> +        const auto& children = coreItem->children();

Ditto.

> Source/WebKit/mac/History/WebHistoryItem.mm:513
> +    const auto& children = core(_private)->children();

Ditto.

> Source/WebKit/win/WebHistoryItem.cpp:292
> +    const auto& coreChildren = m_historyItem->children();

Ditto.
Comment 4 Anders Carlsson 2016-10-13 12:18:01 PDT
Committed r207300: <http://trac.webkit.org/changeset/207300>
Comment 5 Anders Carlsson 2016-10-13 12:29:05 PDT
(In reply to comment #3)
> Comment on attachment 291504 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=291504&action=review
> 
> > Source/WebCore/history/BackForwardList.h:59
> > +    WEBCORE_EXPORT void backListWithLimit(int, Vector<Ref<HistoryItem>>&);
> > +    WEBCORE_EXPORT void forwardListWithLimit(int, Vector<Ref<HistoryItem>>&);
> 
> Shouldn't these be return values instead of out arguments?
> 
> > Source/WebCore/loader/HistoryController.cpp:789
> > +    const auto& childItems = item->children();
> 
> I would have just used auto& here.
> 
> > Source/WebKit/mac/History/WebHistoryItem.mm:238
> > +        const auto& children = coreItem->children();
> 
> Ditto.
> 
> > Source/WebKit/mac/History/WebHistoryItem.mm:459
> > +        const auto& children = coreItem->children();
> 
> Ditto.
> 
> > Source/WebKit/mac/History/WebHistoryItem.mm:513
> > +    const auto& children = core(_private)->children();
> 
> Ditto.
> 
> > Source/WebKit/win/WebHistoryItem.cpp:292
> > +    const auto& coreChildren = m_historyItem->children();
> 
> Ditto.

I intend to change this code more, a lot of these are probably going away.