<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[162696] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/162696">162696</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2014-01-24 01:25:21 -0800 (Fri, 24 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move HistoryItem to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=127275
Reviewed by Darin Adler.
Source/WebCore:
Replace the uses of OwnPtr and PassOwnPtr in the HistoryItem class with std::unique_ptr.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::addRedirectURL):
(WebCore::HistoryItem::setRedirectURLs):
* history/HistoryItem.h:
* history/mac/HistoryItemMac.mm:
(WebCore::HistoryItem::setTransientProperty):
WebCore.exp.in: Update the symbol.
Source/WebKit/mac:
* History/WebHistoryItem.mm: The Vector object that's passed to HistoryItem::setRedirectURLs
should now be handled by std::unique_ptr and passed on through move semantics.
(-[WebHistoryItem initFromDictionaryRepresentation:]):
Source/WebKit/win:
* WebHistoryItem.cpp: The Vector object that's passed to HistoryItem::setRedirectURLs
should now be handled by std::unique_ptr and passed on through move semantics.
(WebHistoryItem::initFromDictionaryRepresentation):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemcpp">trunk/Source/WebCore/history/HistoryItem.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemh">trunk/Source/WebCore/history/HistoryItem.h</a></li>
<li><a href="#trunkSourceWebCorehistorymacHistoryItemMacmm">trunk/Source/WebCore/history/mac/HistoryItemMac.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacHistoryWebHistoryItemmm">trunk/Source/WebKit/mac/History/WebHistoryItem.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebHistoryItemcpp">trunk/Source/WebKit/win/WebHistoryItem.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebCore/ChangeLog        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-01-24 Zan Dobersek <zdobersek@igalia.com>
+
+ Move HistoryItem to std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=127275
+
+ Reviewed by Darin Adler.
+
+ Replace the uses of OwnPtr and PassOwnPtr in the HistoryItem class with std::unique_ptr.
+
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::HistoryItem):
+ (WebCore::HistoryItem::reset):
+ (WebCore::HistoryItem::addRedirectURL):
+ (WebCore::HistoryItem::setRedirectURLs):
+ * history/HistoryItem.h:
+ * history/mac/HistoryItemMac.mm:
+ (WebCore::HistoryItem::setTransientProperty):
+ WebCore.exp.in: Update the symbol.
+
</ins><span class="cx"> 2014-01-23 Morten Stenshorne <mstensho@opera.com>
</span><span class="cx">
</span><span class="cx"> Region based multicol: unresolvable percent height results in 1px tall multicol
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> __ZN7WebCore11HistoryItem14addRedirectURLERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11HistoryItem14setScrollPointERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore11HistoryItem15setIsTargetItemEb
</span><del>-__ZN7WebCore11HistoryItem15setRedirectURLsEN3WTF10PassOwnPtrINS1_6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEEEE
</del><ins>+__ZN7WebCore11HistoryItem15setRedirectURLsENSt3__110unique_ptrIN3WTF6VectorINS3_6StringELm0ENS3_15CrashOnOverflowEEENS1_14default_deleteIS7_EEEE
</ins><span class="cx"> __ZN7WebCore11HistoryItem16adoptVisitCountsERN3WTF6VectorIiLm0ENS1_15CrashOnOverflowEEES5_
</span><span class="cx"> __ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore11HistoryItem17setAlternateTitleERKN3WTF6StringE
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.cpp (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.cpp        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebCore/history/HistoryItem.cpp        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> m_children.uncheckedAppend(item.m_children[i]->copy());
</span><span class="cx">
</span><span class="cx"> if (item.m_redirectURLs)
</span><del>- m_redirectURLs = adoptPtr(new Vector<String>(*item.m_redirectURLs));
</del><ins>+ m_redirectURLs = std::make_unique<Vector<String>>(*item.m_redirectURLs);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<HistoryItem> HistoryItem::copy() const
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx"> m_dailyVisitCounts.clear();
</span><span class="cx"> m_weeklyVisitCounts.clear();
</span><span class="cx">
</span><del>- m_redirectURLs.clear();
</del><ins>+ m_redirectURLs = nullptr;
</ins><span class="cx">
</span><span class="cx"> m_itemSequenceNumber = generateSequenceNumber();
</span><span class="cx">
</span><span class="lines">@@ -684,7 +684,7 @@
</span><span class="cx"> void HistoryItem::addRedirectURL(const String& url)
</span><span class="cx"> {
</span><span class="cx"> if (!m_redirectURLs)
</span><del>- m_redirectURLs = adoptPtr(new Vector<String>);
</del><ins>+ m_redirectURLs = std::make_unique<Vector<String>>();
</ins><span class="cx">
</span><span class="cx"> // Our API allows us to store all the URLs in the redirect chain, but for
</span><span class="cx"> // now we only have a use for the final URL.
</span><span class="lines">@@ -697,9 +697,9 @@
</span><span class="cx"> return m_redirectURLs.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HistoryItem::setRedirectURLs(PassOwnPtr<Vector<String>> redirectURLs)
</del><ins>+void HistoryItem::setRedirectURLs(std::unique_ptr<Vector<String>> redirectURLs)
</ins><span class="cx"> {
</span><del>- m_redirectURLs = redirectURLs;
</del><ins>+ m_redirectURLs = std::move(redirectURLs);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HistoryItem::encodeBackForwardTree(Encoder& encoder) const
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.h (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.h        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebCore/history/HistoryItem.h        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -29,8 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "IntPoint.h"
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><del>-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
</del><ins>+#include <memory>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="lines">@@ -181,7 +180,7 @@
</span><span class="cx">
</span><span class="cx"> void addRedirectURL(const String&);
</span><span class="cx"> Vector<String>* redirectURLs() const;
</span><del>- void setRedirectURLs(PassOwnPtr<Vector<String>>);
</del><ins>+ void setRedirectURLs(std::unique_ptr<Vector<String>>);
</ins><span class="cx">
</span><span class="cx"> bool isCurrentDocument(Document*) const;
</span><span class="cx">
</span><span class="lines">@@ -264,7 +263,7 @@
</span><span class="cx"> Vector<int> m_dailyVisitCounts;
</span><span class="cx"> Vector<int> m_weeklyVisitCounts;
</span><span class="cx">
</span><del>- OwnPtr<Vector<String>> m_redirectURLs;
</del><ins>+ std::unique_ptr<Vector<String>> m_redirectURLs;
</ins><span class="cx">
</span><span class="cx"> // If two HistoryItems have the same item sequence number, then they are
</span><span class="cx"> // clones of one another. Traversing history from one such HistoryItem to
</span><span class="lines">@@ -300,7 +299,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> RetainPtr<id> m_viewState;
</span><del>- OwnPtr<HashMap<String, RetainPtr<id>>> m_transientProperties;
</del><ins>+ std::unique_ptr<HashMap<String, RetainPtr<id>>> m_transientProperties;
</ins><span class="cx"> #endif
</span><span class="cx"> }; //class HistoryItem
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehistorymacHistoryItemMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/mac/HistoryItemMac.mm (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/mac/HistoryItemMac.mm        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebCore/history/mac/HistoryItemMac.mm        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx"> if (m_transientProperties) {
</span><span class="cx"> m_transientProperties->remove(key);
</span><span class="cx"> if (m_transientProperties->isEmpty())
</span><del>- m_transientProperties.clear();
</del><ins>+ m_transientProperties = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="cx"> if (!m_transientProperties)
</span><del>- m_transientProperties = adoptPtr(new HashMap<String, RetainPtr<id>>);
</del><ins>+ m_transientProperties = std::make_unique<HashMap<String, RetainPtr<id>>>();
</ins><span class="cx"> m_transientProperties->set(key, value);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-01-24 Zan Dobersek <zdobersek@igalia.com>
+
+ Move HistoryItem to std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=127275
+
+ Reviewed by Darin Adler.
+
+ * History/WebHistoryItem.mm: The Vector object that's passed to HistoryItem::setRedirectURLs
+ should now be handled by std::unique_ptr and passed on through move semantics.
+ (-[WebHistoryItem initFromDictionaryRepresentation:]):
+
</ins><span class="cx"> 2014-01-23 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Move RegularExpression into JavaScriptCore for inspector
</span></span></pre></div>
<a id="trunkSourceWebKitmacHistoryWebHistoryItemmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/History/WebHistoryItem.mm (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/History/WebHistoryItem.mm        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebKit/mac/History/WebHistoryItem.mm        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -388,10 +388,10 @@
</span><span class="cx">
</span><span class="cx"> if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) {
</span><span class="cx"> NSUInteger size = [redirectURLs count];
</span><del>- OwnPtr<Vector<String>> redirectURLsVector = adoptPtr(new Vector<String>(size));
</del><ins>+ auto redirectURLsVector = std::make_unique<Vector<String>>(size);
</ins><span class="cx"> for (NSUInteger i = 0; i < size; ++i)
</span><span class="cx"> (*redirectURLsVector)[i] = String([redirectURLs _webkit_stringAtIndex:i]);
</span><del>- core(_private)->setRedirectURLs(redirectURLsVector.release());
</del><ins>+ core(_private)->setRedirectURLs(std::move(redirectURLsVector));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NSArray *dailyCounts = [dict _webkit_arrayForKey:dailyVisitCountKey];
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebKit/win/ChangeLog        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-01-24 Zan Dobersek <zdobersek@igalia.com>
+
+ Move HistoryItem to std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=127275
+
+ Reviewed by Darin Adler.
+
+ * WebHistoryItem.cpp: The Vector object that's passed to HistoryItem::setRedirectURLs
+ should now be handled by std::unique_ptr and passed on through move semantics.
+ (WebHistoryItem::initFromDictionaryRepresentation):
+
</ins><span class="cx"> 2014-01-23 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Remove recompileAllJSFunctions timer in ScriptDebugServer
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebHistoryItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebHistoryItem.cpp (162695 => 162696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebHistoryItem.cpp        2014-01-24 08:33:35 UTC (rev 162695)
+++ trunk/Source/WebKit/win/WebHistoryItem.cpp        2014-01-24 09:25:21 UTC (rev 162696)
</span><span class="lines">@@ -140,10 +140,10 @@
</span><span class="cx"> return E_FAIL;
</span><span class="cx"> bool lastVisitWasHTTPNonGet = lastVisitWasHTTPNonGetRef && CFBooleanGetValue(lastVisitWasHTTPNonGetRef);
</span><span class="cx">
</span><del>- OwnPtr<Vector<String> > redirectURLsVector;
</del><ins>+ std::unique_ptr<Vector<String>> redirectURLsVector;
</ins><span class="cx"> if (CFArrayRef redirectURLsRef = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, redirectURLsKey))) {
</span><span class="cx"> CFIndex size = CFArrayGetCount(redirectURLsRef);
</span><del>- redirectURLsVector = adoptPtr(new Vector<String>(size));
</del><ins>+ redirectURLsVector = std::make_unique<Vector<String>>(size);
</ins><span class="cx"> for (CFIndex i = 0; i < size; ++i)
</span><span class="cx"> (*redirectURLsVector)[i] = String(static_cast<CFStringRef>(CFArrayGetValueAtIndex(redirectURLsRef, i)));
</span><span class="cx"> }
</span><span class="lines">@@ -190,8 +190,8 @@
</span><span class="cx"> if (lastVisitWasHTTPNonGet && (protocolIs(m_historyItem->urlString(), "http") || protocolIs(m_historyItem->urlString(), "https")))
</span><span class="cx"> m_historyItem->setLastVisitWasHTTPNonGet(true);
</span><span class="cx">
</span><del>- if (redirectURLsVector)
- m_historyItem->setRedirectURLs(redirectURLsVector.release());
</del><ins>+ if (redirectURLsVector.get())
+ m_historyItem->setRedirectURLs(std::move(redirectURLsVector));
</ins><span class="cx">
</span><span class="cx"> if (dailyVector.get())
</span><span class="cx"> m_historyItem->adoptVisitCounts(*dailyVector, *weeklyVector);
</span></span></pre>
</div>
</div>
</body>
</html>