Changeset 207300 in webkit


Ignore:
Timestamp:
Oct 13, 2016 12:15:23 PM (7 years ago)
Author:
andersca@apple.com
Message:

Get rid of the HistoryItemVector typedef
https://bugs.webkit.org/show_bug.cgi?id=163398

Reviewed by Beth Dakin.

Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.

Source/WebCore:

  • history/BackForwardList.cpp:

(WebCore::BackForwardList::backListWithLimit):
(WebCore::BackForwardList::forwardListWithLimit):
(WebCore::BackForwardList::entries):

  • history/BackForwardList.h:
  • history/HistoryItem.cpp:

(WebCore::HistoryItem::children):

  • history/HistoryItem.h:
  • loader/HistoryController.cpp:

(WebCore::HistoryController::currentFramesMatchItem):

Source/WebKit/mac:

  • History/WebBackForwardList.mm:

(-[WebBackForwardList dictionaryRepresentation]):
(vectorToNSArray):
(-[WebBackForwardList backListWithLimit:]):
(-[WebBackForwardList forwardListWithLimit:]):
(-[WebBackForwardList description]):

  • History/WebHistoryItem.mm:

(-[WebHistoryItem description]):

Source/WebKit/win:

  • WebBackForwardList.cpp:

(WebBackForwardList::backListWithLimit):
(WebBackForwardList::forwardListWithLimit):

  • WebHistoryItem.cpp:

(WebHistoryItem::children):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207299 r207300  
     12016-10-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Get rid of the HistoryItemVector typedef
     4        https://bugs.webkit.org/show_bug.cgi?id=163398
     5
     6        Reviewed by Beth Dakin.
     7
     8        Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
     9
     10        * history/BackForwardList.cpp:
     11        (WebCore::BackForwardList::backListWithLimit):
     12        (WebCore::BackForwardList::forwardListWithLimit):
     13        (WebCore::BackForwardList::entries):
     14        * history/BackForwardList.h:
     15        * history/HistoryItem.cpp:
     16        (WebCore::HistoryItem::children):
     17        * history/HistoryItem.h:
     18        * loader/HistoryController.cpp:
     19        (WebCore::HistoryController::currentFramesMatchItem):
     20
    1212016-10-13  Antoine Quint  <graouts@apple.com>
    222
  • trunk/Source/WebCore/history/BackForwardList.cpp

    r194496 r207300  
    137137}
    138138
    139 void BackForwardList::backListWithLimit(int limit, HistoryItemVector& list)
     139void BackForwardList::backListWithLimit(int limit, Vector<Ref<HistoryItem>>& list)
    140140{
    141141    list.clear();
     
    147147}
    148148
    149 void BackForwardList::forwardListWithLimit(int limit, HistoryItemVector& list)
     149void BackForwardList::forwardListWithLimit(int limit, Vector<Ref<HistoryItem>>& list)
    150150{
    151151    ASSERT(limit > -1);
     
    221221}
    222222
    223 HistoryItemVector& BackForwardList::entries()
     223Vector<Ref<HistoryItem>>& BackForwardList::entries()
    224224{
    225225    return m_entries;
  • trunk/Source/WebCore/history/BackForwardList.h

    r197563 r207300  
    3737class Page;
    3838
    39 typedef Vector<Ref<HistoryItem>> HistoryItemVector;
    4039typedef HashSet<RefPtr<HistoryItem>> HistoryItemHashSet;
    4140
     
    5756    HistoryItem* itemAtIndex(int) override;
    5857
    59     WEBCORE_EXPORT void backListWithLimit(int, HistoryItemVector&);
    60     WEBCORE_EXPORT void forwardListWithLimit(int, HistoryItemVector&);
     58    WEBCORE_EXPORT void backListWithLimit(int, Vector<Ref<HistoryItem>>&);
     59    WEBCORE_EXPORT void forwardListWithLimit(int, Vector<Ref<HistoryItem>>&);
    6160
    6261    WEBCORE_EXPORT int capacity();
     
    7271
    7372    WEBCORE_EXPORT void removeItem(HistoryItem*);
    74     WEBCORE_EXPORT HistoryItemVector& entries();
     73    WEBCORE_EXPORT Vector<Ref<HistoryItem>>& entries();
    7574
    7675#if PLATFORM(IOS)
     
    8584
    8685    Page* m_page;
    87     HistoryItemVector m_entries;
     86    Vector<Ref<HistoryItem>> m_entries;
    8887    HistoryItemHashSet m_entryHash;
    8988    unsigned m_current;
  • trunk/Source/WebCore/history/HistoryItem.cpp

    r199233 r207300  
    369369}
    370370
    371 const HistoryItemVector& HistoryItem::children() const
     371const Vector<Ref<HistoryItem>>& HistoryItem::children() const
    372372{
    373373    return m_children;
  • trunk/Source/WebCore/history/HistoryItem.h

    r206976 r207300  
    5757enum class PruningReason;
    5858
    59 typedef Vector<Ref<HistoryItem>> HistoryItemVector;
    60 
    6159WEBCORE_EXPORT extern void (*notifyHistoryItemChanged)(HistoryItem*);
    6260
     
    144142    WEBCORE_EXPORT HistoryItem* childItemWithTarget(const String&);
    145143    HistoryItem* childItemWithDocumentSequenceNumber(long long number);
    146     WEBCORE_EXPORT const HistoryItemVector& children() const;
     144    WEBCORE_EXPORT const Vector<Ref<HistoryItem>>& children() const;
    147145    WEBCORE_EXPORT bool hasChildren() const;
    148146    void clearChildren();
     
    234232    ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy { ShouldOpenExternalURLsPolicy::ShouldNotAllow };
    235233   
    236     HistoryItemVector m_children;
     234    Vector<Ref<HistoryItem>> m_children;
    237235   
    238236    bool m_lastVisitWasFailure;
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r205818 r207300  
    787787        return false;
    788788       
    789     const HistoryItemVector& childItems = item->children();
     789    const auto& childItems = item->children();
    790790    if (childItems.size() != m_frame.tree().childCount())
    791791        return false;
  • trunk/Source/WebKit/mac/ChangeLog

    r207279 r207300  
     12016-10-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Get rid of the HistoryItemVector typedef
     4        https://bugs.webkit.org/show_bug.cgi?id=163398
     5
     6        Reviewed by Beth Dakin.
     7
     8        Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
     9
     10        * History/WebBackForwardList.mm:
     11        (-[WebBackForwardList dictionaryRepresentation]):
     12        (vectorToNSArray):
     13        (-[WebBackForwardList backListWithLimit:]):
     14        (-[WebBackForwardList forwardListWithLimit:]):
     15        (-[WebBackForwardList description]):
     16        * History/WebHistoryItem.mm:
     17        (-[WebHistoryItem description]):
     18
    1192016-10-12  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebKit/mac/History/WebBackForwardList.mm

    r204466 r207300  
    161161    BackForwardList *coreBFList = core(self);
    162162   
    163     HistoryItemVector& historyItems = coreBFList->entries();
     163    auto& historyItems = coreBFList->entries();
    164164    unsigned size = historyItems.size();
    165165    NSMutableArray *entriesArray = [[NSMutableArray alloc] initWithCapacity:size];
     
    233233}
    234234
    235 static NSArray* vectorToNSArray(HistoryItemVector& list)
     235static NSArray* vectorToNSArray(Vector<Ref<HistoryItem>>& list)
    236236{
    237237    unsigned size = list.size();
     
    257257- (NSArray *)backListWithLimit:(int)limit
    258258{
    259     HistoryItemVector list;
     259    Vector<Ref<HistoryItem>> list;
    260260    core(self)->backListWithLimit(limit, list);
    261261    NSArray *result = vectorToNSArray(list);
     
    272272- (NSArray *)forwardListWithLimit:(int)limit
    273273{
    274     HistoryItemVector list;
     274    Vector<Ref<HistoryItem>> list;
    275275    core(self)->forwardListWithLimit(limit, list);
    276276    NSArray *result = vectorToNSArray(list);
     
    306306   
    307307    BackForwardList* backForwardList = core(self);
    308     HistoryItemVector& entries = backForwardList->entries();
     308    auto& entries = backForwardList->entries();
    309309   
    310310    unsigned size = entries.size();
  • trunk/Source/WebKit/mac/History/WebHistoryItem.mm

    r198289 r207300  
    236236   
    237237    if (coreItem->children().size()) {
    238         const HistoryItemVector& children = coreItem->children();
     238        const auto& children = coreItem->children();
    239239        int currPos = [result length];
    240240        unsigned size = children.size();       
     
    457457    if (coreItem->children().size()) {
    458458#endif
    459         const HistoryItemVector& children = coreItem->children();
     459        const auto& children = coreItem->children();
    460460        NSMutableArray *childDicts = [NSMutableArray arrayWithCapacity:children.size()];
    461461       
     
    511511- (NSArray *)children
    512512{
    513     const HistoryItemVector& children = core(_private)->children();
     513    const auto& children = core(_private)->children();
    514514    if (!children.size())
    515515        return nil;
  • trunk/Source/WebKit/win/ChangeLog

    r207231 r207300  
     12016-10-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Get rid of the HistoryItemVector typedef
     4        https://bugs.webkit.org/show_bug.cgi?id=163398
     5
     6        Reviewed by Beth Dakin.
     7
     8        Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
     9
     10        * WebBackForwardList.cpp:
     11        (WebBackForwardList::backListWithLimit):
     12        (WebBackForwardList::forwardListWithLimit):
     13        * WebHistoryItem.cpp:
     14        (WebHistoryItem::children):
     15
    1162016-10-12  Brent Fulgham  <bfulgham@apple.com>
    217
  • trunk/Source/WebKit/win/WebBackForwardList.cpp

    r188662 r207300  
    195195    __deref_inout_opt IWebHistoryItem** list)
    196196{
    197     HistoryItemVector historyItemVector;
     197    Vector<Ref<HistoryItem>> historyItemVector;
    198198    m_backForwardList->backListWithLimit(limit, historyItemVector);
    199199
     
    212212    __deref_inout_opt IWebHistoryItem** list)
    213213{
    214     HistoryItemVector historyItemVector;
     214    Vector<Ref<HistoryItem>> historyItemVector;
    215215    m_backForwardList->forwardListWithLimit(limit, historyItemVector);
    216216
  • trunk/Source/WebKit/win/WebHistoryItem.cpp

    r194496 r207300  
    290290    *outChildren = 0;
    291291
    292     const HistoryItemVector& coreChildren = m_historyItem->children();
     292    const auto& coreChildren = m_historyItem->children();
    293293    if (coreChildren.isEmpty())
    294294        return S_OK;
Note: See TracChangeset for help on using the changeset viewer.