Title: [184056] trunk/Source
Revision
184056
Author
commit-qu...@webkit.org
Date
2015-05-10 14:45:25 -0700 (Sun, 10 May 2015)

Log Message

Get rid of the public item accessors in BackForwardClient
https://bugs.webkit.org/show_bug.cgi?id=144827

Patch by Sungmann Cho <sungmann....@navercorp.com> on 2015-05-10
Reviewed by Darin Adler.

Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
We can still use these functionalities through BackForwardController.

No new tests, no behavior change.

Source/WebCore:

* history/BackForwardClient.h:
(WebCore::BackForwardClient::backItem): Deleted.
(WebCore::BackForwardClient::currentItem): Deleted.
(WebCore::BackForwardClient::forwardItem): Deleted.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _loadBackForwardListFromOtherView:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184055 => 184056)


--- trunk/Source/WebCore/ChangeLog	2015-05-10 21:43:26 UTC (rev 184055)
+++ trunk/Source/WebCore/ChangeLog	2015-05-10 21:45:25 UTC (rev 184056)
@@ -1,5 +1,22 @@
 2015-05-10  Sungmann Cho  <sungmann....@navercorp.com>
 
+        Get rid of the public item accessors in BackForwardClient
+        https://bugs.webkit.org/show_bug.cgi?id=144827
+
+        Reviewed by Darin Adler.
+
+        Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
+        We can still use these functionalities through BackForwardController.
+
+        No new tests, no behavior change.
+
+        * history/BackForwardClient.h:
+        (WebCore::BackForwardClient::backItem): Deleted.
+        (WebCore::BackForwardClient::currentItem): Deleted.
+        (WebCore::BackForwardClient::forwardItem): Deleted.
+
+2015-05-10  Sungmann Cho  <sungmann....@navercorp.com>
+
         Rename Length::isPercent() and Length::isPercentNotCalculated().
         https://bugs.webkit.org/show_bug.cgi?id=144791
 

Modified: trunk/Source/WebCore/history/BackForwardClient.h (184055 => 184056)


--- trunk/Source/WebCore/history/BackForwardClient.h	2015-05-10 21:43:26 UTC (rev 184055)
+++ trunk/Source/WebCore/history/BackForwardClient.h	2015-05-10 21:45:25 UTC (rev 184056)
@@ -59,12 +59,6 @@
     // FIXME: Consider renaming this method once we upstream the iOS changes to WebView.mm.
     virtual bool clearAllPageCaches() = 0;
 #endif
-
-    // FIXME: Delete these once all callers are using BackForwardController
-    // instead of calling this directly.
-    HistoryItem* backItem() { return itemAtIndex(-1); }
-    HistoryItem* currentItem() { return itemAtIndex(0); }
-    HistoryItem* forwardItem() { return itemAtIndex(1); }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/mac/ChangeLog (184055 => 184056)


--- trunk/Source/WebKit/mac/ChangeLog	2015-05-10 21:43:26 UTC (rev 184055)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-05-10 21:45:25 UTC (rev 184056)
@@ -1,3 +1,18 @@
+2015-05-10  Sungmann Cho  <sungmann....@navercorp.com>
+
+        Get rid of the public item accessors in BackForwardClient
+        https://bugs.webkit.org/show_bug.cgi?id=144827
+
+        Reviewed by Darin Adler.
+
+        Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
+        We can still use these functionalities through BackForwardController.
+
+        No new tests, no behavior change.
+
+        * WebView/WebView.mm:
+        (-[WebView _loadBackForwardListFromOtherView:]):
+
 2015-05-09  Yoav Weiss  <y...@yoav.ws>
 
         Remove the PICTURE_SIZES build flag

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (184055 => 184056)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2015-05-10 21:43:26 UTC (rev 184055)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2015-05-10 21:45:25 UTC (rev 184056)
@@ -2008,29 +2008,29 @@
     // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
     // in the back forward list, and go to the current one.
 
-    BackForwardClient* backForwardClient = _private->page->backForward().client();
-    ASSERT(!backForwardClient->currentItem()); // destination list should be empty
+    BackForwardController& backForward = _private->page->backForward();
+    ASSERT(!backForward.currentItem()); // destination list should be empty
 
-    BackForwardClient* otherBackForwardClient = otherView->_private->page->backForward().client();
-    if (!otherBackForwardClient->currentItem())
+    BackForwardController& otherBackForward = otherView->_private->page->backForward();
+    if (!otherBackForward.currentItem())
         return; // empty back forward list, bail
     
     HistoryItem* newItemToGoTo = nullptr;
 
-    int lastItemIndex = otherBackForwardClient->forwardListCount();
-    for (int i = -otherBackForwardClient->backListCount(); i <= lastItemIndex; ++i) {
+    int lastItemIndex = otherBackForward.forwardCount();
+    for (int i = -otherBackForward.backCount(); i <= lastItemIndex; ++i) {
         if (i == 0) {
             // If this item is showing , save away its current scroll and form state,
             // since that might have changed since loading and it is normally not saved
             // until we leave that page.
             otherView->_private->page->mainFrame().loader().history().saveDocumentAndScrollState();
         }
-        Ref<HistoryItem> newItem = otherBackForwardClient->itemAtIndex(i)->copy();
+        Ref<HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
         if (i == 0) 
             newItemToGoTo = newItem.ptr();
-        backForwardClient->addItem(WTF::move(newItem));
+        backForward.client()->addItem(WTF::move(newItem));
     }
-    
+
     ASSERT(newItemToGoTo);
     _private->page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward);
 }

Modified: trunk/Source/WebKit/win/WebView.cpp (184055 => 184056)


--- trunk/Source/WebKit/win/WebView.cpp	2015-05-10 21:43:26 UTC (rev 184055)
+++ trunk/Source/WebKit/win/WebView.cpp	2015-05-10 21:45:25 UTC (rev 184056)
@@ -3965,7 +3965,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    *result = !!(m_page->backForward().client()->backItem() && !m_page->defersLoading());
+    *result = !!(m_page->backForward().backItem() && !m_page->defersLoading());
     return S_OK;
 }
     
@@ -3980,7 +3980,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    *result = !!(m_page->backForward().client()->forwardItem() && !m_page->defersLoading());
+    *result = !!(m_page->backForward().forwardItem() && !m_page->defersLoading());
     return S_OK;
 }
     
@@ -5491,30 +5491,30 @@
     // It turns out the right combination of behavior is done with the back/forward load
     // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
     // in the back forward list, and go to the current one.
-    BackForwardClient* backForwardClient = m_page->backForward().client();
-    ASSERT(!backForwardClient->currentItem()); // destination list should be empty
+    BackForwardController& backForward = m_page->backForward();
+    ASSERT(!backForward.currentItem()); // destination list should be empty
 
     COMPtr<WebView> otherWebView;
     if (FAILED(otherView->QueryInterface(&otherWebView)))
         return E_FAIL;
-    BackForwardClient* otherBackForwardClient = otherWebView->m_page->backForward().client();
-    if (!otherBackForwardClient->currentItem())
+    BackForwardController& otherBackForward = otherWebView->m_page->backForward();
+    if (!otherBackForward.currentItem())
         return S_OK; // empty back forward list, bail
     
     HistoryItem* newItemToGoTo = 0;
 
-    int lastItemIndex = otherBackForwardClient->forwardListCount();
-    for (int i = -otherBackForwardClient->backListCount(); i <= lastItemIndex; ++i) {
+    int lastItemIndex = otherBackForward.forwardCount();
+    for (int i = -otherBackForward.backCount(); i <= lastItemIndex; ++i) {
         if (!i) {
             // If this item is showing , save away its current scroll and form state,
             // since that might have changed since loading and it is normally not saved
             // until we leave that page.
             otherWebView->m_page->mainFrame().loader().history().saveDocumentAndScrollState();
         }
-        Ref<HistoryItem> newItem = otherBackForwardClient->itemAtIndex(i)->copy();
+        Ref<HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
         if (!i) 
             newItemToGoTo = newItem.ptr();
-        backForwardClient->addItem(WTF::move(newItem));
+        backForward.client()->addItem(WTF::move(newItem));
     }
     
     ASSERT(newItemToGoTo);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to