Remove unused history visit code from WebHistoryItem
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jun 2014 17:17:27 +0000 (17:17 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jun 2014 17:17:27 +0000 (17:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134201

Reviewed by Sam Weinig.

* History/HistoryPropertyList.h:
* History/HistoryPropertyList.mm:
(HistoryPropertyListWriter::HistoryPropertyListWriter):
(HistoryPropertyListWriter::writeHistoryItem):
* History/WebHistory.mm:
(-[WebHistoryPrivate visitedURL:withTitle:]):
(-[WebHistoryPrivate addItem:discardDuplicate:]):
(-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
(-[WebHistoryPrivate visitedURL:withTitle:increaseVisitCount:]): Deleted.
(-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]): Deleted.
* History/WebHistoryInternal.h:
* History/WebHistoryItem.mm:
(-[WebHistoryItem copyWithZone:]):
(-[WebHistoryItem initFromDictionaryRepresentation:]):
(-[WebHistoryItem _visitedWithTitle:]):
(-[WebHistoryItem setVisitCount:]): Deleted.
(-[WebHistoryItem _mergeAutoCompleteHints:]): Deleted.
(-[WebHistoryItem _visitedWithTitle:increaseVisitCount:]): Deleted.
(-[WebHistoryItem _recordInitialVisit]): Deleted.
(timeToDay): Deleted.
(-[WebHistoryItem _padDailyCountsForNewVisit:]): Deleted.
(-[WebHistoryItem _collapseDailyVisitsToWeekly]): Deleted.
(-[WebHistoryItem _recordVisitAtTime:increaseVisitCount:]): Deleted.
(-[WebHistoryItem _setLastVisitedTimeInterval:]): Deleted.
* History/WebHistoryItemInternal.h:
* History/WebHistoryItemPrivate.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::updateGlobalHistory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/HistoryPropertyList.h
Source/WebKit/mac/History/HistoryPropertyList.mm
Source/WebKit/mac/History/WebHistory.mm
Source/WebKit/mac/History/WebHistoryInternal.h
Source/WebKit/mac/History/WebHistoryItem.mm
Source/WebKit/mac/History/WebHistoryItemInternal.h
Source/WebKit/mac/History/WebHistoryItemPrivate.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 17f4ab8..b8e3b63 100644 (file)
@@ -1,3 +1,39 @@
+2014-06-23  Anders Carlsson  <andersca@apple.com>
+
+        Remove unused history visit code from WebHistoryItem
+        https://bugs.webkit.org/show_bug.cgi?id=134201
+
+        Reviewed by Sam Weinig.
+
+        * History/HistoryPropertyList.h:
+        * History/HistoryPropertyList.mm:
+        (HistoryPropertyListWriter::HistoryPropertyListWriter):
+        (HistoryPropertyListWriter::writeHistoryItem):
+        * History/WebHistory.mm:
+        (-[WebHistoryPrivate visitedURL:withTitle:]):
+        (-[WebHistoryPrivate addItem:discardDuplicate:]):
+        (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
+        (-[WebHistoryPrivate visitedURL:withTitle:increaseVisitCount:]): Deleted.
+        (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]): Deleted.
+        * History/WebHistoryInternal.h:
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem copyWithZone:]):
+        (-[WebHistoryItem initFromDictionaryRepresentation:]):
+        (-[WebHistoryItem _visitedWithTitle:]):
+        (-[WebHistoryItem setVisitCount:]): Deleted.
+        (-[WebHistoryItem _mergeAutoCompleteHints:]): Deleted.
+        (-[WebHistoryItem _visitedWithTitle:increaseVisitCount:]): Deleted.
+        (-[WebHistoryItem _recordInitialVisit]): Deleted.
+        (timeToDay): Deleted.
+        (-[WebHistoryItem _padDailyCountsForNewVisit:]): Deleted.
+        (-[WebHistoryItem _collapseDailyVisitsToWeekly]): Deleted.
+        (-[WebHistoryItem _recordVisitAtTime:increaseVisitCount:]): Deleted.
+        (-[WebHistoryItem _setLastVisitedTimeInterval:]): Deleted.
+        * History/WebHistoryItemInternal.h:
+        * History/WebHistoryItemPrivate.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::updateGlobalHistory):
+
 2014-06-24  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
 
         REGRESSION(r170235): Remove incorrect ifdef guard
index c31767f..44ef011 100644 (file)
@@ -47,16 +47,12 @@ private:
     virtual void writeObjects(BinaryPropertyListObjectStream&);
     virtual UInt8* buffer(size_t);
 
-    const String m_dailyVisitCountsKey;
     const String m_displayTitleKey;
     const String m_lastVisitWasFailureKey;
-    const String m_lastVisitWasHTTPNonGetKey;
     const String m_lastVisitedDateKey;
     const String m_redirectURLsKey;
     const String m_titleKey;
     const String m_urlKey;
-    const String m_visitCountKey;
-    const String m_weeklyVisitCountsKey;
 
     UInt8* m_buffer;
     size_t m_bufferSize;
index abadee2..c3ff14d 100644 (file)
@@ -34,16 +34,12 @@ using namespace WebCore;
 static const int currentFileVersion = 1;
 
 HistoryPropertyListWriter::HistoryPropertyListWriter()
-    : m_dailyVisitCountsKey("D")
-    , m_displayTitleKey("displayTitle")
+    : m_displayTitleKey("displayTitle")
     , m_lastVisitWasFailureKey("lastVisitWasFailure")
-    , m_lastVisitWasHTTPNonGetKey("lastVisitWasHTTPNonGet")
     , m_lastVisitedDateKey("lastVisitedDate")
     , m_redirectURLsKey("redirectURLs")
     , m_titleKey("title")
     , m_urlKey("")
-    , m_visitCountKey("visitCount")
-    , m_weeklyVisitCountsKey("W")
     , m_buffer(0)
 {
 }
@@ -94,10 +90,7 @@ void HistoryPropertyListWriter::writeHistoryItem(BinaryPropertyListObjectStream&
     const String& title = item->title();
     const String& displayTitle = item->alternateTitle();
     double lastVisitedDate = webHistoryItem->_private->_lastVisitedTime;
-    int visitCount = webHistoryItem->_private->_visitCount;
     Vector<String>* redirectURLs = item->redirectURLs();
-    const Vector<int>& dailyVisitCounts = webHistoryItem->_private->_dailyVisitCounts;
-    const Vector<int>& weeklyVisitCounts = webHistoryItem->_private->_weeklyVisitCounts;
 
     // keys
     stream.writeString(m_urlKey);
@@ -107,18 +100,10 @@ void HistoryPropertyListWriter::writeHistoryItem(BinaryPropertyListObjectStream&
         stream.writeString(m_displayTitleKey);
     if (lastVisitedDate)
         stream.writeString(m_lastVisitedDateKey);
-    if (visitCount)
-        stream.writeString(m_visitCountKey);
     if (item->lastVisitWasFailure())
         stream.writeString(m_lastVisitWasFailureKey);
-    if (webHistoryItem->_private->_lastVisitWasHTTPNonGet)
-        stream.writeString(m_lastVisitWasHTTPNonGetKey);
     if (redirectURLs)
         stream.writeString(m_redirectURLsKey);
-    if (!dailyVisitCounts.isEmpty())
-        stream.writeString(m_dailyVisitCountsKey);
-    if (!weeklyVisitCounts.isEmpty())
-        stream.writeString(m_weeklyVisitCountsKey);
 
     // values
     stream.writeUniqueString(item->urlString());
@@ -131,14 +116,8 @@ void HistoryPropertyListWriter::writeHistoryItem(BinaryPropertyListObjectStream&
         snprintf(buffer, sizeof(buffer), "%.1lf", lastVisitedDate);
         stream.writeUniqueString(buffer);
     }
-    if (visitCount)
-        stream.writeInteger(visitCount);
     if (item->lastVisitWasFailure())
         stream.writeBooleanTrue();
-    if (webHistoryItem->_private->_lastVisitWasHTTPNonGet) {
-        ASSERT(item->urlString().startsWith("http:", false) || item->urlString().startsWith("https:", false));
-        stream.writeBooleanTrue();
-    }
     if (redirectURLs) {
         size_t redirectArrayStart = stream.writeArrayStart();
         size_t size = redirectURLs->size();
@@ -147,10 +126,6 @@ void HistoryPropertyListWriter::writeHistoryItem(BinaryPropertyListObjectStream&
             stream.writeUniqueString(redirectURLs->at(i));
         stream.writeArrayEnd(redirectArrayStart);
     }
-    if (size_t size = dailyVisitCounts.size())
-        stream.writeIntegerArray(dailyVisitCounts.data(), size);
-    if (size_t size = weeklyVisitCounts.size())
-        stream.writeIntegerArray(weeklyVisitCounts.data(), size);
 
     stream.writeDictionaryEnd(itemDictionaryStart);
 }
index 8b73532..8b5407e 100644 (file)
@@ -86,7 +86,7 @@ private:
     int ageInDaysLimit;
 }
 
-- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount;
+- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title;
 
 - (BOOL)addItem:(WebHistoryItem *)entry discardDuplicate:(BOOL)discardDuplicate;
 - (void)addItems:(NSArray *)newEntries;
@@ -301,7 +301,7 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
     }
 }
 
-- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount
+- (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title
 {
     ASSERT(url);
     ASSERT(title);
@@ -318,11 +318,10 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
         BOOL itemWasInDateCaches = [self removeItemFromDateCaches:entry];
         ASSERT_UNUSED(itemWasInDateCaches, itemWasInDateCaches);
 
-        [entry _visitedWithTitle:title increaseVisitCount:increaseVisitCount];
+        [entry _visitedWithTitle:title];
     } else {
         LOG(History, "Adding new global history entry for %@", url);
         entry = [[WebHistoryItem alloc] initWithURLString:URLString title:title lastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]];
-        [entry _recordInitialVisit];
         [_entriesByURL setObject:entry forKey:URLString];
         [entry release];
     }
@@ -349,10 +348,6 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
         // until we're done with oldEntry.
         [oldEntry retain];
         [self removeItemForURLString:URLString];
-
-        // If we already have an item with this URL, we need to merge info that drives the
-        // URL autocomplete heuristics from that item into the new one.
-        [entry _mergeAutoCompleteHints:oldEntry];
         [oldEntry release];
     }
 
@@ -369,10 +364,6 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
             // until we're done with oldEntry.
             [otherEntry retain];
             [self removeItemForURLString:URLString];
-
-            // If we already have an item with this URL, we need to merge info that drives the
-            // URL autocomplete heuristics from that item into the new one.
-            [entry _mergeAutoCompleteHints:otherEntry];
             [otherEntry release];
 
             [self addItemToDateCaches:entry];
@@ -930,16 +921,13 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
 
 @implementation WebHistory (WebInternal)
 
-- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure increaseVisitCount:(BOOL)increaseVisitCount
+- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure
 {
-    WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title increaseVisitCount:increaseVisitCount];
+    WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title];
 
     HistoryItem* item = core(entry);
     item->setLastVisitWasFailure(wasFailure);
 
-    if ([method length])
-        entry->_private->_lastVisitWasHTTPNonGet = [method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]);
-
     item->setRedirectURLs(nullptr);
 
     NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil];
index 68d0946..7fa7b9f 100644 (file)
@@ -33,6 +33,6 @@ namespace WebCore {
 }
 
 @interface WebHistory (WebInternal)
-- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure increaseVisitCount:(BOOL)increaseVisitCount;
+- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure;
 - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group;
 @end
index 0c7b4c7..35cbd01 100644 (file)
@@ -79,15 +79,11 @@ static NSString * const sharedLinkUniqueIdentifierKey = @"sharedLinkUniqueIdenti
 // Private keys used in the WebHistoryItem's dictionary representation.
 // see 3245793 for explanation of "lastVisitedDate"
 static NSString *lastVisitedTimeIntervalKey = @"lastVisitedDate";
-static NSString *visitCountKey = @"visitCount";
 static NSString *titleKey = @"title";
 static NSString *childrenKey = @"children";
 static NSString *displayTitleKey = @"displayTitle";
 static NSString *lastVisitWasFailureKey = @"lastVisitWasFailure";
-static NSString *lastVisitWasHTTPNonGetKey = @"lastVisitWasHTTPNonGet";
 static NSString *redirectURLsKey = @"redirectURLs";
-static NSString *dailyVisitCountKey = @"D"; // short key to save space
-static NSString *weeklyVisitCountKey = @"W"; // short key to save space
 
 // Notification strings.
 NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotification";
@@ -177,11 +173,6 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
     WebHistoryItem *copy = [[[self class] alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
 
     copy->_private->_lastVisitedTime = _private->_lastVisitedTime;
-    copy->_private->_visitCount = _private->_visitCount;
-    copy->_private->_dailyVisitCounts = _private->_dailyVisitCounts;
-    copy->_private->_weeklyVisitCounts = _private->_weeklyVisitCounts;
-
-    copy->_private->_lastVisitWasHTTPNonGet = _private->_lastVisitWasHTTPNonGet;
 
     historyItemWrappers().set(core(copy->_private), copy);
 
@@ -347,27 +338,11 @@ WebHistoryItem *kit(HistoryItem* item)
     core(_private)->setTitle(title);
 }
 
-- (void)setVisitCount:(int)count
-{
-    _private->_visitCount = count;
-}
-
 - (void)setViewState:(id)statePList
 {
     core(_private)->setViewState(statePList);
 }
 
-- (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem
-{
-    ASSERT_ARG(otherItem, 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.
-    if (otherItem != self)
-        _private->_visitCount += otherItem->_private->_visitCount;
-}
-
 - (id)initFromDictionaryRepresentation:(NSDictionary *)dict
 {
     ASSERT_MAIN_THREAD();
@@ -391,23 +366,9 @@ WebHistoryItem *kit(HistoryItem* item)
         core(_private)->setOriginalURLString(newURLString);
     } 
 
-    int visitCount = [dict _webkit_intForKey:visitCountKey];
-    
-    // Can't trust data on disk, and we've had at least one report of this (<rdar://6572300>).
-    if (visitCount < 0) {
-        LOG_ERROR("visit count for history item \"%@\" is negative (%d), will be reset to 1", URLString, visitCount);
-        visitCount = 1;
-    }
-    _private->_visitCount = visitCount;
-
     if ([dict _webkit_boolForKey:lastVisitWasFailureKey])
         core(_private)->setLastVisitWasFailure(true);
     
-    BOOL lastVisitWasHTTPNonGet = [dict _webkit_boolForKey:lastVisitWasHTTPNonGetKey];
-    NSString *tempURLString = [URLString lowercaseString];
-    if (lastVisitWasHTTPNonGet && ([tempURLString hasPrefix:@"http:"] || [tempURLString hasPrefix:@"https:"]))
-        _private->_lastVisitWasHTTPNonGet = lastVisitWasHTTPNonGet;
-
     if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) {
         NSUInteger size = [redirectURLs count];
         auto redirectURLsVector = std::make_unique<Vector<String>>(size);
@@ -416,22 +377,6 @@ WebHistoryItem *kit(HistoryItem* item)
         core(_private)->setRedirectURLs(std::move(redirectURLsVector));
     }
 
-    NSArray *dailyCounts = [dict _webkit_arrayForKey:dailyVisitCountKey];
-    NSArray *weeklyCounts = [dict _webkit_arrayForKey:weeklyVisitCountKey];
-    if (dailyCounts || weeklyCounts) {
-        Vector<int> coreDailyCounts([dailyCounts count]);
-        Vector<int> coreWeeklyCounts([weeklyCounts count]);
-
-        // Daily and weekly counts < 0 are errors in the data read from disk, so reset to 0.
-        for (size_t i = 0; i < coreDailyCounts.size(); ++i)
-            coreDailyCounts[i] = std::max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0);
-        for (size_t i = 0; i < coreWeeklyCounts.size(); ++i)
-            coreWeeklyCounts[i] = std::max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0);
-
-        _private->_dailyVisitCounts = std::move(coreDailyCounts);
-        _private->_weeklyVisitCounts = std::move(coreWeeklyCounts);
-    }
-
     NSArray *childDicts = [dict objectForKey:childrenKey];
     if (childDicts) {
         for (int i = [childDicts count] - 1; i >= 0; i--) {
@@ -473,70 +418,10 @@ WebHistoryItem *kit(HistoryItem* item)
     return core(_private)->scrollPoint();
 }
 
-- (void)_visitedWithTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount
+- (void)_visitedWithTitle:(NSString *)title
 {
     core(_private)->setTitle(title);
-
-    [self _recordVisitAtTime:[NSDate timeIntervalSinceReferenceDate] increaseVisitCount:increaseVisitCount];
-}
-
-- (void)_recordInitialVisit
-{
-    ASSERT(!_private->_visitCount);
-    [self _recordVisitAtTime:_private->_lastVisitedTime increaseVisitCount:YES];
-}
-
-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];
+    _private->_lastVisitedTime = [NSDate timeIntervalSinceReferenceDate];
 }
 
 @end
@@ -548,14 +433,6 @@ static const size_t maxWeeklyCounts = 5;
     return [self initWithURLString:[URL _web_originalDataAsString] title:title lastVisitedTimeInterval:0];
 }
 
-// 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];
-}
-
 // FIXME: The only iOS difference here should be whether YES or NO is passed to dictionaryRepresentationIncludingChildren:
 #if PLATFORM(IOS)
 - (NSDictionary *)dictionaryRepresentation
@@ -584,14 +461,8 @@ static const size_t maxWeeklyCounts = 5;
         [dict setObject:[NSString stringWithFormat:@"%.1lf", _private->_lastVisitedTime]
                  forKey:lastVisitedTimeIntervalKey];
     }
-    if (_private->_visitCount)
-        [dict setObject:[NSNumber numberWithInt:_private->_visitCount] forKey:visitCountKey];
     if (coreItem->lastVisitWasFailure())
         [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey];
-    if (_private->_lastVisitWasHTTPNonGet) {
-        ASSERT(coreItem->urlString().startsWith("http:", false) || coreItem->urlString().startsWith("https:", false));
-        [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasHTTPNonGetKey];
-    }
     if (Vector<String>* redirectURLs = coreItem->redirectURLs()) {
         size_t size = redirectURLs->size();
         ASSERT(size);
@@ -602,24 +473,6 @@ static const size_t maxWeeklyCounts = 5;
         [result release];
     }
     
-    const Vector<int>& dailyVisitCounts = _private->_dailyVisitCounts;
-    if (dailyVisitCounts.size()) {
-        NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:13];
-        for (size_t i = 0; i < dailyVisitCounts.size(); ++i)
-            [array addObject:[NSNumber numberWithInt:dailyVisitCounts[i]]];
-        [dict setObject:array forKey:dailyVisitCountKey];
-        [array release];
-    }
-    
-    const Vector<int>& weeklyVisitCounts = _private->_weeklyVisitCounts;
-    if (weeklyVisitCounts.size()) {
-        NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5];
-        for (size_t i = 0; i < weeklyVisitCounts.size(); ++i)
-            [array addObject:[NSNumber numberWithInt:weeklyVisitCounts[i]]];
-        [dict setObject:array forKey:weeklyVisitCountKey];
-        [array release];
-    }    
-
 #if PLATFORM(IOS)
     if (includesChildren && coreItem->children().size()) {
 #else
@@ -668,12 +521,6 @@ static const size_t maxWeeklyCounts = 5;
     return core(_private)->isTargetItem();
 }
 
-- (int)visitCount
-{
-    ASSERT_MAIN_THREAD();
-    return _private->_visitCount;
-}
-
 - (NSString *)RSSFeedReferrer
 {
     return nsStringNilIfEmpty(core(_private)->referrer());
@@ -741,16 +588,6 @@ static const size_t maxWeeklyCounts = 5;
     return core(_private)->lastVisitWasFailure();
 }
 
-- (void)_setLastVisitWasFailure:(BOOL)failure
-{
-    core(_private)->setLastVisitWasFailure(failure);
-}
-
-- (BOOL)_lastVisitWasHTTPNonGet
-{
-    return _private->_lastVisitWasHTTPNonGet;
-}
-
 - (NSArray *)_redirectURLs
 {
     Vector<String>* redirectURLs = core(_private)->redirectURLs();
@@ -765,18 +602,6 @@ static const size_t maxWeeklyCounts = 5;
     return [result autorelease];
 }
 
-- (size_t)_getDailyVisitCounts:(const int**)counts
-{
-    *counts = _private->_dailyVisitCounts.data();
-    return _private->_dailyVisitCounts.size();
-}
-
-- (size_t)_getWeeklyVisitCounts:(const int**)counts
-{
-    *counts = _private->_weeklyVisitCounts.data();
-    return _private->_weeklyVisitCounts.size();
-}
-
 #if PLATFORM(IOS)
 - (void)_setScale:(float)scale isInitial:(BOOL)aFlag
 {
index bac1795..1a12760 100644 (file)
@@ -49,10 +49,8 @@ extern void WKNotifyHistoryItemChanged(WebCore::HistoryItem*);
 - (id)initFromDictionaryRepresentation:(NSDictionary *)dict;
 - (id)initWithWebCoreHistoryItem:(PassRefPtr<WebCore::HistoryItem>)item;
 
-- (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem;
 - (void)setTitle:(NSString *)title;
-- (void)_visitedWithTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount;
-- (void)_recordInitialVisit;
+- (void)_visitedWithTitle:(NSString *)title;
 
 @end
 
@@ -65,10 +63,5 @@ extern void WKNotifyHistoryItemChanged(WebCore::HistoryItem*);
     RefPtr<WebCore::HistoryItem> _historyItem;
 
     NSTimeInterval _lastVisitedTime;
-    int _visitCount;
-    Vector<int> _dailyVisitCounts;
-    Vector<int> _weeklyVisitCounts;
-
-    bool _lastVisitWasHTTPNonGet;
 }
 @end
index e8869be..5197051 100644 (file)
@@ -49,11 +49,7 @@ extern NSString *WebViewportMinimalUIKey;
 - (id)initWithURL:(NSURL *)URL title:(NSString *)title;
 
 - (NSURL *)URL;
-- (int)visitCount;
 - (BOOL)lastVisitWasFailure;
-- (void)_setLastVisitWasFailure:(BOOL)failure;
-
-- (BOOL)_lastVisitWasHTTPNonGet;
 
 - (NSString *)RSSFeedReferrer;
 - (void)setRSSFeedReferrer:(NSString *)referrer;
@@ -69,17 +65,11 @@ extern NSString *WebViewportMinimalUIKey;
 - (NSDictionary *)dictionaryRepresentationIncludingChildren:(BOOL)includesChildren;
 #endif
 
-// This should not be called directly for WebHistoryItems that are already included
-// in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
-- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time;
 // Transient properties may be of any ObjC type.  They are intended to be used to store state per back/forward list entry.
 // The properties will not be persisted; when the history item is removed, the properties will be lost.
 - (id)_transientPropertyForKey:(NSString *)key;
 - (void)_setTransientProperty:(id)property forKey:(NSString *)key;
 
-- (size_t)_getDailyVisitCounts:(const int**)counts;
-- (size_t)_getWeeklyVisitCounts:(const int**)counts;
-
 #if TARGET_OS_IPHONE
 - (void)_setScale:(float)scale isInitial:(BOOL)aFlag;
 - (float)_scale;
index 3c1fb58..8dbdae3 100644 (file)
@@ -1017,11 +1017,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
         return;
     }
 
-    [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() 
-                                          withTitle:loader->title().string()
-                                             method:loader->originalRequestCopy().httpMethod()
-                                         wasFailure:loader->urlForHistoryReflectsFailure()
-                                 increaseVisitCount:!loader->clientRedirectSourceForHistory()]; // Do not increase visit count due to navigations that were not initiated by the user directly, avoiding growth from programmatic reloads.
+    [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() withTitle:loader->title().string() method:loader->originalRequestCopy().httpMethod() wasFailure:loader->urlForHistoryReflectsFailure()];
 }
 
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()