Changeset 200770 in webkit


Ignore:
Timestamp:
May 12, 2016, 7:48:03 AM (9 years ago)
Author:
Konstantin Tokarev
Message:

Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
https://bugs.webkit.org/show_bug.cgi?id=157624

Reviewed by Darin Adler.

Source/WebCore:

No new tests needed.

  • loader/EmptyClients.h:
  • loader/FrameLoaderClient.h:
  • loader/HistoryController.cpp:

(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):

Source/WebKit/mac:

  • WebCoreSupport/WebFrameLoaderClient.h:
  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::saveViewStateToItem):

  • WebView/WebFrame.mm:

(-[WebFrame _saveViewState]):

Source/WebKit/win:

  • WebCoreSupport/WebFrameLoaderClient.cpp:

(WebFrameLoaderClient::saveViewStateToItem):

  • WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::saveViewStateToItem):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200769 r200770  
     12016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
     4        https://bugs.webkit.org/show_bug.cgi?id=157624
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests needed.
     9
     10        * loader/EmptyClients.h:
     11        * loader/FrameLoaderClient.h:
     12        * loader/HistoryController.cpp:
     13        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
     14
    1152016-05-12  Antoine Quint  <graouts@apple.com>
    216
  • trunk/Source/WebCore/loader/EmptyClients.h

    r199955 r200770  
    377377    bool shouldGoToHistoryItem(HistoryItem*) const override { return false; }
    378378    void updateGlobalHistoryItemForPage() override { }
    379     void saveViewStateToItem(HistoryItem*) override { }
     379    void saveViewStateToItem(HistoryItem&) override { }
    380380    bool canCachePage() const override { return false; }
    381381    void didDisplayInsecureContent() override { }
  • trunk/Source/WebCore/loader/FrameLoaderClient.h

    r200519 r200770  
    247247
    248248        virtual void frameLoadCompleted() = 0;
    249         virtual void saveViewStateToItem(HistoryItem*) = 0;
     249        virtual void saveViewStateToItem(HistoryItem&) = 0;
    250250        virtual void restoreViewState() = 0;
    251251        virtual void provisionalLoadStarted() = 0;
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r200470 r200770  
    9595
    9696    // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client.
    97     m_frame.loader().client().saveViewStateToItem(item);
     97    m_frame.loader().client().saveViewStateToItem(*item);
    9898
    9999    // Notify clients that the HistoryItem has changed.
  • trunk/Source/WebKit/mac/ChangeLog

    r200747 r200770  
     12016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
     4        https://bugs.webkit.org/show_bug.cgi?id=157624
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/WebFrameLoaderClient.h:
     9        * WebCoreSupport/WebFrameLoaderClient.mm:
     10        (WebFrameLoaderClient::saveViewStateToItem):
     11        * WebView/WebFrame.mm:
     12        (-[WebFrame _saveViewState]):
     13
    1142016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
    215
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h

    r199673 r200770  
    192192
    193193    void frameLoadCompleted() override;
    194     void saveViewStateToItem(WebCore::HistoryItem*) override;
     194    void saveViewStateToItem(WebCore::HistoryItem&) override;
    195195    void restoreViewState() override;
    196196    void provisionalLoadStarted() override;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r199673 r200770  
    12251225}
    12261226
    1227 void WebFrameLoaderClient::saveViewStateToItem(HistoryItem* item)
    1228 {
    1229     if (!item)
    1230         return;
    1231 
     1227void WebFrameLoaderClient::saveViewStateToItem(HistoryItem& item)
     1228{
    12321229#if PLATFORM(IOS)
    12331230    // Let UIKit handle the scroll point for the main frame.
     
    12351232    WebView *webView = getWebView(webFrame);   
    12361233    if (webFrame == [webView mainFrame]) {
    1237         [[webView _UIKitDelegateForwarder] webView:webView saveStateToHistoryItem:kit(item) forFrame:webFrame];
     1234        [[webView _UIKitDelegateForwarder] webView:webView saveStateToHistoryItem:kit(&item) forFrame:webFrame];
    12381235        return;
    12391236    }
     
    12451242    // case we don't want to override real data earlier gathered with (0,0)
    12461243    if ([docView superview] && [docView conformsToProtocol:@protocol(_WebDocumentViewState)])
    1247         item->setViewState([(id <_WebDocumentViewState>)docView viewState]);
     1244        item.setViewState([(id <_WebDocumentViewState>)docView viewState]);
    12481245}
    12491246
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r200696 r200770  
    13011301    ASSERT(!WebThreadIsEnabled() || WebThreadIsLocked());
    13021302    FrameLoader& frameLoader = _private->coreFrame->loader();
    1303     frameLoader.client().saveViewStateToItem(frameLoader.history().currentItem());
     1303    auto* item = frameLoader.history().currentItem();
     1304    if (item)
     1305        frameLoader.client().saveViewStateToItem(*item);
    13041306}
    13051307
  • trunk/Source/WebKit/win/ChangeLog

    r200696 r200770  
     12016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
     4        https://bugs.webkit.org/show_bug.cgi?id=157624
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/WebFrameLoaderClient.cpp:
     9        (WebFrameLoaderClient::saveViewStateToItem):
     10        * WebCoreSupport/WebFrameLoaderClient.h:
     11
    1122016-05-11  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp

    r199673 r200770  
    916916}
    917917
    918 void WebFrameLoaderClient::saveViewStateToItem(HistoryItem*)
     918void WebFrameLoaderClient::saveViewStateToItem(HistoryItem&)
    919919{
    920920}
  • trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h

    r199673 r200770  
    168168
    169169    void frameLoadCompleted() override;
    170     void saveViewStateToItem(WebCore::HistoryItem *) override;
     170    void saveViewStateToItem(WebCore::HistoryItem&) override;
    171171    void restoreViewState() override;
    172172    void provisionalLoadStarted() override;
  • trunk/Source/WebKit2/ChangeLog

    r200747 r200770  
     12016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
     4        https://bugs.webkit.org/show_bug.cgi?id=157624
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     9        (WebKit::WebFrameLoaderClient::saveViewStateToItem):
     10        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
     11
    1122016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
    213
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r200611 r200770  
    11981198}
    11991199
    1200 void WebFrameLoaderClient::saveViewStateToItem(HistoryItem* historyItem)
     1200void WebFrameLoaderClient::saveViewStateToItem(HistoryItem& historyItem)
    12011201{
    12021202#if PLATFORM(IOS) || PLATFORM(EFL)
    12031203    if (m_frame->isMainFrame())
    1204         m_frame->page()->savePageState(*historyItem);
     1204        m_frame->page()->savePageState(historyItem);
    12051205#else
    12061206    UNUSED_PARAM(historyItem);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r199673 r200770  
    165165   
    166166    void frameLoadCompleted() override;
    167     void saveViewStateToItem(WebCore::HistoryItem*) override;
     167    void saveViewStateToItem(WebCore::HistoryItem&) override;
    168168    void restoreViewState() override;
    169169    void provisionalLoadStarted() override;
Note: See TracChangeset for help on using the changeset viewer.