Title: [162806] trunk/Source
Revision
162806
Author
[email protected]
Date
2014-01-26 13:21:39 -0800 (Sun, 26 Jan 2014)

Log Message

Move lastVisitWasHTTPNonGet out to WebHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=127657

Reviewed by Dan Bernstein.

Source/WebCore:

Remove m_lastVisitWasHTTPNonGet, it's only used by WebKit.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
* history/HistoryItem.h:

Source/WebKit/mac:

Keep track of _lastVisitWasHTTPNonGet inside WebHistoryItem.

* History/WebHistory.mm:
(-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
Set entry->_private->_lastVisitWasHTTPNonGet.

* History/WebHistoryItem.h:
Change @private to @package so we can get at WebHistoryItemPrivate from WebHistory.

* History/WebHistoryItem.mm:
(-[WebHistoryItem copyWithZone:]):
Assign _private->_lastVisitWasHTTPNonGet.

(-[WebHistoryItem initFromDictionaryRepresentation:]):
Set _private->_lastVisitWasHTTPNonGet.

* History/WebHistoryItemInternal.h:
Move WebHistoryItemPrivate interface here.

Source/WebKit/win:

Remove uses of lastVisitWasHTTPNonGet.

* WebHistory.cpp:
(WebHistory::visitedURL):
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
(WebHistoryItem::lastVisitWasHTTPNonGet):
(WebHistoryItem::setLastVisitWasHTTPNonGet):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (162805 => 162806)


--- trunk/Source/WebCore/ChangeLog	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebCore/ChangeLog	2014-01-26 21:21:39 UTC (rev 162806)
@@ -1,3 +1,17 @@
+2014-01-26  Anders Carlsson  <[email protected]>
+
+        Move lastVisitWasHTTPNonGet out to WebHistoryItem
+        https://bugs.webkit.org/show_bug.cgi?id=127657
+
+        Reviewed by Dan Bernstein.
+
+        Remove m_lastVisitWasHTTPNonGet, it's only used by WebKit.
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::HistoryItem):
+        (WebCore::HistoryItem::reset):
+        * history/HistoryItem.h:
+
 2014-01-26  Zalan Bujtas  <[email protected]>
 
         Subpixel Layout: Align <input type="button", submit etc (PushButtonPart) top and bottom paddings with <button>

Modified: trunk/Source/WebCore/history/HistoryItem.cpp (162805 => 162806)


--- trunk/Source/WebCore/history/HistoryItem.cpp	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebCore/history/HistoryItem.cpp	2014-01-26 21:21:39 UTC (rev 162806)
@@ -61,7 +61,6 @@
 
 HistoryItem::HistoryItem()
     : m_lastVisitedTime(0)
-    , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
@@ -83,7 +82,6 @@
     , m_originalURLString(urlString)
     , m_title(title)
     , m_lastVisitedTime(time)
-    , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
@@ -107,7 +105,6 @@
     , m_title(title)
     , m_displayTitle(alternateTitle)
     , m_lastVisitedTime(time)
-    , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
@@ -132,7 +129,6 @@
     , m_parent(parent)
     , m_title(title)
     , m_lastVisitedTime(0)
-    , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
@@ -166,7 +162,6 @@
     , m_title(item.m_title)
     , m_displayTitle(item.m_displayTitle)
     , m_lastVisitedTime(item.m_lastVisitedTime)
-    , m_lastVisitWasHTTPNonGet(item.m_lastVisitWasHTTPNonGet)
     , m_scrollPoint(item.m_scrollPoint)
     , m_pageScaleFactor(item.m_pageScaleFactor)
     , m_lastVisitWasFailure(item.m_lastVisitWasFailure)
@@ -214,7 +209,6 @@
     m_displayTitle = String();
 
     m_lastVisitedTime = 0;
-    m_lastVisitWasHTTPNonGet = false;
 
     m_lastVisitWasFailure = false;
     m_isTargetItem = false;

Modified: trunk/Source/WebCore/history/HistoryItem.h (162805 => 162806)


--- trunk/Source/WebCore/history/HistoryItem.h	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebCore/history/HistoryItem.h	2014-01-26 21:21:39 UTC (rev 162806)
@@ -117,7 +117,6 @@
     
     int visitCount() const;
     bool lastVisitWasFailure() const { return m_lastVisitWasFailure; }
-    bool lastVisitWasHTTPNonGet() const { return m_lastVisitWasHTTPNonGet; }
 
     void mergeAutoCompleteHints(HistoryItem* otherItem);
     
@@ -158,7 +157,6 @@
 
     void setVisitCount(int);
     void setLastVisitWasFailure(bool wasFailure) { m_lastVisitWasFailure = wasFailure; }
-    void setLastVisitWasHTTPNonGet(bool wasNotGet) { m_lastVisitWasHTTPNonGet = wasNotGet; }
 
     void addChildItem(PassRefPtr<HistoryItem>);
     void setChildItem(PassRefPtr<HistoryItem>);
@@ -249,7 +247,6 @@
     String m_displayTitle;
     
     double m_lastVisitedTime;
-    bool m_lastVisitWasHTTPNonGet;
 
     IntPoint m_scrollPoint;
     float m_pageScaleFactor;

Modified: trunk/Source/WebKit/mac/ChangeLog (162805 => 162806)


--- trunk/Source/WebKit/mac/ChangeLog	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-01-26 21:21:39 UTC (rev 162806)
@@ -1,5 +1,31 @@
 2014-01-26  Anders Carlsson  <[email protected]>
 
+        Move lastVisitWasHTTPNonGet out to WebHistoryItem
+        https://bugs.webkit.org/show_bug.cgi?id=127657
+
+        Reviewed by Dan Bernstein.
+
+        Keep track of _lastVisitWasHTTPNonGet inside WebHistoryItem.
+
+        * History/WebHistory.mm:
+        (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
+        Set entry->_private->_lastVisitWasHTTPNonGet.
+
+        * History/WebHistoryItem.h:
+        Change @private to @package so we can get at WebHistoryItemPrivate from WebHistory.
+
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem copyWithZone:]):
+        Assign _private->_lastVisitWasHTTPNonGet.
+
+        (-[WebHistoryItem initFromDictionaryRepresentation:]):
+        Set _private->_lastVisitWasHTTPNonGet.
+
+        * History/WebHistoryItemInternal.h:
+        Move WebHistoryItemPrivate interface here.
+
+2014-01-26  Anders Carlsson  <[email protected]>
+
         Turn WebHistoryItemPrivate back into a real Objective-C class
         https://bugs.webkit.org/show_bug.cgi?id=127653
 

Modified: trunk/Source/WebKit/mac/History/WebHistory.mm (162805 => 162806)


--- trunk/Source/WebKit/mac/History/WebHistory.mm	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/mac/History/WebHistory.mm	2014-01-26 21:21:39 UTC (rev 162806)
@@ -938,7 +938,7 @@
     item->setLastVisitWasFailure(wasFailure);
 
     if ([method length])
-        item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]));
+        entry->_private->_lastVisitWasHTTPNonGet = [method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]);
 
     item->setRedirectURLs(nullptr);
 

Modified: trunk/Source/WebKit/mac/History/WebHistoryItem.h (162805 => 162806)


--- trunk/Source/WebKit/mac/History/WebHistoryItem.h	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/mac/History/WebHistoryItem.h	2014-01-26 21:21:39 UTC (rev 162806)
@@ -52,7 +52,7 @@
 */
 @interface WebHistoryItem : NSObject <NSCopying>
 {
-@private
+@package
     WebHistoryItemPrivate *_private;
 }
 

Modified: trunk/Source/WebKit/mac/History/WebHistoryItem.mm (162805 => 162806)


--- trunk/Source/WebKit/mac/History/WebHistoryItem.mm	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/mac/History/WebHistoryItem.mm	2014-01-26 21:21:39 UTC (rev 162806)
@@ -94,12 +94,6 @@
 
 using namespace WebCore;
 
-@interface WebHistoryItemPrivate : NSObject {
-@package
-    RefPtr<HistoryItem> _historyItem;
-}
-@end
-
 @implementation WebHistoryItemPrivate
 
 @end
@@ -177,6 +171,9 @@
 {
     WebCoreThreadViolationCheckRoundOne();
     WebHistoryItem *copy = [[[self class] alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
+
+    copy->_private->_lastVisitWasHTTPNonGet = _private->_lastVisitWasHTTPNonGet;
+
     historyItemWrappers().set(core(copy->_private), copy);
 
     return copy;
@@ -395,7 +392,7 @@
     BOOL lastVisitWasHTTPNonGet = [dict _webkit_boolForKey:lastVisitWasHTTPNonGetKey];
     NSString *tempURLString = [URLString lowercaseString];
     if (lastVisitWasHTTPNonGet && ([tempURLString hasPrefix:@"http:"] || [tempURLString hasPrefix:@"https:"]))
-        core(_private)->setLastVisitWasHTTPNonGet(lastVisitWasHTTPNonGet);
+        _private->_lastVisitWasHTTPNonGet = lastVisitWasHTTPNonGet;
 
     if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) {
         NSUInteger size = [redirectURLs count];
@@ -679,7 +676,7 @@
 
 - (BOOL)_lastVisitWasHTTPNonGet
 {
-    return core(_private)->lastVisitWasHTTPNonGet();
+    return _private->_lastVisitWasHTTPNonGet;
 }
 
 - (NSArray *)_redirectURLs

Modified: trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h (162805 => 162806)


--- trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/mac/History/WebHistoryItemInternal.h	2014-01-26 21:21:39 UTC (rev 162806)
@@ -28,7 +28,7 @@
 
 #import "WebBackForwardList.h"
 #import "WebHistoryItemPrivate.h"
-#import <wtf/Forward.h>
+#import <wtf/RefPtr.h>
 
 namespace WebCore {
     class HistoryItem;
@@ -58,3 +58,11 @@
 @interface WebBackForwardList (WebInternal)
 - (void)_close;
 @end
+
+@interface WebHistoryItemPrivate : NSObject {
+@package
+    RefPtr<WebCore::HistoryItem> _historyItem;
+
+    bool _lastVisitWasHTTPNonGet;
+}
+@end

Modified: trunk/Source/WebKit/win/ChangeLog (162805 => 162806)


--- trunk/Source/WebKit/win/ChangeLog	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/win/ChangeLog	2014-01-26 21:21:39 UTC (rev 162806)
@@ -1,3 +1,19 @@
+2014-01-26  Anders Carlsson  <[email protected]>
+
+        Move lastVisitWasHTTPNonGet out to WebHistoryItem
+        https://bugs.webkit.org/show_bug.cgi?id=127657
+
+        Reviewed by Dan Bernstein.
+
+        Remove uses of lastVisitWasHTTPNonGet.
+
+        * WebHistory.cpp:
+        (WebHistory::visitedURL):
+        * WebHistoryItem.cpp:
+        (WebHistoryItem::initFromDictionaryRepresentation):
+        (WebHistoryItem::lastVisitWasHTTPNonGet):
+        (WebHistoryItem::setLastVisitWasHTTPNonGet):
+
 2014-01-25  Anders Carlsson  <[email protected]>
 
         Remove an unused FrameLoaderClient function

Modified: trunk/Source/WebKit/win/WebHistory.cpp (162805 => 162806)


--- trunk/Source/WebKit/win/WebHistory.cpp	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/win/WebHistory.cpp	2014-01-26 21:21:39 UTC (rev 162806)
@@ -585,8 +585,6 @@
         return;
 
     entryPrivate->setLastVisitWasFailure(wasFailure);
-    if (!httpMethod.isEmpty())
-        entryPrivate->setLastVisitWasHTTPNonGet(!equalIgnoringCase(httpMethod, "GET") && url.protocolIsInHTTPFamily());
 
     COMPtr<WebHistoryItem> item(Query, entry);
     item->historyItem()->setRedirectURLs(nullptr);

Modified: trunk/Source/WebKit/win/WebHistoryItem.cpp (162805 => 162806)


--- trunk/Source/WebKit/win/WebHistoryItem.cpp	2014-01-26 20:04:29 UTC (rev 162805)
+++ trunk/Source/WebKit/win/WebHistoryItem.cpp	2014-01-26 21:21:39 UTC (rev 162806)
@@ -187,9 +187,6 @@
     if (lastVisitWasFailure)
         m_historyItem->setLastVisitWasFailure(true);
 
-    if (lastVisitWasHTTPNonGet && (protocolIs(m_historyItem->urlString(), "http") || protocolIs(m_historyItem->urlString(), "https")))
-        m_historyItem->setLastVisitWasHTTPNonGet(true);
-
     if (redirectURLsVector.get())
         m_historyItem->setRedirectURLs(std::move(redirectURLsVector));
 
@@ -445,22 +442,16 @@
     return S_OK;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT STDMETHODCALLTYPE WebHistoryItem::lastVisitWasHTTPNonGet(BOOL* HTTPNonGet)
 {
-    if (!HTTPNonGet) {
-        ASSERT_NOT_REACHED();
-        return E_POINTER;
-    }
-
-    *HTTPNonGet = m_historyItem->lastVisitWasHTTPNonGet();
-
-    return S_OK;
+    return E_NOTIMPL;
 }
 
+// FIXME: This function should be removed from the IWebHistoryItem interface.
 HRESULT STDMETHODCALLTYPE WebHistoryItem::setLastVisitWasHTTPNonGet(BOOL HTTPNonGet)
 {
-    m_historyItem->setLastVisitWasHTTPNonGet(HTTPNonGet);
-    return S_OK;
+    return E_NOTIMPL;
 }
 
 HRESULT STDMETHODCALLTYPE WebHistoryItem::redirectURLs(IEnumVARIANT** urls)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to