Title: [162814] trunk/Source/WebKit/win
Revision
162814
Author
[email protected]
Date
2014-01-26 14:52:17 -0800 (Sun, 26 Jan 2014)

Log Message

Remove even more Windows history code.

* WebHistory.cpp:
(WebHistory::removeItemForURLString):
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
(WebHistoryItem::dictionaryRepresentation):
(WebHistoryItem::getDailyVisitCounts):
(WebHistoryItem::getWeeklyVisitCounts):
(WebHistoryItem::recordInitialVisit):
(WebHistoryItem::initWithURLString):

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (162813 => 162814)


--- trunk/Source/WebKit/win/ChangeLog	2014-01-26 22:46:32 UTC (rev 162813)
+++ trunk/Source/WebKit/win/ChangeLog	2014-01-26 22:52:17 UTC (rev 162814)
@@ -1,5 +1,19 @@
 2014-01-26  Anders Carlsson  <[email protected]>
 
+        Remove even more Windows history code.
+
+        * WebHistory.cpp:
+        (WebHistory::removeItemForURLString):
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+        (WebHistoryItem::dictionaryRepresentation):
+        (WebHistoryItem::getDailyVisitCounts):
+        (WebHistoryItem::getWeeklyVisitCounts):
+        (WebHistoryItem::recordInitialVisit):
+        (WebHistoryItem::initWithURLString):
+
+2014-01-26  Anders Carlsson  <[email protected]>
+
         Another follow-up build fix.
 
         * WebHistory.cpp:

Modified: trunk/Source/WebKit/win/WebHistory.cpp (162813 => 162814)


--- trunk/Source/WebKit/win/WebHistory.cpp	2014-01-26 22:46:32 UTC (rev 162813)
+++ trunk/Source/WebKit/win/WebHistory.cpp	2014-01-26 22:52:17 UTC (rev 162814)
@@ -553,7 +553,7 @@
     if (!m_entriesByURL.size())
         PageGroup::removeAllVisitedLinks();
 
-    return hr;
+    return S_OK;
 }
 
 COMPtr<IWebHistoryItem> WebHistory::itemForURLString(const String& urlString) const

Modified: trunk/Source/WebKit/win/WebHistoryItem.cpp (162813 => 162814)


--- trunk/Source/WebKit/win/WebHistoryItem.cpp	2014-01-26 22:46:32 UTC (rev 162813)
+++ trunk/Source/WebKit/win/WebHistoryItem.cpp	2014-01-26 22:52:17 UTC (rev 162814)
@@ -92,11 +92,8 @@
 
 static CFStringRef urlKey = CFSTR("");
 static CFStringRef titleKey = CFSTR("title");
-static CFStringRef visitCountKey = CFSTR("visitCount");
 static CFStringRef lastVisitWasFailureKey = CFSTR("lastVisitWasFailure");
 static CFStringRef redirectURLsKey = CFSTR("redirectURLs");
-static CFStringRef dailyVisitCountKey = CFSTR("D"); // short key to save space
-static CFStringRef weeklyVisitCountKey = CFSTR("W"); // short key to save space
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::initFromDictionaryRepresentation(void* dictionary)
 {
@@ -110,19 +107,6 @@
     if (titleRef && CFGetTypeID(titleRef) != CFStringGetTypeID())
         return E_FAIL;
 
-    CFNumberRef visitCountRef = (CFNumberRef) CFDictionaryGetValue(dictionaryRef, visitCountKey);
-    if (!visitCountRef || CFGetTypeID(visitCountRef) != CFNumberGetTypeID())
-        return E_FAIL;
-    int visitedCount = 0;
-    if (!CFNumberGetValue(visitCountRef, kCFNumberIntType, &visitedCount))
-        return E_FAIL;
-
-    // Can't trust data on disk, and we've had at least one report of this (<rdar://6572300>).
-    if (visitedCount < 0) {
-        LOG_ERROR("visit count for history item \"%s\" is negative (%d), will be reset to 1", String(urlStringRef).utf8().data(), visitedCount);
-        visitedCount = 1;
-    }
-
     CFBooleanRef lastVisitWasFailureRef = static_cast<CFBooleanRef>(CFDictionaryGetValue(dictionaryRef, lastVisitWasFailureKey));
     if (lastVisitWasFailureRef && CFGetTypeID(lastVisitWasFailureRef) != CFBooleanGetTypeID())
         return E_FAIL;
@@ -136,13 +120,6 @@
             (*redirectURLsVector)[i] = String(static_cast<CFStringRef>(CFArrayGetValueAtIndex(redirectURLsRef, i)));
     }
 
-    CFArrayRef dailyCounts = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, dailyVisitCountKey));
-    if (dailyCounts && CFGetTypeID(dailyCounts) != CFArrayGetTypeID())
-        dailyCounts = 0;
-    CFArrayRef weeklyCounts = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionaryRef, weeklyVisitCountKey));
-    if (weeklyCounts && CFGetTypeID(weeklyCounts) != CFArrayGetTypeID())
-        weeklyCounts = 0;
-
     historyItemWrappers().remove(m_historyItem.get());
     m_historyItem = HistoryItem::create(urlStringRef, titleRef);
     historyItemWrappers().set(m_historyItem.get(), this);
@@ -174,10 +151,6 @@
         values[keyCount++] = m_historyItem->title().createCFString().leakRef();
     }
 
-    keys[keyCount] = visitCountKey;
-    int visitCount = m_historyItem->visitCount();
-    values[keyCount++] = CFNumberCreate(0, kCFNumberIntType, &visitCount);
-
     if (m_historyItem->lastVisitWasFailure()) {
         keys[keyCount] = lastVisitWasFailureKey;
         values[keyCount++] = CFRetain(kCFBooleanTrue);
@@ -388,34 +361,23 @@
     return S_OK;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT STDMETHODCALLTYPE WebHistoryItem::getDailyVisitCounts(int* number, int** counts)
 {
-    if (!number || !counts) {
-        ASSERT_NOT_REACHED();
-        return E_POINTER;
-    }
-
-    *counts = const_cast<int*>(m_historyItem->dailyVisitCounts().data());
-    *number = m_historyItem->dailyVisitCounts().size();
-    return S_OK;
+    return E_NOTIMPL;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT STDMETHODCALLTYPE WebHistoryItem::getWeeklyVisitCounts(int* number, int** counts)
 {
-    if (!number || !counts) {
-        ASSERT_NOT_REACHED();
-        return E_POINTER;
-    }
-
-    *counts = const_cast<int*>(m_historyItem->weeklyVisitCounts().data());
-    *number = m_historyItem->weeklyVisitCounts().size();
-    return S_OK;
+    return E_NOTIMPL;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT STDMETHODCALLTYPE WebHistoryItem::recordInitialVisit()
 {
-    m_historyItem->recordInitialVisit();
-    return S_OK;
+    // FIXME: This function should be removed from the IWebHistoryItem interface.
+    return E_NOTIMPL;
 }
 
 // IUnknown -------------------------------------------------------------------
@@ -460,7 +422,7 @@
     /* [in] */ DATE lastVisited)
 {
     historyItemWrappers().remove(m_historyItem.get());
-    m_historyItem = HistoryItem::create(String(urlString, SysStringLen(urlString)), String(title, SysStringLen(title)), 0);
+    m_historyItem = HistoryItem::create(String(urlString, SysStringLen(urlString)), String(title, SysStringLen(title)));
     historyItemWrappers().set(m_historyItem.get(), this);
 
     return S_OK;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to