Changeset 62792 in webkit
- Timestamp:
- Jul 8, 2010 9:35:32 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/CMakeLists.txt
r62672 r62792 900 900 901 901 history/BackForwardController.cpp 902 history/BackForwardList .cpp902 history/BackForwardListImpl.cpp 903 903 history/CachedFrame.cpp 904 904 history/CachedPage.cpp -
trunk/WebCore/ChangeLog
r62791 r62792 1 2010-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 1 29 2010-07-08 Vitaly Repeshko <vitalyr@chromium.org> 2 30 -
trunk/WebCore/GNUmakefile.am
r62784 r62792 1055 1055 WebCore/history/BackForwardController.h \ 1056 1056 WebCore/history/BackForwardControllerClient.h \ 1057 WebCore/history/BackForwardList.cpp \1058 1057 WebCore/history/BackForwardList.h \ 1058 WebCore/history/BackForwardListImpl.cpp \ 1059 WebCore/history/BackForwardListImpl.h \ 1059 1060 WebCore/history/CachedFrame.cpp \ 1060 1061 WebCore/history/CachedFrame.h \ -
trunk/WebCore/WebCore.exp.in
r62677 r62792 318 318 __ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKNS_6StringEPNS_8DocumentE 319 319 __ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS_6StringESA_SA_RKNS_16ResourceResponseE 320 __ZN7WebCore15BackForwardList10removeItemEPNS_11HistoryItemE321 __ZN7WebCore15BackForwardList10setEnabledEb322 __ZN7WebCore15BackForwardList11currentItemEv323 __ZN7WebCore15BackForwardList11forwardItemEv324 __ZN7WebCore15BackForwardList11itemAtIndexEi325 __ZN7WebCore15BackForwardList11setCapacityEi326 __ZN7WebCore15BackForwardList12containsItemEPNS_11HistoryItemE327 __ZN7WebCore15BackForwardList13backListCountEv328 __ZN7WebCore15BackForwardList16forwardListCountEv329 __ZN7WebCore15BackForwardList17backListWithLimitEiRN3WTF6VectorINS1_6RefPtrINS_11HistoryItemEEELm0EEE330 __ZN7WebCore15BackForwardList20forwardListWithLimitEiRN3WTF6VectorINS1_6RefPtrINS_11HistoryItemEEELm0EEE331 __ZN7WebCore15BackForwardList5closeEv332 __ZN7WebCore15BackForwardList6closedEv333 __ZN7WebCore15BackForwardList6goBackEv334 __ZN7WebCore15BackForwardList7addItemEN3WTF10PassRefPtrINS_11HistoryItemEEE335 __ZN7WebCore15BackForwardList7enabledEv336 __ZN7WebCore15BackForwardList7entriesEv337 __ZN7WebCore15BackForwardList8backItemEv338 __ZN7WebCore15BackForwardList8capacityEv339 __ZN7WebCore15BackForwardList8goToItemEPNS_11HistoryItemE340 __ZN7WebCore15BackForwardList9goForwardEv341 __ZN7WebCore15BackForwardListC1EPNS_4PageE342 __ZN7WebCore15BackForwardListD1Ev343 320 __ZN7WebCore15DOMWrapperWorld15unregisterWorldEv 344 321 __ZN7WebCore15DOMWrapperWorldD1Ev … … 423 400 __ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd 424 401 __ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd 402 __ZN7WebCore19BackForwardListImplC1EPNS_4PageE 425 403 __ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri 426 404 __ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv … … 507 485 __ZN7WebCore4KURLC1EPK7__CFURL 508 486 __ZN7WebCore4KURLC1ERKS0_RKNS_6StringE 509 __ZN7WebCore4coreEP20NSURLProtectionSpace510 487 __ZN7WebCore4Node10renderRectEPb 511 488 __ZN7WebCore4Node17stopIgnoringLeaksEv … … 534 511 __ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientEPNS_27GeolocationControllerClientEPNS_23DeviceOrientationClientEPNS_27BackForwardControllerClientE 535 512 __ZN7WebCore4PageD1Ev 513 __ZN7WebCore4coreEP20NSURLProtectionSpace 536 514 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE 537 515 __ZN7WebCore5Cache11setDisabledEb -
trunk/WebCore/WebCore.gypi
r62646 r62792 1391 1391 'history/BackForwardController.h', 1392 1392 'history/BackForwardControllerClient.h', 1393 'history/BackForwardList.cpp',1394 1393 'history/BackForwardList.h', 1394 'history/BackForwardListImpl.cpp', 1395 'history/BackForwardListImpl.h', 1395 1396 'history/BackForwardListChromium.cpp', 1396 1397 'history/CachedFrame.cpp', -
trunk/WebCore/WebCore.pro
r62646 r62792 601 601 editing/WrapContentsInDummySpanCommand.cpp \ 602 602 history/BackForwardController.cpp \ 603 history/BackForwardList .cpp \603 history/BackForwardListImpl.cpp \ 604 604 history/CachedFrame.cpp \ 605 605 history/CachedPage.cpp \ … … 1355 1355 history/BackForwardController.h \ 1356 1356 history/BackForwardControllerClient.h \ 1357 history/BackForwardListImpl.h \ 1357 1358 history/BackForwardList.h \ 1358 1359 history/CachedFrame.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r62646 r62792 49466 49466 </File> 49467 49467 <File 49468 RelativePath="..\history\BackForwardList.cpp"49469 >49470 </File>49471 <File49472 49468 RelativePath="..\history\BackForwardList.h" 49469 > 49470 </File> 49471 <File 49472 RelativePath="..\history\BackForwardListImpl.cpp" 49473 > 49474 </File> 49475 <File 49476 RelativePath="..\history\BackForwardListImpl.h" 49473 49477 > 49474 49478 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r62707 r62792 1115 1115 5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */; }; 1116 1116 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 */; };1118 1117 51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1119 1118 51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; }; … … 4680 4679 BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA846D50DC67A350026C309 /* RenderReplica.h */; }; 4681 4680 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, ); }; }; 4683 4682 BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */; }; 4684 4683 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, ); }; }; 4685 4686 BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; }; 4686 4687 BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; }; … … 6824 6825 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeProcessEvent.cpp; sourceTree = "<group>"; }; 6825 6826 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>"; };6827 6827 51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = "<group>"; }; 6828 6828 51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = "<group>"; }; … … 10286 10286 BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardController.cpp; sourceTree = "<group>"; }; 10287 10287 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>"; }; 10288 10290 BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Scrollbar.cpp; path = platform/Scrollbar.cpp; sourceTree = SOURCE_ROOT; }; 10289 10291 BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; }; … … 11883 11885 9363B6290F8E8FE000803810 /* cf */, 11884 11886 5160F4920B0AA71500C1D2AF /* mac */, 11885 51741D0C0B07259A00ED442C /* BackForwardList.cpp */,11886 11887 51741D0B0B07259A00ED442C /* BackForwardList.h */, 11888 BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */, 11889 BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */, 11887 11890 BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */, 11888 11891 BCA8C81C11E3D36900812FB7 /* BackForwardController.h */, … … 19725 19728 BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */, 19726 19729 BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */, 19730 BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */, 19727 19731 ); 19728 19732 runOnlyForDeploymentPostprocessing = 0; … … 20074 20078 29A812370FBB9C1D00510293 /* AXObjectCache.cpp in Sources */, 20075 20079 29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */, 20076 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */,20077 20080 BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */, 20078 20081 B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */, … … 22111 22114 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend2.cpp in Sources */, 22112 22115 97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */, 22116 BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */, 22113 22117 ); 22114 22118 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/history/BackForwardController.cpp
r62676 r62792 29 29 #include "BackForwardControllerClient.h" 30 30 #include "BackForwardList.h" 31 #include "BackForwardListImpl.h" 31 32 32 33 namespace WebCore { … … 37 38 { 38 39 if (!m_client) 39 m_list = BackForwardList ::create(page);40 m_list = BackForwardListImpl::create(page); 40 41 else 41 42 m_list = m_client->createBackForwardList(); -
trunk/WebCore/history/BackForwardController.h
r62607 r62792 33 33 namespace WebCore { 34 34 35 class Page; 35 36 class BackForwardControllerClient; 36 37 -
trunk/WebCore/history/BackForwardList.h
r53324 r62792 31 31 #include <wtf/RefCounted.h> 32 32 #include <wtf/PassRefPtr.h> 33 #include <wtf/HashSet.h>34 33 #include <wtf/Vector.h> 35 34 36 35 namespace WebCore { 37 36 38 class Document;39 37 class HistoryItem; 40 class Page;41 class SerializedScriptValue;42 class String;43 38 44 39 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector; 45 typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;46 40 47 41 #if PLATFORM(CHROMIUM) … … 63 57 class BackForwardList : public RefCounted<BackForwardList> { 64 58 public: 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; } 67 64 68 65 #if PLATFORM(CHROMIUM) 69 66 // Must be called before any other methods. 70 v oid setClient(BackForwardListClient* client) { m_client = client; }67 virtual void setClient(BackForwardListClient*) = 0; 71 68 #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; 72 93 73 Page* page() { return m_page; } 94 virtual void removeItem(HistoryItem*) = 0; 95 virtual HistoryItemVector& entries() = 0; 74 96 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; 103 98 104 99 #if ENABLE(WML) 105 v oid clearWMLPageHistory();100 virtual void clearWMLPageHistory() = 0; 106 101 #endif 107 102 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; 103 protected: 104 BackForwardList() 105 { 106 } 122 107 }; 123 108 124 } // namespace WebCore109 } // namespace WebCore 125 110 126 #endif 111 #endif // BackForwardList_h -
trunk/WebCore/history/BackForwardListChromium.cpp
r53950 r62792 27 27 28 28 #include "config.h" 29 #include "BackForwardList .h"29 #include "BackForwardListImpl.h" 30 30 31 31 #include "HistoryItem.h" … … 37 37 static const unsigned NoCurrentItemIndex = UINT_MAX; 38 38 39 BackForwardList ::BackForwardList(Page* page)39 BackForwardListImpl::BackForwardListImpl(Page* page) 40 40 : m_page(page) 41 41 , m_client(0) … … 46 46 } 47 47 48 BackForwardList ::~BackForwardList()48 BackForwardListImpl::~BackForwardListImpl() 49 49 { 50 50 ASSERT(m_closed); 51 51 } 52 52 53 void BackForwardList ::addItem(PassRefPtr<HistoryItem> prpItem)53 void BackForwardListImpl::addItem(PassRefPtr<HistoryItem> prpItem) 54 54 { 55 55 ASSERT(prpItem); … … 60 60 } 61 61 62 void BackForwardList ::goToItem(HistoryItem* item)62 void BackForwardListImpl::goToItem(HistoryItem* item) 63 63 { 64 64 m_client->goToItem(item); 65 65 } 66 66 67 HistoryItem* BackForwardList ::backItem()67 HistoryItem* BackForwardListImpl::backItem() 68 68 { 69 69 ASSERT_NOT_REACHED(); … … 71 71 } 72 72 73 HistoryItem* BackForwardList ::forwardItem()73 HistoryItem* BackForwardListImpl::forwardItem() 74 74 { 75 75 ASSERT_NOT_REACHED(); … … 77 77 } 78 78 79 HistoryItem* BackForwardList ::currentItem()79 HistoryItem* BackForwardListImpl::currentItem() 80 80 { 81 81 return m_client->currentItem(); 82 82 } 83 83 84 int BackForwardList ::capacity()84 int BackForwardListImpl::capacity() 85 85 { 86 86 return m_capacity; 87 87 } 88 88 89 void BackForwardList ::setCapacity(int size)89 void BackForwardListImpl::setCapacity(int size) 90 90 { 91 91 m_capacity = size; 92 92 } 93 93 94 bool BackForwardList ::enabled()94 bool BackForwardListImpl::enabled() 95 95 { 96 96 return m_enabled; 97 97 } 98 98 99 void BackForwardList ::setEnabled(bool enabled)99 void BackForwardListImpl::setEnabled(bool enabled) 100 100 { 101 101 m_enabled = enabled; … … 107 107 } 108 108 109 int BackForwardList ::backListCount()109 int BackForwardListImpl::backListCount() 110 110 { 111 111 return m_client->backListCount(); 112 112 } 113 113 114 int BackForwardList ::forwardListCount()114 int BackForwardListImpl::forwardListCount() 115 115 { 116 116 return m_client->forwardListCount(); 117 117 } 118 118 119 HistoryItem* BackForwardList ::itemAtIndex(int index)119 HistoryItem* BackForwardListImpl::itemAtIndex(int index) 120 120 { 121 121 return m_client->itemAtIndex(index); 122 122 } 123 123 124 void BackForwardList ::pushStateItem(PassRefPtr<HistoryItem> newItem)124 void BackForwardListImpl::pushStateItem(PassRefPtr<HistoryItem> newItem) 125 125 { 126 126 RefPtr<HistoryItem> current = m_client->currentItem(); … … 132 132 } 133 133 134 HistoryItemVector& BackForwardList ::entries()134 HistoryItemVector& BackForwardListImpl::entries() 135 135 { 136 136 static HistoryItemVector noEntries; … … 138 138 } 139 139 140 void BackForwardList ::close()140 void BackForwardListImpl::close() 141 141 { 142 142 if (m_client) … … 146 146 } 147 147 148 bool BackForwardList ::closed()148 bool BackForwardListImpl::closed() 149 149 { 150 150 return m_closed; -
trunk/WebCore/history/BackForwardListImpl.cpp
r62674 r62792 26 26 27 27 #include "config.h" 28 #include "BackForwardList .h"28 #include "BackForwardListImpl.h" 29 29 30 30 #include "Frame.h" … … 44 44 static const unsigned NoCurrentItemIndex = UINT_MAX; 45 45 46 BackForwardList ::BackForwardList(Page* page)46 BackForwardListImpl::BackForwardListImpl(Page* page) 47 47 : m_page(page) 48 48 , m_current(NoCurrentItemIndex) … … 53 53 } 54 54 55 BackForwardList ::~BackForwardList()55 BackForwardListImpl::~BackForwardListImpl() 56 56 { 57 57 ASSERT(m_closed); 58 58 } 59 59 60 void BackForwardList ::addItem(PassRefPtr<HistoryItem> prpItem)60 void BackForwardListImpl::addItem(PassRefPtr<HistoryItem> prpItem) 61 61 { 62 62 ASSERT(prpItem); … … 94 94 } 95 95 96 void BackForwardList ::goBack()96 void BackForwardListImpl::goBack() 97 97 { 98 98 ASSERT(m_current > 0); … … 104 104 } 105 105 106 void BackForwardList ::goForward()106 void BackForwardListImpl::goForward() 107 107 { 108 108 ASSERT(m_current < m_entries.size() - 1); … … 114 114 } 115 115 116 void BackForwardList ::goToItem(HistoryItem* item)116 void BackForwardListImpl::goToItem(HistoryItem* item) 117 117 { 118 118 if (!m_entries.size() || !item) … … 130 130 } 131 131 132 HistoryItem* BackForwardList ::backItem()132 HistoryItem* BackForwardListImpl::backItem() 133 133 { 134 134 if (m_current && m_current != NoCurrentItemIndex) … … 137 137 } 138 138 139 HistoryItem* BackForwardList ::currentItem()139 HistoryItem* BackForwardListImpl::currentItem() 140 140 { 141 141 if (m_current != NoCurrentItemIndex) … … 144 144 } 145 145 146 HistoryItem* BackForwardList ::forwardItem()146 HistoryItem* BackForwardListImpl::forwardItem() 147 147 { 148 148 if (m_entries.size() && m_current < m_entries.size() - 1) … … 151 151 } 152 152 153 void BackForwardList ::backListWithLimit(int limit, HistoryItemVector& list)153 void BackForwardListImpl::backListWithLimit(int limit, HistoryItemVector& list) 154 154 { 155 155 list.clear(); … … 161 161 } 162 162 163 void BackForwardList ::forwardListWithLimit(int limit, HistoryItemVector& list)163 void BackForwardListImpl::forwardListWithLimit(int limit, HistoryItemVector& list) 164 164 { 165 165 ASSERT(limit > -1); … … 177 177 } 178 178 179 int BackForwardList ::capacity()179 int BackForwardListImpl::capacity() 180 180 { 181 181 return m_capacity; 182 182 } 183 183 184 void BackForwardList ::setCapacity(int size)184 void BackForwardListImpl::setCapacity(int size) 185 185 { 186 186 while (size < (int)m_entries.size()) { … … 201 201 } 202 202 203 bool BackForwardList ::enabled()203 bool BackForwardListImpl::enabled() 204 204 { 205 205 return m_enabled; 206 206 } 207 207 208 void BackForwardList ::setEnabled(bool enabled)208 void BackForwardListImpl::setEnabled(bool enabled) 209 209 { 210 210 m_enabled = enabled; … … 216 216 } 217 217 218 int BackForwardList ::backListCount()218 int BackForwardListImpl::backListCount() 219 219 { 220 220 return m_current == NoCurrentItemIndex ? 0 : m_current; 221 221 } 222 222 223 int BackForwardList ::forwardListCount()223 int BackForwardListImpl::forwardListCount() 224 224 { 225 225 return m_current == NoCurrentItemIndex ? 0 : (int)m_entries.size() - (m_current + 1); 226 226 } 227 227 228 HistoryItem* BackForwardList ::itemAtIndex(int index)228 HistoryItem* BackForwardListImpl::itemAtIndex(int index) 229 229 { 230 230 // Do range checks without doing math on index to avoid overflow. … … 238 238 } 239 239 240 HistoryItemVector& BackForwardList ::entries()240 HistoryItemVector& BackForwardListImpl::entries() 241 241 { 242 242 return m_entries; 243 243 } 244 244 245 void BackForwardList ::pushStateItem(PassRefPtr<HistoryItem> newItem)245 void BackForwardListImpl::pushStateItem(PassRefPtr<HistoryItem> newItem) 246 246 { 247 247 ASSERT(newItem); … … 257 257 } 258 258 259 void BackForwardList ::close()259 void BackForwardListImpl::close() 260 260 { 261 261 int size = m_entries.size(); … … 268 268 } 269 269 270 bool BackForwardList ::closed()270 bool BackForwardListImpl::closed() 271 271 { 272 272 return m_closed; 273 273 } 274 274 275 void BackForwardList ::removeItem(HistoryItem* item)275 void BackForwardListImpl::removeItem(HistoryItem* item) 276 276 { 277 277 if (!item) … … 295 295 } 296 296 297 bool BackForwardList ::containsItem(HistoryItem* entry)297 bool BackForwardListImpl::containsItem(HistoryItem* entry) 298 298 { 299 299 return m_entryHash.contains(entry); … … 301 301 302 302 #if ENABLE(WML) 303 void BackForwardList ::clearWMLPageHistory()303 void BackForwardListImpl::clearWMLPageHistory() 304 304 { 305 305 RefPtr<HistoryItem> currentItem = this->currentItem(); -
trunk/WebCore/history/BackForwardListImpl.h
r62674 r62792 26 26 */ 27 27 28 #ifndef BackForwardList _h29 #define BackForwardList _h28 #ifndef BackForwardListImpl_h 29 #define BackForwardListImpl_h 30 30 31 #include <wtf/RefCounted.h> 32 #include <wtf/PassRefPtr.h> 31 #include "BackForwardList.h" 33 32 #include <wtf/HashSet.h> 34 #include <wtf/Vector.h>35 33 36 34 namespace WebCore { 37 35 38 class Document;39 36 class HistoryItem; 40 37 class Page; 41 class SerializedScriptValue;42 class String;43 38 44 39 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector; 45 40 typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet; 46 41 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 42 class BackForwardListImpl : public BackForwardList { 43 public: 44 static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); } 45 ~BackForwardListImpl(); 62 46 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; } 67 48 68 49 #if PLATFORM(CHROMIUM) … … 107 88 108 89 private: 109 BackForwardList (Page*);90 BackForwardListImpl(Page*); 110 91 111 92 Page* m_page; … … 122 103 }; 123 104 124 } // namespace WebCore105 } // namespace WebCore 125 106 126 #endif 107 #endif // BackForwardListImpl_h -
trunk/WebKit/mac/ChangeLog
r62679 r62792 1 2010-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 1 14 2010-07-07 Sam Weinig <sam@webkit.org> 2 15 -
trunk/WebKit/mac/History/WebBackForwardList.mm
r58266 r62792 39 39 #import "WebTypesInternal.h" 40 40 #import "WebViewPrivate.h" 41 #import <WebCore/BackForwardList .h>41 #import <WebCore/BackForwardListImpl.h> 42 42 #import <WebCore/HistoryItem.h> 43 43 #import <WebCore/Page.h> … … 110 110 - (id)init 111 111 { 112 return [self initWithBackForwardList:BackForwardList ::create(0)];112 return [self initWithBackForwardList:BackForwardListImpl::create(0)]; 113 113 } 114 114 … … 294 294 - (void)setPageCacheSize:(NSUInteger)size 295 295 { 296 [kit(core(self)->page()) setUsesPageCache:size != 0]; 296 ASSERT(core(self)->isBackForwardListImpl()); 297 [kit(static_cast<BackForwardListImpl*>(core(self))->page()) setUsesPageCache:size != 0]; 297 298 } 298 299 299 300 - (NSUInteger)pageCacheSize 300 301 { 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; 302 304 } 303 305 -
trunk/WebKit/qt/Api/qwebhistory.cpp
r61504 r62792 23 23 #include "qwebframe_p.h" 24 24 25 #include "BackForwardListImpl.h" 25 26 #include "PlatformString.h" 26 27 #include "Image.h" … … 260 261 261 262 //clear visited links 262 WebCore::Page* page = lst->page();263 WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(lst)->page(); 263 264 if (page && page->groupPtr()) 264 265 page->groupPtr()->removeVisitedLinks(); … … 364 365 { 365 366 if (canGoBack()) { 366 WebCore::Page* page = d->lst->page();367 WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); 367 368 page->goToItem(d->lst->backItem(), WebCore::FrameLoadTypeIndexedBackForward); 368 369 } … … 378 379 { 379 380 if (canGoForward()) { 380 WebCore::Page* page = d->lst->page();381 WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); 381 382 page->goToItem(d->lst->forwardItem(), WebCore::FrameLoadTypeIndexedBackForward); 382 383 } … … 390 391 void QWebHistory::goToItem(const QWebHistoryItem &item) 391 392 { 392 WebCore::Page* page = d->lst->page();393 WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); 393 394 page->goToItem(item.d->item, WebCore::FrameLoadTypeIndexedBackForward); 394 395 } … … 539 540 d->lst->removeItem(nullItem); 540 541 // 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()); 542 543 history.goToItem(history.itemAt(currentIndex)); 543 544 } … … 551 552 QWebPagePrivate* QWebHistoryPrivate::page() 552 553 { 553 return QWebFramePrivate::kit( lst->page()->mainFrame())->page()->handle();554 return QWebFramePrivate::kit(static_cast<WebCore::BackForwardListImpl*>(lst)->page()->mainFrame())->page()->handle(); 554 555 } 555 556 -
trunk/WebKit/qt/ChangeLog
r62783 r62792 1 2010-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 1 17 2010-07-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 18 -
trunk/WebKit2/ChangeLog
r62790 r62792 1 2010-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 1 12 2010-07-08 Luiz Agostini <luiz@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org> 2 13 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebBackForwardControllerClient.cpp
r62676 r62792 27 27 28 28 #include "WebPage.h" 29 #include <WebCore/BackForwardList .h>29 #include <WebCore/BackForwardListImpl.h> 30 30 31 31 using namespace WebCore; … … 40 40 PassRefPtr<BackForwardList> WebBackForwardControllerClient::createBackForwardList() 41 41 { 42 return BackForwardList ::create(m_page->corePage());42 return BackForwardListImpl::create(m_page->corePage()); 43 43 } 44 44
Note: See TracChangeset
for help on using the changeset viewer.