Bug 127275 - Move HistoryItem to std::unique_ptr
Summary: Move HistoryItem to std::unique_ptr
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: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 02:20 PST by Zan Dobersek
Modified: 2014-01-24 01:28 PST (History)
1 user (show)

See Also:


Attachments
Patch (4.76 KB, patch)
2014-01-20 02:23 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (4.71 KB, patch)
2014-01-20 22:30 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (9.25 KB, patch)
2014-01-23 09:51 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (10.12 KB, patch)
2014-01-23 11:01 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (10.26 KB, patch)
2014-01-23 13:16 PST, Zan Dobersek
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2014-01-20 02:20:17 PST
Move HistoryItem to std::unique_ptr
Comment 1 Zan Dobersek 2014-01-20 02:23:16 PST
Created attachment 221638 [details]
Patch
Comment 2 Zan Dobersek 2014-01-20 22:30:09 PST
Created attachment 221720 [details]
Patch
Comment 3 Brent Fulgham 2014-01-21 12:02:02 PST
Comment on attachment 221720 [details]
Patch

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

Looks good, but is missing necessary changes in Mac and Windows code. r- for these build failures.

> Source/WebCore/history/HistoryItem.cpp:225
> +    m_redirectURLs = nullptr;

You need to make a similar change in history/mac/HistoryItemMac.mm.

> Source/WebCore/history/HistoryItem.h:183
> +    void setRedirectURLs(std::unique_ptr<Vector<String>>);

Some Windows code (WebKit/win/WebHistoryItem.cpp) still thinks this argument is a PassOwnPtr.
Comment 4 Zan Dobersek 2014-01-23 09:51:37 PST
Created attachment 221994 [details]
Patch
Comment 5 Zan Dobersek 2014-01-23 11:01:37 PST
Created attachment 222003 [details]
Patch

Removed the HistoryItem::setRedirectURLs symbol that's listing PassOwnPtr<Vector> as the parameter, will likely have to replace it with an updated one.
Comment 6 Zan Dobersek 2014-01-23 13:16:58 PST
Created attachment 222021 [details]
Patch
Comment 7 Darin Adler 2014-01-23 16:38:58 PST
Comment on attachment 222021 [details]
Patch

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

> Source/WebKit/mac/History/WebHistoryItem.mm:391
> +        std::unique_ptr<Vector<String>> redirectURLsVector = std::make_unique<Vector<String>>(size);

Seems like a good place to use auto:

    auto redirectURLsVector = std::make_unique<Vector<String>>(size);
Comment 8 Zan Dobersek 2014-01-24 01:20:54 PST
Committed r162696: <http://trac.webkit.org/changeset/162696>
Comment 9 Zan Dobersek 2014-01-24 01:28:16 PST
Comment on attachment 222021 [details]
Patch

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

>> Source/WebKit/mac/History/WebHistoryItem.mm:391
>> +        std::unique_ptr<Vector<String>> redirectURLsVector = std::make_unique<Vector<String>>(size);
> 
> Seems like a good place to use auto:
> 
>     auto redirectURLsVector = std::make_unique<Vector<String>>(size);

Addressed this before landing.