Changeset 62792 in webkit


Ignore:
Timestamp:
Jul 8, 2010 9:35:32 AM (14 years ago)
Author:
weinig@apple.com
Message:

Patch for https://bugs.webkit.org/show_bug.cgi?id=41826
Convert BackForwardList to an abstract base class and add BackForwardListImpl
as the concrete implementation of it.

Reviewed by Anders Carlsson.

WebCore:

  • CMakeLists.txt:
  • GNUmakefile.am:
  • WebCore.exp.in:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • history/BackForwardController.cpp:

(WebCore::BackForwardController::BackForwardController):

  • history/BackForwardController.h:
  • history/BackForwardList.cpp: Removed.
  • history/BackForwardList.h:

(WebCore::BackForwardList::~BackForwardList):
(WebCore::BackForwardList::isBackForwardListImpl):
(WebCore::BackForwardList::BackForwardList):

  • history/BackForwardListChromium.cpp:
  • history/BackForwardListImpl.cpp: Copied from WebCore/history/BackForwardList.cpp.
  • history/BackForwardListImpl.h: Copied from WebCore/history/BackForwardList.h.

(WebCore::BackForwardListImpl::isBackForwardListImpl):

WebKit/mac:

  • History/WebBackForwardList.mm:

(-[WebBackForwardList init]):
(-[WebBackForwardList setPageCacheSize:]):
(-[WebBackForwardList pageCacheSize]):

WebKit/qt:

  • Api/qwebhistory.cpp:

(QWebHistory::clear):
(QWebHistory::back):
(QWebHistory::forward):
(QWebHistory::goToItem):
(operator>>):
(QWebHistoryPrivate::page):

WebKit2:

  • WebProcess/WebCoreSupport/WebBackForwardControllerClient.cpp:

(WebKit::WebBackForwardControllerClient::createBackForwardList):

Location:
trunk
Files:
18 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/CMakeLists.txt

    r62672 r62792  
    900900
    901901    history/BackForwardController.cpp
    902     history/BackForwardList.cpp
     902    history/BackForwardListImpl.cpp
    903903    history/CachedFrame.cpp
    904904    history/CachedPage.cpp
  • trunk/WebCore/ChangeLog

    r62791 r62792  
     12010-07-08  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=41826
     6        Convert BackForwardList to an abstract base class and add BackForwardListImpl
     7        as the concrete implementation of it.
     8
     9        * CMakeLists.txt:
     10        * GNUmakefile.am:
     11        * WebCore.exp.in:
     12        * WebCore.gypi:
     13        * WebCore.pro:
     14        * WebCore.vcproj/WebCore.vcproj:
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * history/BackForwardController.cpp:
     17        (WebCore::BackForwardController::BackForwardController):
     18        * history/BackForwardController.h:
     19        * history/BackForwardList.cpp: Removed.
     20        * history/BackForwardList.h:
     21        (WebCore::BackForwardList::~BackForwardList):
     22        (WebCore::BackForwardList::isBackForwardListImpl):
     23        (WebCore::BackForwardList::BackForwardList):
     24        * history/BackForwardListChromium.cpp:
     25        * history/BackForwardListImpl.cpp: Copied from WebCore/history/BackForwardList.cpp.
     26        * history/BackForwardListImpl.h: Copied from WebCore/history/BackForwardList.h.
     27        (WebCore::BackForwardListImpl::isBackForwardListImpl):
     28
    1292010-07-08  Vitaly Repeshko  <vitalyr@chromium.org>
    230
  • trunk/WebCore/GNUmakefile.am

    r62784 r62792  
    10551055        WebCore/history/BackForwardController.h \
    10561056        WebCore/history/BackForwardControllerClient.h \
    1057         WebCore/history/BackForwardList.cpp \
    10581057        WebCore/history/BackForwardList.h \
     1058        WebCore/history/BackForwardListImpl.cpp \
     1059        WebCore/history/BackForwardListImpl.h \
    10591060        WebCore/history/CachedFrame.cpp \
    10601061        WebCore/history/CachedFrame.h \
  • trunk/WebCore/WebCore.exp.in

    r62677 r62792  
    318318__ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKNS_6StringEPNS_8DocumentE
    319319__ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS_6StringESA_SA_RKNS_16ResourceResponseE
    320 __ZN7WebCore15BackForwardList10removeItemEPNS_11HistoryItemE
    321 __ZN7WebCore15BackForwardList10setEnabledEb
    322 __ZN7WebCore15BackForwardList11currentItemEv
    323 __ZN7WebCore15BackForwardList11forwardItemEv
    324 __ZN7WebCore15BackForwardList11itemAtIndexEi
    325 __ZN7WebCore15BackForwardList11setCapacityEi
    326 __ZN7WebCore15BackForwardList12containsItemEPNS_11HistoryItemE
    327 __ZN7WebCore15BackForwardList13backListCountEv
    328 __ZN7WebCore15BackForwardList16forwardListCountEv
    329 __ZN7WebCore15BackForwardList17backListWithLimitEiRN3WTF6VectorINS1_6RefPtrINS_11HistoryItemEEELm0EEE
    330 __ZN7WebCore15BackForwardList20forwardListWithLimitEiRN3WTF6VectorINS1_6RefPtrINS_11HistoryItemEEELm0EEE
    331 __ZN7WebCore15BackForwardList5closeEv
    332 __ZN7WebCore15BackForwardList6closedEv
    333 __ZN7WebCore15BackForwardList6goBackEv
    334 __ZN7WebCore15BackForwardList7addItemEN3WTF10PassRefPtrINS_11HistoryItemEEE
    335 __ZN7WebCore15BackForwardList7enabledEv
    336 __ZN7WebCore15BackForwardList7entriesEv
    337 __ZN7WebCore15BackForwardList8backItemEv
    338 __ZN7WebCore15BackForwardList8capacityEv
    339 __ZN7WebCore15BackForwardList8goToItemEPNS_11HistoryItemE
    340 __ZN7WebCore15BackForwardList9goForwardEv
    341 __ZN7WebCore15BackForwardListC1EPNS_4PageE
    342 __ZN7WebCore15BackForwardListD1Ev
    343320__ZN7WebCore15DOMWrapperWorld15unregisterWorldEv
    344321__ZN7WebCore15DOMWrapperWorldD1Ev
     
    423400__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
    424401__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd
     402__ZN7WebCore19BackForwardListImplC1EPNS_4PageE
    425403__ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
    426404__ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv
     
    507485__ZN7WebCore4KURLC1EPK7__CFURL
    508486__ZN7WebCore4KURLC1ERKS0_RKNS_6StringE
    509 __ZN7WebCore4coreEP20NSURLProtectionSpace
    510487__ZN7WebCore4Node10renderRectEPb
    511488__ZN7WebCore4Node17stopIgnoringLeaksEv
     
    534511__ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientEPNS_27GeolocationControllerClientEPNS_23DeviceOrientationClientEPNS_27BackForwardControllerClientE
    535512__ZN7WebCore4PageD1Ev
     513__ZN7WebCore4coreEP20NSURLProtectionSpace
    536514__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
    537515__ZN7WebCore5Cache11setDisabledEb
  • trunk/WebCore/WebCore.gypi

    r62646 r62792  
    13911391            'history/BackForwardController.h',
    13921392            'history/BackForwardControllerClient.h',
    1393             'history/BackForwardList.cpp',
    13941393            'history/BackForwardList.h',
     1394            'history/BackForwardListImpl.cpp',
     1395            'history/BackForwardListImpl.h',
    13951396            'history/BackForwardListChromium.cpp',
    13961397            'history/CachedFrame.cpp',
  • trunk/WebCore/WebCore.pro

    r62646 r62792  
    601601    editing/WrapContentsInDummySpanCommand.cpp \
    602602    history/BackForwardController.cpp \
    603     history/BackForwardList.cpp \
     603    history/BackForwardListImpl.cpp \
    604604    history/CachedFrame.cpp \
    605605    history/CachedPage.cpp \
     
    13551355    history/BackForwardController.h \
    13561356    history/BackForwardControllerClient.h \
     1357    history/BackForwardListImpl.h \
    13571358    history/BackForwardList.h \
    13581359    history/CachedFrame.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r62646 r62792  
    4946649466                        </File>
    4946749467                        <File
    49468                                 RelativePath="..\history\BackForwardList.cpp"
    49469                                 >
    49470                         </File>
    49471                         <File
    4947249468                                RelativePath="..\history\BackForwardList.h"
     49469                                >
     49470                        </File>
     49471                        <File
     49472                                RelativePath="..\history\BackForwardListImpl.cpp"
     49473                                >
     49474                        </File>
     49475                        <File
     49476                                RelativePath="..\history\BackForwardListImpl.h"
    4947349477                                >
    4947449478                        </File>
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r62707 r62792  
    11151115                5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */; };
    11161116                51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1117                 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0C0B07259A00ED442C /* BackForwardList.cpp */; };
    11181117                51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11191118                51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
     
    46804679                BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA846D50DC67A350026C309 /* RenderReplica.h */; };
    46814680                BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
    4682                 BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C81C11E3D36900812FB7 /* BackForwardController.h */; };
     4681                BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C81C11E3D36900812FB7 /* BackForwardController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    46834682                BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */; };
    46844683                BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C83011E3D53200812FB7 /* BackForwardControllerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
     4684                BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */; };
     4685                BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
    46854686                BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; };
    46864687                BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
     
    68246825                5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeProcessEvent.cpp; sourceTree = "<group>"; };
    68256826                51741D0B0B07259A00ED442C /* BackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardList.h; sourceTree = "<group>"; };
    6826                 51741D0C0B07259A00ED442C /* BackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardList.cpp; sourceTree = "<group>"; };
    68276827                51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = "<group>"; };
    68286828                51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = "<group>"; };
     
    1028610286                BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardController.cpp; sourceTree = "<group>"; };
    1028710287                BCA8C83011E3D53200812FB7 /* BackForwardControllerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardControllerClient.h; sourceTree = "<group>"; };
     10288                BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardListImpl.cpp; sourceTree = "<group>"; };
     10289                BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardListImpl.h; sourceTree = "<group>"; };
    1028810290                BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Scrollbar.cpp; path = platform/Scrollbar.cpp; sourceTree = SOURCE_ROOT; };
    1028910291                BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; };
     
    1188311885                                9363B6290F8E8FE000803810 /* cf */,
    1188411886                                5160F4920B0AA71500C1D2AF /* mac */,
    11885                                 51741D0C0B07259A00ED442C /* BackForwardList.cpp */,
    1188611887                                51741D0B0B07259A00ED442C /* BackForwardList.h */,
     11888                                BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */,
     11889                                BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */,
    1188711890                                BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */,
    1188811891                                BCA8C81C11E3D36900812FB7 /* BackForwardController.h */,
     
    1972519728                                BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */,
    1972619729                                BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */,
     19730                                BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
    1972719731                        );
    1972819732                        runOnlyForDeploymentPostprocessing = 0;
     
    2007420078                                29A812370FBB9C1D00510293 /* AXObjectCache.cpp in Sources */,
    2007520079                                29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
    20076                                 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */,
    2007720080                                BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
    2007820081                                B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */,
     
    2211122114                                4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend2.cpp in Sources */,
    2211222115                                97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */,
     22116                                BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
    2211322117                        );
    2211422118                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/history/BackForwardController.cpp

    r62676 r62792  
    2929#include "BackForwardControllerClient.h"
    3030#include "BackForwardList.h"
     31#include "BackForwardListImpl.h"
    3132
    3233namespace WebCore {
     
    3738{
    3839    if (!m_client)
    39         m_list = BackForwardList::create(page);
     40        m_list = BackForwardListImpl::create(page);
    4041    else
    4142        m_list = m_client->createBackForwardList();
  • trunk/WebCore/history/BackForwardController.h

    r62607 r62792  
    3333namespace WebCore {
    3434
     35class Page;
    3536class BackForwardControllerClient;
    3637
  • trunk/WebCore/history/BackForwardList.h

    r53324 r62792  
    3131#include <wtf/RefCounted.h>
    3232#include <wtf/PassRefPtr.h>
    33 #include <wtf/HashSet.h>
    3433#include <wtf/Vector.h>
    3534
    3635namespace WebCore {
    3736
    38 class Document;
    3937class HistoryItem;
    40 class Page;
    41 class SerializedScriptValue;
    42 class String;
    4338
    4439typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
    45 typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
    4640
    4741#if PLATFORM(CHROMIUM)
     
    6357class BackForwardList : public RefCounted<BackForwardList> {
    6458public:
    65     static PassRefPtr<BackForwardList> create(Page* page) { return adoptRef(new BackForwardList(page)); }
    66     ~BackForwardList();
     59    virtual ~BackForwardList()
     60    {
     61    }
     62
     63    virtual bool isBackForwardListImpl() const { return false; }
    6764
    6865#if PLATFORM(CHROMIUM)
    6966    // Must be called before any other methods.
    70     void setClient(BackForwardListClient* client) { m_client = client; }
     67    virtual void setClient(BackForwardListClient*) = 0;
    7168#endif
     69
     70    virtual void addItem(PassRefPtr<HistoryItem>) = 0;
     71    virtual void goBack() = 0;
     72    virtual void goForward() = 0;
     73    virtual void goToItem(HistoryItem*) = 0;
     74       
     75    virtual HistoryItem* backItem() = 0;
     76    virtual HistoryItem* currentItem() = 0;
     77    virtual HistoryItem* forwardItem() = 0;
     78    virtual HistoryItem* itemAtIndex(int) = 0;
     79
     80    virtual void backListWithLimit(int, HistoryItemVector&) = 0;
     81    virtual void forwardListWithLimit(int, HistoryItemVector&) = 0;
     82
     83    virtual int capacity() = 0;
     84    virtual void setCapacity(int) = 0;
     85    virtual bool enabled() = 0;
     86    virtual void setEnabled(bool) = 0;
     87    virtual int backListCount() = 0;
     88    virtual int forwardListCount() = 0;
     89    virtual bool containsItem(HistoryItem*) = 0;
     90
     91    virtual void close() = 0;
     92    virtual bool closed() = 0;
    7293   
    73     Page* page() { return m_page; }
     94    virtual void removeItem(HistoryItem*)  = 0;
     95    virtual HistoryItemVector& entries()  = 0;
    7496   
    75     void addItem(PassRefPtr<HistoryItem>);
    76     void goBack();
    77     void goForward();
    78     void goToItem(HistoryItem*);
    79        
    80     HistoryItem* backItem();
    81     HistoryItem* currentItem();
    82     HistoryItem* forwardItem();
    83     HistoryItem* itemAtIndex(int);
    84 
    85     void backListWithLimit(int, HistoryItemVector&);
    86     void forwardListWithLimit(int, HistoryItemVector&);
    87 
    88     int capacity();
    89     void setCapacity(int);
    90     bool enabled();
    91     void setEnabled(bool);
    92     int backListCount();
    93     int forwardListCount();
    94     bool containsItem(HistoryItem*);
    95 
    96     void close();
    97     bool closed();
    98    
    99     void removeItem(HistoryItem*);
    100     HistoryItemVector& entries();
    101    
    102     void pushStateItem(PassRefPtr<HistoryItem>);
     97    virtual void pushStateItem(PassRefPtr<HistoryItem>) = 0;
    10398
    10499#if ENABLE(WML)
    105     void clearWMLPageHistory();
     100    virtual void clearWMLPageHistory()  = 0;
    106101#endif
    107102
    108 private:
    109     BackForwardList(Page*);
    110    
    111     Page* m_page;
    112 #if PLATFORM(CHROMIUM)
    113     BackForwardListClient* m_client;
    114 #else
    115     HistoryItemVector m_entries;
    116     HistoryItemHashSet m_entryHash;
    117     unsigned m_current;
    118 #endif
    119     unsigned m_capacity;
    120     bool m_closed;
    121     bool m_enabled;
     103protected:
     104    BackForwardList()
     105    {
     106    }
    122107};
    123108   
    124 } //namespace WebCore
     109} // namespace WebCore
    125110
    126 #endif
     111#endif // BackForwardList_h
  • trunk/WebCore/history/BackForwardListChromium.cpp

    r53950 r62792  
    2727
    2828#include "config.h"
    29 #include "BackForwardList.h"
     29#include "BackForwardListImpl.h"
    3030
    3131#include "HistoryItem.h"
     
    3737static const unsigned NoCurrentItemIndex = UINT_MAX;
    3838
    39 BackForwardList::BackForwardList(Page* page)
     39BackForwardListImpl::BackForwardListImpl(Page* page)
    4040    : m_page(page)
    4141    , m_client(0)
     
    4646}
    4747
    48 BackForwardList::~BackForwardList()
     48BackForwardListImpl::~BackForwardListImpl()
    4949{
    5050    ASSERT(m_closed);
    5151}
    5252
    53 void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
     53void BackForwardListImpl::addItem(PassRefPtr<HistoryItem> prpItem)
    5454{
    5555    ASSERT(prpItem);
     
    6060}
    6161
    62 void BackForwardList::goToItem(HistoryItem* item)
     62void BackForwardListImpl::goToItem(HistoryItem* item)
    6363{
    6464    m_client->goToItem(item);
    6565}
    6666
    67 HistoryItem* BackForwardList::backItem()
     67HistoryItem* BackForwardListImpl::backItem()
    6868{
    6969    ASSERT_NOT_REACHED();
     
    7171}
    7272
    73 HistoryItem* BackForwardList::forwardItem()
     73HistoryItem* BackForwardListImpl::forwardItem()
    7474{
    7575    ASSERT_NOT_REACHED();
     
    7777}
    7878
    79 HistoryItem* BackForwardList::currentItem()
     79HistoryItem* BackForwardListImpl::currentItem()
    8080{
    8181    return m_client->currentItem();
    8282}
    8383
    84 int BackForwardList::capacity()
     84int BackForwardListImpl::capacity()
    8585{
    8686    return m_capacity;
    8787}
    8888
    89 void BackForwardList::setCapacity(int size)
     89void BackForwardListImpl::setCapacity(int size)
    9090{
    9191    m_capacity = size;
    9292}
    9393
    94 bool BackForwardList::enabled()
     94bool BackForwardListImpl::enabled()
    9595{
    9696    return m_enabled;
    9797}
    9898
    99 void BackForwardList::setEnabled(bool enabled)
     99void BackForwardListImpl::setEnabled(bool enabled)
    100100{
    101101    m_enabled = enabled;
     
    107107}
    108108
    109 int BackForwardList::backListCount()
     109int BackForwardListImpl::backListCount()
    110110{
    111111    return m_client->backListCount();
    112112}
    113113
    114 int BackForwardList::forwardListCount()
     114int BackForwardListImpl::forwardListCount()
    115115{
    116116    return m_client->forwardListCount();
    117117}
    118118
    119 HistoryItem* BackForwardList::itemAtIndex(int index)
     119HistoryItem* BackForwardListImpl::itemAtIndex(int index)
    120120{
    121121    return m_client->itemAtIndex(index);
    122122}
    123123
    124 void BackForwardList::pushStateItem(PassRefPtr<HistoryItem> newItem)
     124void BackForwardListImpl::pushStateItem(PassRefPtr<HistoryItem> newItem)
    125125{
    126126    RefPtr<HistoryItem> current = m_client->currentItem();
     
    132132}
    133133
    134 HistoryItemVector& BackForwardList::entries()
     134HistoryItemVector& BackForwardListImpl::entries()
    135135{
    136136    static HistoryItemVector noEntries;
     
    138138}
    139139
    140 void BackForwardList::close()
     140void BackForwardListImpl::close()
    141141{
    142142    if (m_client)
     
    146146}
    147147
    148 bool BackForwardList::closed()
     148bool BackForwardListImpl::closed()
    149149{
    150150    return m_closed;
  • trunk/WebCore/history/BackForwardListImpl.cpp

    r62674 r62792  
    2626
    2727#include "config.h"
    28 #include "BackForwardList.h"
     28#include "BackForwardListImpl.h"
    2929
    3030#include "Frame.h"
     
    4444static const unsigned NoCurrentItemIndex = UINT_MAX;
    4545
    46 BackForwardList::BackForwardList(Page* page)
     46BackForwardListImpl::BackForwardListImpl(Page* page)
    4747    : m_page(page)
    4848    , m_current(NoCurrentItemIndex)
     
    5353}
    5454
    55 BackForwardList::~BackForwardList()
     55BackForwardListImpl::~BackForwardListImpl()
    5656{
    5757    ASSERT(m_closed);
    5858}
    5959
    60 void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
     60void BackForwardListImpl::addItem(PassRefPtr<HistoryItem> prpItem)
    6161{
    6262    ASSERT(prpItem);
     
    9494}
    9595
    96 void BackForwardList::goBack()
     96void BackForwardListImpl::goBack()
    9797{
    9898    ASSERT(m_current > 0);
     
    104104}
    105105
    106 void BackForwardList::goForward()
     106void BackForwardListImpl::goForward()
    107107{
    108108    ASSERT(m_current < m_entries.size() - 1);
     
    114114}
    115115
    116 void BackForwardList::goToItem(HistoryItem* item)
     116void BackForwardListImpl::goToItem(HistoryItem* item)
    117117{
    118118    if (!m_entries.size() || !item)
     
    130130}
    131131
    132 HistoryItem* BackForwardList::backItem()
     132HistoryItem* BackForwardListImpl::backItem()
    133133{
    134134    if (m_current && m_current != NoCurrentItemIndex)
     
    137137}
    138138
    139 HistoryItem* BackForwardList::currentItem()
     139HistoryItem* BackForwardListImpl::currentItem()
    140140{
    141141    if (m_current != NoCurrentItemIndex)
     
    144144}
    145145
    146 HistoryItem* BackForwardList::forwardItem()
     146HistoryItem* BackForwardListImpl::forwardItem()
    147147{
    148148    if (m_entries.size() && m_current < m_entries.size() - 1)
     
    151151}
    152152
    153 void BackForwardList::backListWithLimit(int limit, HistoryItemVector& list)
     153void BackForwardListImpl::backListWithLimit(int limit, HistoryItemVector& list)
    154154{
    155155    list.clear();
     
    161161}
    162162
    163 void BackForwardList::forwardListWithLimit(int limit, HistoryItemVector& list)
     163void BackForwardListImpl::forwardListWithLimit(int limit, HistoryItemVector& list)
    164164{
    165165    ASSERT(limit > -1);
     
    177177}
    178178
    179 int BackForwardList::capacity()
     179int BackForwardListImpl::capacity()
    180180{
    181181    return m_capacity;
    182182}
    183183
    184 void BackForwardList::setCapacity(int size)
     184void BackForwardListImpl::setCapacity(int size)
    185185{   
    186186    while (size < (int)m_entries.size()) {
     
    201201}
    202202
    203 bool BackForwardList::enabled()
     203bool BackForwardListImpl::enabled()
    204204{
    205205    return m_enabled;
    206206}
    207207
    208 void BackForwardList::setEnabled(bool enabled)
     208void BackForwardListImpl::setEnabled(bool enabled)
    209209{
    210210    m_enabled = enabled;
     
    216216}
    217217
    218 int BackForwardList::backListCount()
     218int BackForwardListImpl::backListCount()
    219219{
    220220    return m_current == NoCurrentItemIndex ? 0 : m_current;
    221221}
    222222
    223 int BackForwardList::forwardListCount()
     223int BackForwardListImpl::forwardListCount()
    224224{
    225225    return m_current == NoCurrentItemIndex ? 0 : (int)m_entries.size() - (m_current + 1);
    226226}
    227227
    228 HistoryItem* BackForwardList::itemAtIndex(int index)
     228HistoryItem* BackForwardListImpl::itemAtIndex(int index)
    229229{
    230230    // Do range checks without doing math on index to avoid overflow.
     
    238238}
    239239
    240 HistoryItemVector& BackForwardList::entries()
     240HistoryItemVector& BackForwardListImpl::entries()
    241241{
    242242    return m_entries;
    243243}
    244244
    245 void BackForwardList::pushStateItem(PassRefPtr<HistoryItem> newItem)
     245void BackForwardListImpl::pushStateItem(PassRefPtr<HistoryItem> newItem)
    246246{
    247247    ASSERT(newItem);
     
    257257}
    258258
    259 void BackForwardList::close()
     259void BackForwardListImpl::close()
    260260{
    261261    int size = m_entries.size();
     
    268268}
    269269
    270 bool BackForwardList::closed()
     270bool BackForwardListImpl::closed()
    271271{
    272272    return m_closed;
    273273}
    274274
    275 void BackForwardList::removeItem(HistoryItem* item)
     275void BackForwardListImpl::removeItem(HistoryItem* item)
    276276{
    277277    if (!item)
     
    295295}
    296296
    297 bool BackForwardList::containsItem(HistoryItem* entry)
     297bool BackForwardListImpl::containsItem(HistoryItem* entry)
    298298{
    299299    return m_entryHash.contains(entry);
     
    301301
    302302#if ENABLE(WML)
    303 void BackForwardList::clearWMLPageHistory()
     303void BackForwardListImpl::clearWMLPageHistory()
    304304{
    305305    RefPtr<HistoryItem> currentItem = this->currentItem();
  • trunk/WebCore/history/BackForwardListImpl.h

    r62674 r62792  
    2626 */
    2727
    28 #ifndef BackForwardList_h
    29 #define BackForwardList_h
     28#ifndef BackForwardListImpl_h
     29#define BackForwardListImpl_h
    3030
    31 #include <wtf/RefCounted.h>
    32 #include <wtf/PassRefPtr.h>
     31#include "BackForwardList.h"
    3332#include <wtf/HashSet.h>
    34 #include <wtf/Vector.h>
    3533
    3634namespace WebCore {
    3735
    38 class Document;
    3936class HistoryItem;
    4037class Page;
    41 class SerializedScriptValue;
    42 class String;
    4338
    4439typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
    4540typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
    4641
    47 #if PLATFORM(CHROMIUM)
    48 // In the Chromium port, the back/forward list is managed externally.
    49 // See BackForwardListChromium.cpp
    50 class BackForwardListClient {
    51 public:
    52     virtual ~BackForwardListClient() {}
    53     virtual void addItem(PassRefPtr<HistoryItem>) = 0;
    54     virtual void goToItem(HistoryItem*) = 0;
    55     virtual HistoryItem* currentItem() = 0;
    56     virtual HistoryItem* itemAtIndex(int) = 0;
    57     virtual int backListCount() = 0;
    58     virtual int forwardListCount() = 0;
    59     virtual void close() = 0;
    60 };
    61 #endif
     42class BackForwardListImpl : public BackForwardList {
     43public:
     44    static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); }
     45    ~BackForwardListImpl();
    6246
    63 class BackForwardList : public RefCounted<BackForwardList> {
    64 public:
    65     static PassRefPtr<BackForwardList> create(Page* page) { return adoptRef(new BackForwardList(page)); }
    66     ~BackForwardList();
     47    bool isBackForwardListImpl() const { return true; }
    6748
    6849#if PLATFORM(CHROMIUM)
     
    10788
    10889private:
    109     BackForwardList(Page*);
     90    BackForwardListImpl(Page*);
    11091   
    11192    Page* m_page;
     
    122103};
    123104   
    124 } //namespace WebCore
     105} // namespace WebCore
    125106
    126 #endif
     107#endif // BackForwardListImpl_h
  • trunk/WebKit/mac/ChangeLog

    r62679 r62792  
     12010-07-08  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=41826
     6        Convert BackForwardList to an abstract base class and add BackForwardListImpl
     7        as the concrete implementation of it.
     8
     9        * History/WebBackForwardList.mm:
     10        (-[WebBackForwardList init]):
     11        (-[WebBackForwardList setPageCacheSize:]):
     12        (-[WebBackForwardList pageCacheSize]):
     13
    1142010-07-07  Sam Weinig  <sam@webkit.org>
    215
  • trunk/WebKit/mac/History/WebBackForwardList.mm

    r58266 r62792  
    3939#import "WebTypesInternal.h"
    4040#import "WebViewPrivate.h"
    41 #import <WebCore/BackForwardList.h>
     41#import <WebCore/BackForwardListImpl.h>
    4242#import <WebCore/HistoryItem.h>
    4343#import <WebCore/Page.h>
     
    110110- (id)init
    111111{
    112     return [self initWithBackForwardList:BackForwardList::create(0)];
     112    return [self initWithBackForwardList:BackForwardListImpl::create(0)];
    113113}
    114114
     
    294294- (void)setPageCacheSize:(NSUInteger)size
    295295{
    296     [kit(core(self)->page()) setUsesPageCache:size != 0];
     296    ASSERT(core(self)->isBackForwardListImpl());
     297    [kit(static_cast<BackForwardListImpl*>(core(self))->page()) setUsesPageCache:size != 0];
    297298}
    298299
    299300- (NSUInteger)pageCacheSize
    300301{
    301     return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0;
     302    ASSERT(core(self)->isBackForwardListImpl());
     303    return [kit(static_cast<BackForwardListImpl*>(core(self))->page()) usesPageCache] ? pageCache()->capacity() : 0;
    302304}
    303305
  • trunk/WebKit/qt/Api/qwebhistory.cpp

    r61504 r62792  
    2323#include "qwebframe_p.h"
    2424
     25#include "BackForwardListImpl.h"
    2526#include "PlatformString.h"
    2627#include "Image.h"
     
    260261
    261262    //clear visited links
    262     WebCore::Page* page = lst->page();
     263    WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(lst)->page();
    263264    if (page && page->groupPtr())
    264265        page->groupPtr()->removeVisitedLinks();
     
    364365{
    365366    if (canGoBack()) {
    366         WebCore::Page* page = d->lst->page();
     367        WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page();
    367368        page->goToItem(d->lst->backItem(), WebCore::FrameLoadTypeIndexedBackForward);
    368369    }
     
    378379{
    379380    if (canGoForward()) {
    380         WebCore::Page* page = d->lst->page();
     381        WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page();
    381382        page->goToItem(d->lst->forwardItem(), WebCore::FrameLoadTypeIndexedBackForward);
    382383    }
     
    390391void QWebHistory::goToItem(const QWebHistoryItem &item)
    391392{
    392     WebCore::Page* page = d->lst->page();
     393    WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page();
    393394    page->goToItem(item.d->item, WebCore::FrameLoadTypeIndexedBackForward);
    394395}
     
    539540            d->lst->removeItem(nullItem);
    540541            // Update the HistoryController.
    541             history.d->lst->page()->mainFrame()->loader()->history()->setCurrentItem(history.d->lst->entries()[currentIndex].get());
     542            static_cast<WebCore::BackForwardListImpl*>(history.d->lst)->page()->mainFrame()->loader()->history()->setCurrentItem(history.d->lst->entries()[currentIndex].get());
    542543            history.goToItem(history.itemAt(currentIndex));
    543544        }
     
    551552QWebPagePrivate* QWebHistoryPrivate::page()
    552553{
    553     return QWebFramePrivate::kit(lst->page()->mainFrame())->page()->handle();
     554    return QWebFramePrivate::kit(static_cast<WebCore::BackForwardListImpl*>(lst)->page()->mainFrame())->page()->handle();
    554555}
    555556
  • trunk/WebKit/qt/ChangeLog

    r62783 r62792  
     12010-07-08  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=41826
     6        Convert BackForwardList to an abstract base class and add BackForwardListImpl
     7        as the concrete implementation of it.
     8
     9        * Api/qwebhistory.cpp:
     10        (QWebHistory::clear):
     11        (QWebHistory::back):
     12        (QWebHistory::forward):
     13        (QWebHistory::goToItem):
     14        (operator>>):
     15        (QWebHistoryPrivate::page):
     16
    1172010-07-08  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    218
  • trunk/WebKit2/ChangeLog

    r62790 r62792  
     12010-07-08  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=41826
     6        Convert BackForwardList to an abstract base class and add BackForwardListImpl
     7        as the concrete implementation of it.
     8
     9        * WebProcess/WebCoreSupport/WebBackForwardControllerClient.cpp:
     10        (WebKit::WebBackForwardControllerClient::createBackForwardList):
     11
    1122010-07-08  Luiz Agostini  <luiz@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org>
    213
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebBackForwardControllerClient.cpp

    r62676 r62792  
    2727
    2828#include "WebPage.h"
    29 #include <WebCore/BackForwardList.h>
     29#include <WebCore/BackForwardListImpl.h>
    3030
    3131using namespace WebCore;
     
    4040PassRefPtr<BackForwardList> WebBackForwardControllerClient::createBackForwardList()
    4141{
    42     return BackForwardList::create(m_page->corePage());
     42    return BackForwardListImpl::create(m_page->corePage());
    4343}
    4444
Note: See TracChangeset for help on using the changeset viewer.