<!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>[162808] 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/162808">162808</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-01-26 14:22:05 -0800 (Sun, 26 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move history item visit count handling to WebKit
https://bugs.webkit.org/show_bug.cgi?id=127659
Reviewed by Dan Bernstein.
Source/WebCore:
Remove all members dealing with visit handling - they're going back to WebKit.
* WebCore.exp.in:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::decodeBackForwardTree):
* history/HistoryItem.h:
(WebCore::HistoryItem::create):
Source/WebKit/mac:
Move code to deal with visit count and visit dates here from WebCore.
* History/HistoryPropertyList.mm:
(HistoryPropertyListWriter::writeHistoryItem):
* History/WebHistoryItem.mm:
(-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
(-[WebHistoryItem copyWithZone:]):
(-[WebHistoryItem lastVisitedTimeInterval]):
(-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
(-[WebHistoryItem setVisitCount:]):
(-[WebHistoryItem _mergeAutoCompleteHints:]):
(-[WebHistoryItem initFromDictionaryRepresentation:]):
(-[WebHistoryItem _visitedWithTitle:increaseVisitCount:]):
(-[WebHistoryItem _recordInitialVisit]):
(timeToDay):
(-[WebHistoryItem _padDailyCountsForNewVisit:]):
(-[WebHistoryItem _collapseDailyVisitsToWeekly]):
(-[WebHistoryItem _recordVisitAtTime:increaseVisitCount:]):
(-[WebHistoryItem _setLastVisitedTimeInterval:]):
* History/WebHistoryItemInternal.h:</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="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacHistoryHistoryPropertyListmm">trunk/Source/WebKit/mac/History/HistoryPropertyList.mm</a></li>
<li><a href="#trunkSourceWebKitmacHistoryWebHistoryItemmm">trunk/Source/WebKit/mac/History/WebHistoryItem.mm</a></li>
<li><a href="#trunkSourceWebKitmacHistoryWebHistoryItemInternalh">trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebCore/ChangeLog        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2014-01-26 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><ins>+ Move history item visit count handling to WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=127659
+
+ Reviewed by Dan Bernstein.
+
+ Remove all members dealing with visit handling - they're going back to WebKit.
+
+ * WebCore.exp.in:
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::HistoryItem):
+ (WebCore::HistoryItem::reset):
+ (WebCore::HistoryItem::decodeBackForwardTree):
+ * history/HistoryItem.h:
+ (WebCore::HistoryItem::create):
+
+2014-01-26 Anders Carlsson <andersca@apple.com>
+
</ins><span class="cx"> Move lastVisitWasHTTPNonGet out to WebHistoryItem
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=127657
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -147,25 +147,19 @@
</span><span class="cx"> __ZN7WebCore11HistoryItem12addChildItemEN3WTF10PassRefPtrIS0_EE
</span><span class="cx"> __ZN7WebCore11HistoryItem12setURLStringERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11HistoryItem12setViewStateEP11objc_object
</span><del>-__ZN7WebCore11HistoryItem13setVisitCountEi
</del><span class="cx"> __ZN7WebCore11HistoryItem14addRedirectURLERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11HistoryItem14setScrollPointERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore11HistoryItem15setIsTargetItemEb
</span><span class="cx"> __ZN7WebCore11HistoryItem15setRedirectURLsENSt3__110unique_ptrIN3WTF6VectorINS3_6StringELm0ENS3_15CrashOnOverflowEEENS1_14default_deleteIS7_EEEE
</span><del>-__ZN7WebCore11HistoryItem16adoptVisitCountsERN3WTF6VectorIiLm0ENS1_15CrashOnOverflowEEES5_
</del><span class="cx"> __ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore11HistoryItem17setAlternateTitleERKN3WTF6StringE
</span><del>-__ZN7WebCore11HistoryItem18recordInitialVisitEv
-__ZN7WebCore11HistoryItem18setLastVisitedTimeEd
</del><span class="cx"> __ZN7WebCore11HistoryItem20setOriginalURLStringERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11HistoryItem20setTransientPropertyERKN3WTF6StringEP11objc_object
</span><span class="cx"> __ZN7WebCore11HistoryItem21decodeBackForwardTreeERKN3WTF6StringES4_S4_RNS1_7DecoderE
</span><del>-__ZN7WebCore11HistoryItem22mergeAutoCompleteHintsEPS0_
-__ZN7WebCore11HistoryItem7visitedERKN3WTF6StringEdNS_18VisitCountBehaviorE
</del><span class="cx"> __ZN7WebCore11HistoryItem8formDataEv
</span><span class="cx"> __ZN7WebCore11HistoryItem8setTitleERKN3WTF6StringE
</span><del>-__ZN7WebCore11HistoryItemC1ERKN3WTF6StringES4_S4_d
-__ZN7WebCore11HistoryItemC1ERKN3WTF6StringES4_d
</del><ins>+__ZN7WebCore11HistoryItemC1ERKN3WTF6StringES4_
+__ZN7WebCore11HistoryItemC1ERKN3WTF6StringES4_S4_
</ins><span class="cx"> __ZN7WebCore11HistoryItemC1ERKNS_3URLERKN3WTF6StringES7_S7_
</span><span class="cx"> __ZN7WebCore11HistoryItemC1Ev
</span><span class="cx"> __ZN7WebCore11HistoryItemD1Ev
</span><span class="lines">@@ -1438,7 +1432,6 @@
</span><span class="cx"> __ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
</span><span class="cx"> __ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
</span><span class="cx"> __ZNK7WebCore11FrameLoader8loadTypeEv
</span><del>-__ZNK7WebCore11HistoryItem10visitCountEv
</del><span class="cx"> __ZNK7WebCore11HistoryItem11hasChildrenEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem11originalURLEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem11scrollPointEv
</span><span class="lines">@@ -1446,7 +1439,6 @@
</span><span class="cx"> __ZNK7WebCore11HistoryItem12redirectURLsEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem13documentStateEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem14alternateTitleEv
</span><del>-__ZNK7WebCore11HistoryItem15lastVisitedTimeEv
</del><span class="cx"> __ZNK7WebCore11HistoryItem15pageScaleFactorEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem17originalURLStringEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem19childItemWithTargetERKN3WTF6StringE
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.cpp (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.cpp        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebCore/history/HistoryItem.cpp        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -60,11 +60,9 @@
</span><span class="cx"> void (*notifyHistoryItemChanged)(HistoryItem*) = defaultNotifyHistoryItemChanged;
</span><span class="cx">
</span><span class="cx"> HistoryItem::HistoryItem()
</span><del>- : m_lastVisitedTime(0)
- , m_pageScaleFactor(0)
</del><ins>+ : m_pageScaleFactor(0)
</ins><span class="cx"> , m_lastVisitWasFailure(false)
</span><span class="cx"> , m_isTargetItem(false)
</span><del>- , m_visitCount(0)
</del><span class="cx"> , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_next(0)
</span><span class="lines">@@ -77,15 +75,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-HistoryItem::HistoryItem(const String& urlString, const String& title, double time)
</del><ins>+HistoryItem::HistoryItem(const String& urlString, const String& title)
</ins><span class="cx"> : m_urlString(urlString)
</span><span class="cx"> , m_originalURLString(urlString)
</span><span class="cx"> , m_title(title)
</span><del>- , m_lastVisitedTime(time)
</del><span class="cx"> , m_pageScaleFactor(0)
</span><span class="cx"> , m_lastVisitWasFailure(false)
</span><span class="cx"> , m_isTargetItem(false)
</span><del>- , m_visitCount(0)
</del><span class="cx"> , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_next(0)
</span><span class="lines">@@ -99,16 +95,14 @@
</span><span class="cx"> iconDatabase().retainIconForPageURL(m_urlString);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double time)
</del><ins>+HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle)
</ins><span class="cx"> : m_urlString(urlString)
</span><span class="cx"> , m_originalURLString(urlString)
</span><span class="cx"> , m_title(title)
</span><span class="cx"> , m_displayTitle(alternateTitle)
</span><del>- , m_lastVisitedTime(time)
</del><span class="cx"> , m_pageScaleFactor(0)
</span><span class="cx"> , m_lastVisitWasFailure(false)
</span><span class="cx"> , m_isTargetItem(false)
</span><del>- , m_visitCount(0)
</del><span class="cx"> , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_next(0)
</span><span class="lines">@@ -128,11 +122,9 @@
</span><span class="cx"> , m_target(target)
</span><span class="cx"> , m_parent(parent)
</span><span class="cx"> , m_title(title)
</span><del>- , m_lastVisitedTime(0)
</del><span class="cx"> , m_pageScaleFactor(0)
</span><span class="cx"> , m_lastVisitWasFailure(false)
</span><span class="cx"> , m_isTargetItem(false)
</span><del>- , m_visitCount(0)
</del><span class="cx"> , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx"> , m_next(0)
</span><span class="lines">@@ -161,14 +153,10 @@
</span><span class="cx"> , m_parent(item.m_parent)
</span><span class="cx"> , m_title(item.m_title)
</span><span class="cx"> , m_displayTitle(item.m_displayTitle)
</span><del>- , m_lastVisitedTime(item.m_lastVisitedTime)
</del><span class="cx"> , m_scrollPoint(item.m_scrollPoint)
</span><span class="cx"> , m_pageScaleFactor(item.m_pageScaleFactor)
</span><span class="cx"> , m_lastVisitWasFailure(item.m_lastVisitWasFailure)
</span><span class="cx"> , m_isTargetItem(item.m_isTargetItem)
</span><del>- , m_visitCount(item.m_visitCount)
- , m_dailyVisitCounts(item.m_dailyVisitCounts)
- , m_weeklyVisitCounts(item.m_weeklyVisitCounts)
</del><span class="cx"> , m_itemSequenceNumber(item.m_itemSequenceNumber)
</span><span class="cx"> , m_documentSequenceNumber(item.m_documentSequenceNumber)
</span><span class="cx"> , m_formContentType(item.m_formContentType)
</span><span class="lines">@@ -208,13 +196,8 @@
</span><span class="cx"> m_title = String();
</span><span class="cx"> m_displayTitle = String();
</span><span class="cx">
</span><del>- m_lastVisitedTime = 0;
-
</del><span class="cx"> m_lastVisitWasFailure = false;
</span><span class="cx"> m_isTargetItem = false;
</span><del>- m_visitCount = 0;
- m_dailyVisitCounts.clear();
- m_weeklyVisitCounts.clear();
</del><span class="cx">
</span><span class="cx"> m_redirectURLs = nullptr;
</span><span class="cx">
</span><span class="lines">@@ -256,11 +239,6 @@
</span><span class="cx"> return m_cachedPage ? m_cachedPage->hasExpired() : false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double HistoryItem::lastVisitedTime() const
-{
- return m_lastVisitedTime;
-}
-
</del><span class="cx"> URL HistoryItem::url() const
</span><span class="cx"> {
</span><span class="cx"> return URL(ParsedURLString, m_urlString);
</span><span class="lines">@@ -339,94 +317,6 @@
</span><span class="cx"> m_parent = parent;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline int timeToDay(double time)
-{
- return static_cast<int>(ceil(time / secondsPerDay));
-}
-
-void HistoryItem::padDailyCountsForNewVisit(double time)
-{
- if (m_dailyVisitCounts.isEmpty())
- m_dailyVisitCounts.insert(0, m_visitCount);
-
- int daysElapsed = timeToDay(time) - timeToDay(m_lastVisitedTime);
-
- if (daysElapsed < 0)
- daysElapsed = 0;
-
- Vector<int, 32> padding;
- padding.fill(0, daysElapsed);
- m_dailyVisitCounts.insertVector(0, padding);
-}
-
-static const size_t daysPerWeek = 7;
-static const size_t maxDailyCounts = 2 * daysPerWeek - 1;
-static const size_t maxWeeklyCounts = 5;
-
-void HistoryItem::collapseDailyVisitsToWeekly()
-{
- while (m_dailyVisitCounts.size() > maxDailyCounts) {
- int oldestWeekTotal = 0;
- for (size_t i = 0; i < daysPerWeek; i++)
- oldestWeekTotal += m_dailyVisitCounts[m_dailyVisitCounts.size() - daysPerWeek + i];
- m_dailyVisitCounts.shrink(m_dailyVisitCounts.size() - daysPerWeek);
- m_weeklyVisitCounts.insert(0, oldestWeekTotal);
- }
-
- if (m_weeklyVisitCounts.size() > maxWeeklyCounts)
- m_weeklyVisitCounts.shrink(maxWeeklyCounts);
-}
-
-void HistoryItem::recordVisitAtTime(double time, VisitCountBehavior visitCountBehavior)
-{
- padDailyCountsForNewVisit(time);
-
- m_lastVisitedTime = time;
-
- if (visitCountBehavior == IncreaseVisitCount) {
- ++m_visitCount;
- ++m_dailyVisitCounts[0];
- }
-
- collapseDailyVisitsToWeekly();
-}
-
-void HistoryItem::setLastVisitedTime(double time)
-{
- if (m_lastVisitedTime != time)
- recordVisitAtTime(time);
-}
-
-void HistoryItem::visited(const String& title, double time, VisitCountBehavior visitCountBehavior)
-{
- m_title = title;
- recordVisitAtTime(time, visitCountBehavior);
-}
-
-int HistoryItem::visitCount() const
-{
- return m_visitCount;
-}
-
-void HistoryItem::recordInitialVisit()
-{
- ASSERT(!m_visitCount);
- recordVisitAtTime(m_lastVisitedTime);
-}
-
-void HistoryItem::setVisitCount(int count)
-{
- m_visitCount = count;
-}
-
-void HistoryItem::adoptVisitCounts(Vector<int>& dailyCounts, Vector<int>& weeklyCounts)
-{
- m_dailyVisitCounts.clear();
- m_dailyVisitCounts.swap(dailyCounts);
- m_weeklyVisitCounts.clear();
- m_weeklyVisitCounts.swap(weeklyCounts);
-}
-
</del><span class="cx"> const IntPoint& HistoryItem::scrollPoint() const
</span><span class="cx"> {
</span><span class="cx"> return m_scrollPoint;
</span><span class="lines">@@ -665,16 +555,6 @@
</span><span class="cx"> return equalIgnoringFragmentIdentifier(url(), doc->url());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HistoryItem::mergeAutoCompleteHints(HistoryItem* otherItem)
-{
- // FIXME: this is broken - we should be merging the daily counts
- // somehow. but this is to support API that's not really used in
- // practice so leave it broken for now.
- ASSERT(otherItem);
- if (otherItem != this)
- m_visitCount += otherItem->m_visitCount;
-}
-
</del><span class="cx"> void HistoryItem::addRedirectURL(const String& url)
</span><span class="cx"> {
</span><span class="cx"> if (!m_redirectURLs)
</span><span class="lines">@@ -825,7 +705,7 @@
</span><span class="cx"> Vector<DecodeRecursionStackElement, 16> recursionStack;
</span><span class="cx">
</span><span class="cx"> recurse:
</span><del>- RefPtr<HistoryItem> node = create(urlString, title, 0);
</del><ins>+ RefPtr<HistoryItem> node = create(urlString, title);
</ins><span class="cx">
</span><span class="cx"> node->setOriginalURLString(originalURLString);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.h (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.h        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebCore/history/HistoryItem.h        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -58,23 +58,18 @@
</span><span class="cx">
</span><span class="cx"> extern void (*notifyHistoryItemChanged)(HistoryItem*);
</span><span class="cx">
</span><del>-enum VisitCountBehavior {
- IncreaseVisitCount,
- DoNotIncreaseVisitCount
-};
-
</del><span class="cx"> class HistoryItem : public RefCounted<HistoryItem> {
</span><span class="cx"> friend class PageCache;
</span><span class="cx">
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<HistoryItem> create() { return adoptRef(new HistoryItem); }
</span><del>- static PassRefPtr<HistoryItem> create(const String& urlString, const String& title, double lastVisited)
</del><ins>+ static PassRefPtr<HistoryItem> create(const String& urlString, const String& title)
</ins><span class="cx"> {
</span><del>- return adoptRef(new HistoryItem(urlString, title, lastVisited));
</del><ins>+ return adoptRef(new HistoryItem(urlString, title));
</ins><span class="cx"> }
</span><del>- static PassRefPtr<HistoryItem> create(const String& urlString, const String& title, const String& alternateTitle, double lastVisited)
</del><ins>+ static PassRefPtr<HistoryItem> create(const String& urlString, const String& title, const String& alternateTitle)
</ins><span class="cx"> {
</span><del>- return adoptRef(new HistoryItem(urlString, title, alternateTitle, lastVisited));
</del><ins>+ return adoptRef(new HistoryItem(urlString, title, alternateTitle));
</ins><span class="cx"> }
</span><span class="cx"> static PassRefPtr<HistoryItem> create(const URL& url, const String& target, const String& parent, const String& title)
</span><span class="cx"> {
</span><span class="lines">@@ -99,9 +94,7 @@
</span><span class="cx">
</span><span class="cx"> bool isInPageCache() const { return m_cachedPage.get(); }
</span><span class="cx"> bool hasCachedPageExpired() const;
</span><del>-
- double lastVisitedTime() const;
-
</del><ins>+
</ins><span class="cx"> void setAlternateTitle(const String& alternateTitle);
</span><span class="cx"> const String& alternateTitle() const;
</span><span class="cx">
</span><span class="lines">@@ -115,11 +108,8 @@
</span><span class="cx"> FormData* formData();
</span><span class="cx"> String formContentType() const;
</span><span class="cx">
</span><del>- int visitCount() const;
</del><span class="cx"> bool lastVisitWasFailure() const { return m_lastVisitWasFailure; }
</span><span class="cx">
</span><del>- void mergeAutoCompleteHints(HistoryItem* otherItem);
-
</del><span class="cx"> const IntPoint& scrollPoint() const;
</span><span class="cx"> void setScrollPoint(const IntPoint&);
</span><span class="cx"> void clearScrollPoint();
</span><span class="lines">@@ -153,9 +143,6 @@
</span><span class="cx"> void setFormData(PassRefPtr<FormData>);
</span><span class="cx"> void setFormContentType(const String&);
</span><span class="cx">
</span><del>- void recordInitialVisit();
-
- void setVisitCount(int);
</del><span class="cx"> void setLastVisitWasFailure(bool wasFailure) { m_lastVisitWasFailure = wasFailure; }
</span><span class="cx">
</span><span class="cx"> void addChildItem(PassRefPtr<HistoryItem>);
</span><span class="lines">@@ -171,11 +158,6 @@
</span><span class="cx"> bool shouldDoSameDocumentNavigationTo(HistoryItem* otherItem) const;
</span><span class="cx"> bool hasSameFrames(HistoryItem* otherItem) const;
</span><span class="cx">
</span><del>- // This should not be called directly for HistoryItems that are already included
- // in GlobalHistory. The WebKit api for this is to use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
- void setLastVisitedTime(double);
- void visited(const String& title, double time, VisitCountBehavior);
-
</del><span class="cx"> void addRedirectURL(const String&);
</span><span class="cx"> Vector<String>* redirectURLs() const;
</span><span class="cx"> void setRedirectURLs(std::unique_ptr<Vector<String>>);
</span><span class="lines">@@ -197,10 +179,6 @@
</span><span class="cx"> int showTreeWithIndent(unsigned indentLevel) const;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- void adoptVisitCounts(Vector<int>& dailyCounts, Vector<int>& weeklyCounts);
- const Vector<int>& dailyVisitCounts() const { return m_dailyVisitCounts; }
- const Vector<int>& weeklyVisitCounts() const { return m_weeklyVisitCounts; }
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> float scale() const { return m_scale; }
</span><span class="cx"> bool scaleIsInitial() const { return m_scaleIsInitial; }
</span><span class="lines">@@ -221,16 +199,12 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> HistoryItem();
</span><del>- HistoryItem(const String& urlString, const String& title, double lastVisited);
- HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double lastVisited);
</del><ins>+ HistoryItem(const String& urlString, const String& title);
+ HistoryItem(const String& urlString, const String& title, const String& alternateTitle);
</ins><span class="cx"> HistoryItem(const URL& url, const String& frameName, const String& parent, const String& title);
</span><span class="cx">
</span><span class="cx"> explicit HistoryItem(const HistoryItem&);
</span><span class="cx">
</span><del>- void padDailyCountsForNewVisit(double time);
- void collapseDailyVisitsToWeekly();
- void recordVisitAtTime(double, VisitCountBehavior = IncreaseVisitCount);
-
</del><span class="cx"> bool hasSameDocumentTree(HistoryItem* otherItem) const;
</span><span class="cx">
</span><span class="cx"> HistoryItem* findTargetItem();
</span><span class="lines">@@ -246,8 +220,6 @@
</span><span class="cx"> String m_title;
</span><span class="cx"> String m_displayTitle;
</span><span class="cx">
</span><del>- double m_lastVisitedTime;
-
</del><span class="cx"> IntPoint m_scrollPoint;
</span><span class="cx"> float m_pageScaleFactor;
</span><span class="cx"> Vector<String> m_documentState;
</span><span class="lines">@@ -256,9 +228,6 @@
</span><span class="cx">
</span><span class="cx"> bool m_lastVisitWasFailure;
</span><span class="cx"> bool m_isTargetItem;
</span><del>- int m_visitCount;
- Vector<int> m_dailyVisitCounts;
- Vector<int> m_weeklyVisitCounts;
</del><span class="cx">
</span><span class="cx"> std::unique_ptr<Vector<String>> m_redirectURLs;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2014-01-26 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><ins>+ Move history item visit count handling to WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=127659
+
+ Reviewed by Dan Bernstein.
+
+ Move code to deal with visit count and visit dates here from WebCore.
+
+ * History/HistoryPropertyList.mm:
+ (HistoryPropertyListWriter::writeHistoryItem):
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
+ (-[WebHistoryItem copyWithZone:]):
+ (-[WebHistoryItem lastVisitedTimeInterval]):
+ (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
+ (-[WebHistoryItem setVisitCount:]):
+ (-[WebHistoryItem _mergeAutoCompleteHints:]):
+ (-[WebHistoryItem initFromDictionaryRepresentation:]):
+ (-[WebHistoryItem _visitedWithTitle:increaseVisitCount:]):
+ (-[WebHistoryItem _recordInitialVisit]):
+ (timeToDay):
+ (-[WebHistoryItem _padDailyCountsForNewVisit:]):
+ (-[WebHistoryItem _collapseDailyVisitsToWeekly]):
+ (-[WebHistoryItem _recordVisitAtTime:increaseVisitCount:]):
+ (-[WebHistoryItem _setLastVisitedTimeInterval:]):
+ * History/WebHistoryItemInternal.h:
+
+2014-01-26 Anders Carlsson <andersca@apple.com>
+
</ins><span class="cx"> Fix build.
</span><span class="cx">
</span><span class="cx"> Pass a WebHistoryItem to writeHistoryItem so we can extract _lastVisitWasHTTPNonGet from it.
</span></span></pre></div>
<a id="trunkSourceWebKitmacHistoryHistoryPropertyListmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/History/HistoryPropertyList.mm (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/History/HistoryPropertyList.mm        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebKit/mac/History/HistoryPropertyList.mm        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -93,11 +93,11 @@
</span><span class="cx">
</span><span class="cx"> const String& title = item->title();
</span><span class="cx"> const String& displayTitle = item->alternateTitle();
</span><del>- double lastVisitedDate = item->lastVisitedTime();
- int visitCount = item->visitCount();
</del><ins>+ double lastVisitedDate = webHistoryItem->_private->_lastVisitedTime;
+ int visitCount = webHistoryItem->_private->_visitCount;
</ins><span class="cx"> Vector<String>* redirectURLs = item->redirectURLs();
</span><del>- const Vector<int>& dailyVisitCounts = item->dailyVisitCounts();
- const Vector<int>& weeklyVisitCounts = item->weeklyVisitCounts();
</del><ins>+ const Vector<int>& dailyVisitCounts = webHistoryItem->_private->_dailyVisitCounts;
+ const Vector<int>& weeklyVisitCounts = webHistoryItem->_private->_weeklyVisitCounts;
</ins><span class="cx">
</span><span class="cx"> // keys
</span><span class="cx"> stream.writeString(m_urlKey);
</span></span></pre></div>
<a id="trunkSourceWebKitmacHistoryWebHistoryItemmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/History/WebHistoryItem.mm (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/History/WebHistoryItem.mm        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebKit/mac/History/WebHistoryItem.mm        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -141,7 +141,11 @@
</span><span class="cx"> - (instancetype)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time
</span><span class="cx"> {
</span><span class="cx"> WebCoreThreadViolationCheckRoundOne();
</span><del>- return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)];
</del><ins>+
+ WebHistoryItem *item = [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title)];
+ item->_private->_lastVisitedTime = time;
+
+ return item;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)dealloc
</span><span class="lines">@@ -172,6 +176,11 @@
</span><span class="cx"> WebCoreThreadViolationCheckRoundOne();
</span><span class="cx"> WebHistoryItem *copy = [[[self class] alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
</span><span class="cx">
</span><ins>+ copy->_private->_lastVisitedTime = _private->_lastVisitedTime;
+ copy->_private->_visitCount = _private->_visitCount;
+ copy->_private->_dailyVisitCounts = _private->_dailyVisitCounts;
+ copy->_private->_weeklyVisitCounts = _private->_weeklyVisitCounts;
+
</ins><span class="cx"> copy->_private->_lastVisitWasHTTPNonGet = _private->_lastVisitWasHTTPNonGet;
</span><span class="cx">
</span><span class="cx"> historyItemWrappers().set(core(copy->_private), copy);
</span><span class="lines">@@ -220,7 +229,7 @@
</span><span class="cx"> - (NSTimeInterval)lastVisitedTimeInterval
</span><span class="cx"> {
</span><span class="cx"> ASSERT_MAIN_THREAD();
</span><del>- return core(_private)->lastVisitedTime();
</del><ins>+ return _private->_lastVisitedTime;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSUInteger)hash
</span><span class="lines">@@ -271,10 +280,6 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-@end
-
-@implementation WebHistoryItem (WebInternal)
-
</del><span class="cx"> HistoryItem* core(WebHistoryItem *item)
</span><span class="cx"> {
</span><span class="cx"> if (!item)
</span><span class="lines">@@ -309,7 +314,11 @@
</span><span class="cx">
</span><span class="cx"> - (id)initWithURLString:(NSString *)URLString title:(NSString *)title displayTitle:(NSString *)displayTitle lastVisitedTimeInterval:(NSTimeInterval)time
</span><span class="cx"> {
</span><del>- return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, displayTitle, time)];
</del><ins>+ WebHistoryItem *item = [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, displayTitle)];
+
+ item->_private->_lastVisitedTime = time;
+
+ return item;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (id)initWithWebCoreHistoryItem:(PassRefPtr<HistoryItem>)item
</span><span class="lines">@@ -340,7 +349,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)setVisitCount:(int)count
</span><span class="cx"> {
</span><del>- core(_private)->setVisitCount(count);
</del><ins>+ _private->_visitCount = count;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)setViewState:(id)statePList
</span><span class="lines">@@ -351,7 +360,12 @@
</span><span class="cx"> - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem
</span><span class="cx"> {
</span><span class="cx"> ASSERT_ARG(otherItem, otherItem);
</span><del>- core(_private)->mergeAutoCompleteHints(core(otherItem->_private));
</del><ins>+
+ // FIXME: this is broken - we should be merging the daily counts
+ // somehow. but this is to support API that's not really used in
+ // practice so leave it broken for now.
+ if (otherItem != self)
+ _private->_visitCount += otherItem->_private->_visitCount;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (id)initFromDictionaryRepresentation:(NSDictionary *)dict
</span><span class="lines">@@ -384,7 +398,7 @@
</span><span class="cx"> LOG_ERROR("visit count for history item \"%@\" is negative (%d), will be reset to 1", URLString, visitCount);
</span><span class="cx"> visitCount = 1;
</span><span class="cx"> }
</span><del>- core(_private)->setVisitCount(visitCount);
</del><ins>+ _private->_visitCount = visitCount;
</ins><span class="cx">
</span><span class="cx"> if ([dict _webkit_boolForKey:lastVisitWasFailureKey])
</span><span class="cx"> core(_private)->setLastVisitWasFailure(true);
</span><span class="lines">@@ -413,8 +427,9 @@
</span><span class="cx"> coreDailyCounts[i] = std::max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0);
</span><span class="cx"> for (size_t i = 0; i < coreWeeklyCounts.size(); ++i)
</span><span class="cx"> coreWeeklyCounts[i] = std::max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0);
</span><del>-
- core(_private)->adoptVisitCounts(coreDailyCounts, coreWeeklyCounts);
</del><ins>+
+ _private->_dailyVisitCounts = std::move(coreDailyCounts);
+ _private->_weeklyVisitCounts = std::move(coreWeeklyCounts);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NSArray *childDicts = [dict objectForKey:childrenKey];
</span><span class="lines">@@ -460,14 +475,70 @@
</span><span class="cx">
</span><span class="cx"> - (void)_visitedWithTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount
</span><span class="cx"> {
</span><del>- core(_private)->visited(title, [NSDate timeIntervalSinceReferenceDate], increaseVisitCount ? IncreaseVisitCount : DoNotIncreaseVisitCount);
</del><ins>+ core(_private)->setTitle(title);
+
+ [self _recordVisitAtTime:[NSDate timeIntervalSinceReferenceDate] increaseVisitCount:increaseVisitCount];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_recordInitialVisit
</span><span class="cx"> {
</span><del>- core(_private)->recordInitialVisit();
</del><ins>+ ASSERT(!_private->_visitCount);
+ [self _recordVisitAtTime:_private->_lastVisitedTime increaseVisitCount:YES];
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline int timeToDay(double time)
+{
+ return static_cast<int>(ceil(time / secondsPerDay));
+}
+
+- (void)_padDailyCountsForNewVisit:(NSTimeInterval)time
+{
+ if (_private->_dailyVisitCounts.isEmpty())
+ _private->_dailyVisitCounts.insert(0, _private->_visitCount);
+
+ int daysElapsed = timeToDay(time) - timeToDay(_private->_lastVisitedTime);
+
+ if (daysElapsed < 0)
+ daysElapsed = 0;
+
+ Vector<int, 32> padding;
+ padding.fill(0, daysElapsed);
+
+ _private->_dailyVisitCounts.insertVector(0, padding);
+}
+
+static const size_t daysPerWeek = 7;
+static const size_t maxDailyCounts = 2 * daysPerWeek - 1;
+static const size_t maxWeeklyCounts = 5;
+
+- (void)_collapseDailyVisitsToWeekly
+{
+ while (_private->_dailyVisitCounts.size() > maxDailyCounts) {
+ int oldestWeekTotal = 0;
+ for (size_t i = 0; i < daysPerWeek; i++)
+ oldestWeekTotal += _private->_dailyVisitCounts[_private->_dailyVisitCounts.size() - daysPerWeek + i];
+ _private->_dailyVisitCounts.shrink(_private->_dailyVisitCounts.size() - daysPerWeek);
+ _private->_weeklyVisitCounts.insert(0, oldestWeekTotal);
+ }
+
+ if (_private->_weeklyVisitCounts.size() > maxWeeklyCounts)
+ _private->_weeklyVisitCounts.shrink(maxWeeklyCounts);
+}
+
+- (void)_recordVisitAtTime:(NSTimeInterval)time increaseVisitCount:(BOOL)increaseVisitCount
+{
+ [self _padDailyCountsForNewVisit:time];
+
+ _private->_lastVisitedTime = time;
+
+ if (increaseVisitCount) {
+ ++_private->_visitCount;
+ ++_private->_dailyVisitCounts[0];
+ }
+
+ [self _collapseDailyVisitsToWeekly];
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation WebHistoryItem (WebPrivate)
</span><span class="lines">@@ -477,6 +548,14 @@
</span><span class="cx"> return [self initWithURLString:[URL _web_originalDataAsString] title:title lastVisitedTimeInterval:0];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// This should not be called directly for WebHistoryItems that are already included
+// in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
+- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time
+{
+ if (_private->_lastVisitedTime != time)
+ [self _recordVisitAtTime:time increaseVisitCount:YES];
+}
+
</ins><span class="cx"> // FIXME: The only iOS difference here should be whether YES or NO is passed to dictionaryRepresentationIncludingChildren:
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> - (NSDictionary *)dictionaryRepresentation
</span><span class="lines">@@ -500,13 +579,13 @@
</span><span class="cx"> [dict setObject:(NSString*)coreItem->title() forKey:titleKey];
</span><span class="cx"> if (!coreItem->alternateTitle().isEmpty())
</span><span class="cx"> [dict setObject:(NSString*)coreItem->alternateTitle() forKey:displayTitleKey];
</span><del>- if (coreItem->lastVisitedTime() != 0.0) {
</del><ins>+ if (_private->_lastVisitedTime) {
</ins><span class="cx"> // Store as a string to maintain backward compatibility. (See 3245793)
</span><del>- [dict setObject:[NSString stringWithFormat:@"%.1lf", coreItem->lastVisitedTime()]
</del><ins>+ [dict setObject:[NSString stringWithFormat:@"%.1lf", _private->_lastVisitedTime]
</ins><span class="cx"> forKey:lastVisitedTimeIntervalKey];
</span><span class="cx"> }
</span><del>- if (coreItem->visitCount())
- [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey:visitCountKey];
</del><ins>+ if (_private->_visitCount)
+ [dict setObject:[NSNumber numberWithInt:_private->_visitCount] forKey:visitCountKey];
</ins><span class="cx"> if (coreItem->lastVisitWasFailure())
</span><span class="cx"> [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey];
</span><span class="cx"> if (_private->_lastVisitWasHTTPNonGet) {
</span><span class="lines">@@ -523,7 +602,7 @@
</span><span class="cx"> [result release];
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const Vector<int>& dailyVisitCounts = coreItem->dailyVisitCounts();
</del><ins>+ const Vector<int>& dailyVisitCounts = _private->_dailyVisitCounts;
</ins><span class="cx"> if (dailyVisitCounts.size()) {
</span><span class="cx"> NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:13];
</span><span class="cx"> for (size_t i = 0; i < dailyVisitCounts.size(); ++i)
</span><span class="lines">@@ -532,7 +611,7 @@
</span><span class="cx"> [array release];
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const Vector<int>& weeklyVisitCounts = coreItem->weeklyVisitCounts();
</del><ins>+ const Vector<int>& weeklyVisitCounts = _private->_weeklyVisitCounts;
</ins><span class="cx"> if (weeklyVisitCounts.size()) {
</span><span class="cx"> NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5];
</span><span class="cx"> for (size_t i = 0; i < weeklyVisitCounts.size(); ++i)
</span><span class="lines">@@ -592,7 +671,7 @@
</span><span class="cx"> - (int)visitCount
</span><span class="cx"> {
</span><span class="cx"> ASSERT_MAIN_THREAD();
</span><del>- return core(_private)->visitCount();
</del><ins>+ return _private->_visitCount;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSString *)RSSFeedReferrer
</span><span class="lines">@@ -635,13 +714,6 @@
</span><span class="cx"> return url;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// This should not be called directly for WebHistoryItems that are already included
-// in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
-- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time
-{
- core(_private)->setLastVisitedTime(time);
-}
-
</del><span class="cx"> - (WebHistoryItem *)targetItem
</span><span class="cx"> {
</span><span class="cx"> ASSERT_MAIN_THREAD();
</span><span class="lines">@@ -695,16 +767,14 @@
</span><span class="cx">
</span><span class="cx"> - (size_t)_getDailyVisitCounts:(const int**)counts
</span><span class="cx"> {
</span><del>- HistoryItem* coreItem = core(_private);
- *counts = coreItem->dailyVisitCounts().data();
- return coreItem->dailyVisitCounts().size();
</del><ins>+ *counts = _private->_dailyVisitCounts.data();
+ return _private->_dailyVisitCounts.size();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (size_t)_getWeeklyVisitCounts:(const int**)counts
</span><span class="cx"> {
</span><del>- HistoryItem* coreItem = core(_private);
- *counts = coreItem->weeklyVisitCounts().data();
- return coreItem->weeklyVisitCounts().size();
</del><ins>+ *counts = _private->_weeklyVisitCounts.data();
+ return _private->_weeklyVisitCounts.size();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKitmacHistoryWebHistoryItemInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h (162807 => 162808)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h        2014-01-26 21:32:59 UTC (rev 162807)
+++ trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h        2014-01-26 22:22:05 UTC (rev 162808)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #import "WebBackForwardList.h"
</span><span class="cx"> #import "WebHistoryItemPrivate.h"
</span><span class="cx"> #import <wtf/RefPtr.h>
</span><ins>+#import <wtf/Vector.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class HistoryItem;
</span><span class="lines">@@ -39,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> extern void WKNotifyHistoryItemChanged(WebCore::HistoryItem*);
</span><span class="cx">
</span><del>-@interface WebHistoryItem (WebInternal)
</del><ins>+@interface WebHistoryItem ()
</ins><span class="cx">
</span><span class="cx"> + (WebHistoryItem *)entryWithURL:(NSURL *)URL;
</span><span class="cx">
</span><span class="lines">@@ -63,6 +64,11 @@
</span><span class="cx"> @package
</span><span class="cx"> RefPtr<WebCore::HistoryItem> _historyItem;
</span><span class="cx">
</span><ins>+ NSTimeInterval _lastVisitedTime;
+ int _visitCount;
+ Vector<int> _dailyVisitCounts;
+ Vector<int> _weeklyVisitCounts;
+
</ins><span class="cx"> bool _lastVisitWasHTTPNonGet;
</span><span class="cx"> }
</span><span class="cx"> @end
</span></span></pre>
</div>
</div>
</body>
</html>