Remove visited link handling from PageGroup
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 18:12:57 +0000 (18:12 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 18:12:57 +0000 (18:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139185

Reviewed by Sam Weinig.

Source/WebCore:

* CMakeLists.txt:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* loader/HistoryController.cpp:
* page/Chrome.cpp:
(WebCore::ChromeClient::populateVisitedLinks): Deleted.
* page/ChromeClient.h:
* page/DefaultVisitedLinkStore.cpp: Removed.
* page/DefaultVisitedLinkStore.h: Removed.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
(WebCore::Page::visitedLinkStore):
(WebCore::Page::setVisitedLinkStore):
(WebCore::Page::removeAllVisitedLinks): Deleted.
* page/Page.h:
* page/PageGroup.cpp:
(WebCore::PageGroup::PageGroup):
(WebCore::PageGroup::visitedLinkStore): Deleted.
(WebCore::PageGroup::isLinkVisited): Deleted.
(WebCore::PageGroup::addVisitedLinkHash): Deleted.
(WebCore::PageGroup::addVisitedLink): Deleted.
(WebCore::PageGroup::removeVisitedLink): Deleted.
(WebCore::PageGroup::removeVisitedLinks): Deleted.
(WebCore::PageGroup::removeAllVisitedLinks): Deleted.
(WebCore::PageGroup::setShouldTrackVisitedLinks): Deleted.
* page/PageGroup.h:

Source/WebKit/mac:

* History/WebHistory.mm:
(-[WebHistoryPrivate removeItemForURLString:]):
(-[WebHistoryPrivate removeAllItems]):
(+[WebHistory setOptionalSharedHistory:]):
(+[WebHistory _setVisitedLinkTrackingEnabled:]):
(+[WebHistory _removeAllVisitedLinks]):
(-[WebHistoryPrivate addVisitedLinksToPageGroup:]): Deleted.
(-[WebHistory _addVisitedLinksToPageGroup:]): Deleted.
* History/WebHistoryInternal.h:
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::populateVisitedLinks): Deleted.
* WebView/WebView.mm:
(-[WebView addVisitedLinks:]):
(-[WebView removeVisitedLink:]):

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::populateVisitedLinks): Deleted.
* WebCoreSupport/WebChromeClient.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::populateVisitedLinks): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/DefaultVisitedLinkStore.cpp [deleted file]
Source/WebCore/page/DefaultVisitedLinkStore.h [deleted file]
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageGroup.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebHistory.mm
Source/WebKit/mac/History/WebHistoryInternal.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

index 6463512..9c6d6b5 100644 (file)
@@ -1889,7 +1889,6 @@ set(WebCore_SOURCES
     page/DOMWindowExtension.cpp
     page/DOMWindowProperty.cpp
     page/DebugPageOverlays.cpp
-    page/DefaultVisitedLinkStore.cpp
     page/DeviceController.cpp
     page/DiagnosticLoggingKeys.cpp
     page/DragController.cpp
index fa9b21a..f8d6973 100644 (file)
@@ -1,3 +1,40 @@
+2014-12-02  Anders Carlsson  <andersca@apple.com>
+
+        Remove visited link handling from PageGroup
+        https://bugs.webkit.org/show_bug.cgi?id=139185
+
+        Reviewed by Sam Weinig.
+
+        * CMakeLists.txt:
+        * WebCore.exp.in:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/HistoryController.cpp:
+        * page/Chrome.cpp:
+        (WebCore::ChromeClient::populateVisitedLinks): Deleted.
+        * page/ChromeClient.h:
+        * page/DefaultVisitedLinkStore.cpp: Removed.
+        * page/DefaultVisitedLinkStore.h: Removed.
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::~Page):
+        (WebCore::Page::visitedLinkStore):
+        (WebCore::Page::setVisitedLinkStore):
+        (WebCore::Page::removeAllVisitedLinks): Deleted.
+        * page/Page.h:
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::PageGroup):
+        (WebCore::PageGroup::visitedLinkStore): Deleted.
+        (WebCore::PageGroup::isLinkVisited): Deleted.
+        (WebCore::PageGroup::addVisitedLinkHash): Deleted.
+        (WebCore::PageGroup::addVisitedLink): Deleted.
+        (WebCore::PageGroup::removeVisitedLink): Deleted.
+        (WebCore::PageGroup::removeVisitedLinks): Deleted.
+        (WebCore::PageGroup::removeAllVisitedLinks): Deleted.
+        (WebCore::PageGroup::setShouldTrackVisitedLinks): Deleted.
+        * page/PageGroup.h:
+
 2014-12-02  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
 
         Use references instead of pointers in EditingStyle
index e4511af..7118571 100644 (file)
@@ -1550,13 +1550,8 @@ __ZN7WebCore9LayerPoolD1Ev
 __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache33markPagesForVistedLinkStyleRecalcEv
 __ZN7WebCore9PageCache6removeEPNS_11HistoryItemE
-__ZN7WebCore9PageGroup13isLinkVisitedEy
-__ZN7WebCore9PageGroup14addVisitedLinkEPKtm
 __ZN7WebCore9PageGroup16syncLocalStorageEv
 __ZN7WebCore9PageGroup17closeLocalStorageEv
-__ZN7WebCore9PageGroup18addVisitedLinkHashEy
-__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
-__ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
 __ZN7WebCore9PageGroup30closeIdleLocalStorageDatabasesEv
 __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
 __ZN7WebCore9Scrollbar11mouseExitedEv
index 90beabf..365ada8 100644 (file)
     <ClCompile Include="..\page\DOMWindow.cpp" />
     <ClCompile Include="..\page\DOMWindowExtension.cpp" />
     <ClCompile Include="..\page\DOMWindowProperty.cpp" />
-    <ClCompile Include="..\page\DefaultVisitedLinkStore.cpp" />
     <ClCompile Include="..\page\DebugPageOverlays.cpp" />
     <ClCompile Include="..\page\DragController.cpp" />
     <ClCompile Include="..\page\scrolling\coordinatedgraphics\ScrollingCoordinatorCoordinatedGraphics.cpp" />
     <ClInclude Include="..\page\DOMWindowExtension.h" />
     <ClInclude Include="..\page\DOMWindowProperty.h" />
     <ClInclude Include="..\page\DebugPageOverlays.h" />
-    <ClInclude Include="..\page\DefaultVisitedLinkStore.h" />
     <ClInclude Include="..\page\DragActions.h" />
     <ClInclude Include="..\page\DragClient.h" />
     <ClInclude Include="..\page\DragController.h" />
index e082198..e6d44ef 100644 (file)
     <ClCompile Include="..\page\DebugPageOverlays.cpp">
       <Filter>page</Filter>
     </ClCompile>
-    <ClCompile Include="..\page\DefaultVisitedLinkStore.cpp">
-      <Filter>page</Filter>
-    </ClCompile>
     <ClCompile Include="..\page\DragController.cpp">
       <Filter>page</Filter>
     </ClCompile>
     <ClInclude Include="..\page\DebugPageOverlays.h">
       <Filter>page</Filter>
     </ClInclude>
-    <ClInclude Include="..\page\DefaultVisitedLinkStore.h">
-      <Filter>page</Filter>
-    </ClInclude>
     <ClInclude Include="..\rendering\BorderEdge.h">
       <Filter>rendering</Filter>
     </ClInclude>
index 89fb3c7..4fe62ae 100644 (file)
                1AEF4E67170E160300AB2799 /* CachedFontClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEF4E66170E160300AB2799 /* CachedFontClient.h */; };
                1AEF4E69170E174800AB2799 /* CachedSVGDocumentClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEF4E68170E174800AB2799 /* CachedSVGDocumentClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AF326790D78B9440068F0C4 /* EditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF326770D78B9440068F0C4 /* EditorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               1AF4CEE918BC350100BC2D34 /* DefaultVisitedLinkStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF4CEE718BC350100BC2D34 /* DefaultVisitedLinkStore.cpp */; };
-               1AF4CEEA18BC350100BC2D34 /* DefaultVisitedLinkStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF4CEE818BC350100BC2D34 /* DefaultVisitedLinkStore.h */; };
                1AF4CEEC18BC3C1B00BC2D34 /* VisitedLinkStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF4CEEB18BC3C1B00BC2D34 /* VisitedLinkStore.cpp */; };
                1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF62EE314DA22A70041556C /* ScrollingCoordinatorMac.mm */; };
                1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF62EE414DA22A70041556C /* ScrollingCoordinator.cpp */; };
                1AEF4E66170E160300AB2799 /* CachedFontClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFontClient.h; sourceTree = "<group>"; };
                1AEF4E68170E174800AB2799 /* CachedSVGDocumentClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocumentClient.h; sourceTree = "<group>"; };
                1AF326770D78B9440068F0C4 /* EditorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditorClient.h; sourceTree = "<group>"; };
-               1AF4CEE718BC350100BC2D34 /* DefaultVisitedLinkStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultVisitedLinkStore.cpp; sourceTree = "<group>"; };
-               1AF4CEE818BC350100BC2D34 /* DefaultVisitedLinkStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultVisitedLinkStore.h; sourceTree = "<group>"; };
                1AF4CEEB18BC3C1B00BC2D34 /* VisitedLinkStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkStore.cpp; sourceTree = "<group>"; };
                1AF62EE314DA22A70041556C /* ScrollingCoordinatorMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingCoordinatorMac.mm; sourceTree = "<group>"; };
                1AF62EE414DA22A70041556C /* ScrollingCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingCoordinator.cpp; sourceTree = "<group>"; };
                                975CA289130365F800E99AD9 /* Crypto.idl */,
                                0F6A12BB1A00923700C6DE72 /* DebugPageOverlays.cpp */,
                                0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */,
-                               1AF4CEE718BC350100BC2D34 /* DefaultVisitedLinkStore.cpp */,
-                               1AF4CEE818BC350100BC2D34 /* DefaultVisitedLinkStore.h */,
                                CCC2B51015F613060048CDD6 /* DeviceClient.h */,
                                CCC2B51115F613060048CDD6 /* DeviceController.cpp */,
                                CCC2B51215F613060048CDD6 /* DeviceController.h */,
                                41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
                                FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */,
                                4167EBF6102962BA003D252A /* DefaultSharedWorkerRepository.h in Headers */,
-                               1AF4CEEA18BC350100BC2D34 /* DefaultVisitedLinkStore.h in Headers */,
                                FD31602C12B0267600C1A359 /* DelayDSPKernel.h in Headers */,
                                FD31602E12B0267600C1A359 /* DelayNode.h in Headers */,
                                FD31603112B0267600C1A359 /* DelayProcessor.h in Headers */,
                                41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */,
                                FD06DFA5134A4DEF006F5D7D /* DefaultAudioDestinationNode.cpp in Sources */,
                                4167EBF5102962BA003D252A /* DefaultSharedWorkerRepository.cpp in Sources */,
-                               1AF4CEE918BC350100BC2D34 /* DefaultVisitedLinkStore.cpp in Sources */,
                                FD31602B12B0267600C1A359 /* DelayDSPKernel.cpp in Sources */,
                                FD31602D12B0267600C1A359 /* DelayNode.cpp in Sources */,
                                FD31603012B0267600C1A359 /* DelayProcessor.cpp in Sources */,
index 82424cb..96df50a 100644 (file)
@@ -41,6 +41,7 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HistoryItem.h"
+#include "LinkHash.h"
 #include "Logging.h"
 #include "MainFrame.h"
 #include "Page.h"
index 9fa2b2e..3f03b35 100644 (file)
@@ -572,10 +572,6 @@ void ChromeClient::annotatedRegionsChanged()
 }
 #endif
 
-void ChromeClient::populateVisitedLinks()
-{
-}
-
 bool ChromeClient::shouldReplaceWithGeneratedFileForUpload(const String&, String&)
 {
     return false;
index 3bbd6c0..2cdda49 100644 (file)
@@ -228,8 +228,6 @@ public:
     virtual void annotatedRegionsChanged();
 #endif
 
-    virtual void populateVisitedLinks();
-
     virtual bool shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename);
     virtual String generateReplacementFile(const String& path);
 
diff --git a/Source/WebCore/page/DefaultVisitedLinkStore.cpp b/Source/WebCore/page/DefaultVisitedLinkStore.cpp
deleted file mode 100644 (file)
index 89fcc92..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DefaultVisitedLinkStore.h"
-
-#include "Page.h"
-#include "PageGroup.h"
-
-namespace WebCore {
-
-PassRefPtr<DefaultVisitedLinkStore> DefaultVisitedLinkStore::create()
-{
-    return adoptRef(new DefaultVisitedLinkStore);
-}
-
-DefaultVisitedLinkStore::DefaultVisitedLinkStore()
-{
-}
-
-DefaultVisitedLinkStore::~DefaultVisitedLinkStore()
-{
-}
-
-bool DefaultVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL&, const AtomicString&)
-{
-    return page.group().isLinkVisited(linkHash);
-}
-
-void DefaultVisitedLinkStore::addVisitedLink(Page& page, LinkHash linkHash)
-{
-    page.group().addVisitedLinkHash(linkHash);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/page/DefaultVisitedLinkStore.h b/Source/WebCore/page/DefaultVisitedLinkStore.h
deleted file mode 100644 (file)
index 3c297ad..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DefaultVisitedLinkStore_h
-#define DefaultVisitedLinkStore_h
-
-#include "VisitedLinkStore.h"
-
-namespace WebCore {
-
-class DefaultVisitedLinkStore : public VisitedLinkStore {
-public:
-    static PassRefPtr<DefaultVisitedLinkStore> create();
-    virtual ~DefaultVisitedLinkStore();
-
-private:
-    DefaultVisitedLinkStore();
-
-    virtual bool isLinkVisited(Page&, LinkHash, const URL& baseURL, const AtomicString& attributeURL) override;
-    virtual void addVisitedLink(Page&, LinkHash) override;
-};
-
-} // namespace WebCore
-
-#endif // DefaultVisitedLinkStore_h
index 49d4c1a..00aac8b 100644 (file)
@@ -203,7 +203,7 @@ Page::Page(PageConfiguration& pageConfiguration)
     , m_lastSpatialNavigationCandidatesCount(0) // NOTE: Only called from Internals for Spatial Navigation testing.
     , m_framesHandlingBeforeUnloadEvent(0)
     , m_userContentController(WTF::move(pageConfiguration.userContentController))
-    , m_visitedLinkStore(WTF::move(pageConfiguration.visitedLinkStore))
+    , m_visitedLinkStore(*WTF::move(pageConfiguration.visitedLinkStore))
     , m_sessionID(SessionID::defaultSessionID())
     , m_isClosing(false)
     , m_isPlayingAudio(false)
@@ -215,8 +215,7 @@ Page::Page(PageConfiguration& pageConfiguration)
     if (m_userContentController)
         m_userContentController->addPage(*this);
 
-    if (m_visitedLinkStore)
-        m_visitedLinkStore->addPage(*this);
+    m_visitedLinkStore->addPage(*this);
 
     if (!allPages) {
         allPages = new HashSet<Page*>;
@@ -270,8 +269,7 @@ Page::~Page()
 
     if (m_userContentController)
         m_userContentController->removePage(*this);
-    if (m_visitedLinkStore)
-        m_visitedLinkStore->removePage(*this);
+    m_visitedLinkStore->removePage(*this);
 }
 
 void Page::clearPreviousItemFromAllPages(HistoryItem* item)
@@ -1034,21 +1032,6 @@ const String& Page::userStyleSheet() const
     return m_userStyleSheet;
 }
 
-void Page::removeAllVisitedLinks()
-{
-    if (!allPages)
-        return;
-    HashSet<PageGroup*> groups;
-    HashSet<Page*>::iterator pagesEnd = allPages->end();
-    for (HashSet<Page*>::iterator it = allPages->begin(); it != pagesEnd; ++it) {
-        if (PageGroup* group = (*it)->groupPtr())
-            groups.add(group);
-    }
-    HashSet<PageGroup*>::iterator groupsEnd = groups.end();
-    for (HashSet<PageGroup*>::iterator it = groups.begin(); it != groupsEnd; ++it)
-        (*it)->removeVisitedLinks();
-}
-
 void Page::invalidateStylesForAllLinks()
 {
     for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
@@ -1631,17 +1614,12 @@ void Page::setUserContentController(UserContentController* userContentController
 
 VisitedLinkStore& Page::visitedLinkStore()
 {
-    if (m_visitedLinkStore)
-        return *m_visitedLinkStore;
-
-    return group().visitedLinkStore();
+    return m_visitedLinkStore;
 }
 
 void Page::setVisitedLinkStore(PassRef<VisitedLinkStore> visitedLinkStore)
 {
-    if (m_visitedLinkStore)
-        m_visitedLinkStore->removePage(*this);
-
+    m_visitedLinkStore->removePage(*this);
     m_visitedLinkStore = WTF::move(visitedLinkStore);
     m_visitedLinkStore->addPage(*this);
 
index ce7a2f7..f215767 100644 (file)
@@ -315,8 +315,6 @@ public:
     void setDebugger(JSC::Debugger*);
     JSC::Debugger* debugger() const { return m_debugger; }
 
-    static void removeAllVisitedLinks();
-
     WEBCORE_EXPORT void invalidateStylesForAllLinks();
     WEBCORE_EXPORT void invalidateStylesForLink(LinkHash);
 
@@ -570,7 +568,7 @@ private:
     unsigned m_framesHandlingBeforeUnloadEvent;
 
     RefPtr<UserContentController> m_userContentController;
-    RefPtr<VisitedLinkStore> m_visitedLinkStore;
+    Ref<VisitedLinkStore> m_visitedLinkStore;
 
     HashSet<ViewStateChangeObserver*> m_viewStateChangeObservers;
 
index c5e9ba4..45eed08 100644 (file)
@@ -29,7 +29,6 @@
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "DOMWrapperWorld.h"
-#include "DefaultVisitedLinkStore.h"
 #include "Document.h"
 #include "DocumentStyleSheetCollection.h"
 #include "GroupSettings.h"
@@ -39,7 +38,6 @@
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "StorageNamespace.h"
-#include "VisitedLinkStore.h"
 #include <wtf/StdLibExtras.h>
 
 #if ENABLE(VIDEO_TRACK)
@@ -60,19 +58,15 @@ static unsigned getUniqueIdentifier()
 
 // --------
 
-static bool shouldTrackVisitedLinks = false;
-
 PageGroup::PageGroup(const String& name)
     : m_name(name)
-    , m_visitedLinksPopulated(false)
     , m_identifier(getUniqueIdentifier())
     , m_groupSettings(std::make_unique<GroupSettings>())
 {
 }
 
 PageGroup::PageGroup(Page& page)
-    : m_visitedLinksPopulated(false)
-    , m_identifier(getUniqueIdentifier())
+    : m_identifier(getUniqueIdentifier())
     , m_groupSettings(std::make_unique<GroupSettings>())
 {
     addPage(page);
@@ -170,94 +164,6 @@ void PageGroup::removePage(Page& page)
     m_pages.remove(&page);
 }
 
-VisitedLinkStore& PageGroup::visitedLinkStore()
-{
-    if (!m_visitedLinkStore)
-        m_visitedLinkStore = DefaultVisitedLinkStore::create();
-
-    return *m_visitedLinkStore;
-}
-
-bool PageGroup::isLinkVisited(LinkHash visitedLinkHash)
-{
-    if (!m_visitedLinksPopulated) {
-        m_visitedLinksPopulated = true;
-        ASSERT(!m_pages.isEmpty());
-        (*m_pages.begin())->chrome().client().populateVisitedLinks();
-    }
-    return m_visitedLinkHashes.contains(visitedLinkHash);
-}
-
-void PageGroup::addVisitedLinkHash(LinkHash hash)
-{
-    if (shouldTrackVisitedLinks)
-        addVisitedLink(hash);
-}
-
-inline void PageGroup::addVisitedLink(LinkHash hash)
-{
-    ASSERT(shouldTrackVisitedLinks);
-    if (!m_visitedLinkHashes.add(hash).isNewEntry)
-        return;
-    for (auto& page : m_pages)
-        page->invalidateStylesForLink(hash);
-    pageCache()->markPagesForVistedLinkStyleRecalc();
-}
-
-void PageGroup::addVisitedLink(const URL& url)
-{
-    if (!shouldTrackVisitedLinks)
-        return;
-    ASSERT(!url.isEmpty());
-    addVisitedLink(visitedLinkHash(url.string()));
-}
-
-void PageGroup::addVisitedLink(const UChar* characters, size_t length)
-{
-    if (!shouldTrackVisitedLinks)
-        return;
-    addVisitedLink(visitedLinkHash(characters, length));
-}
-
-void PageGroup::removeVisitedLink(const URL& url)
-{
-    LinkHash hash = visitedLinkHash(url.string());
-    ASSERT(m_visitedLinkHashes.contains(hash));
-    m_visitedLinkHashes.remove(hash);
-
-    // FIXME: Why can't we just invalidate the single visited link hash here?
-    for (auto& page : m_pages)
-        page->invalidateStylesForAllLinks();
-    pageCache()->markPagesForVistedLinkStyleRecalc();
-}
-
-void PageGroup::removeVisitedLinks()
-{
-    m_visitedLinksPopulated = false;
-    if (m_visitedLinkHashes.isEmpty())
-        return;
-    m_visitedLinkHashes.clear();
-
-    for (auto& page : m_pages)
-        page->invalidateStylesForAllLinks();
-    pageCache()->markPagesForVistedLinkStyleRecalc();
-}
-
-void PageGroup::removeAllVisitedLinks()
-{
-    Page::removeAllVisitedLinks();
-    pageCache()->markPagesForVistedLinkStyleRecalc();
-}
-
-void PageGroup::setShouldTrackVisitedLinks(bool shouldTrack)
-{
-    if (shouldTrackVisitedLinks == shouldTrack)
-        return;
-    shouldTrackVisitedLinks = shouldTrack;
-    if (!shouldTrackVisitedLinks)
-        removeAllVisitedLinks();
-}
-
 StorageNamespace* PageGroup::localStorage()
 {
     if (!m_localStorage)
index bc5f44c..3f6223b 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef PageGroup_h
 #define PageGroup_h
 
-#include "LinkHash.h"
 #include "SecurityOriginHash.h"
 #include "Supplementable.h"
 #include "UserScript.h"
@@ -42,7 +41,6 @@ namespace WebCore {
     class Page;
     class SecurityOrigin;
     class StorageNamespace;
-    class VisitedLinkStore;
 
 #if ENABLE(VIDEO_TRACK)
     class CaptionPreferencesChangedListener;
@@ -71,19 +69,6 @@ namespace WebCore {
         void addPage(Page&);
         void removePage(Page&);
 
-        VisitedLinkStore& visitedLinkStore();
-
-        WEBCORE_EXPORT bool isLinkVisited(LinkHash);
-
-        void addVisitedLink(const URL&);
-        WEBCORE_EXPORT void addVisitedLink(const UChar*, size_t);
-        WEBCORE_EXPORT void addVisitedLinkHash(LinkHash);
-        WEBCORE_EXPORT void removeVisitedLink(const URL&);
-        void removeVisitedLinks();
-
-        WEBCORE_EXPORT static void setShouldTrackVisitedLinks(bool);
-        WEBCORE_EXPORT static void removeAllVisitedLinks();
-
         const String& name() { return m_name; }
         unsigned identifier() { return m_identifier; }
 
@@ -100,16 +85,9 @@ namespace WebCore {
 #endif
 
     private:
-        WEBCORE_EXPORT void addVisitedLink(LinkHash);
-
         String m_name;
         HashSet<Page*> m_pages;
 
-        RefPtr<VisitedLinkStore> m_visitedLinkStore;
-
-        HashSet<LinkHash, LinkHashHash> m_visitedLinkHashes;
-        bool m_visitedLinksPopulated;
-
         unsigned m_identifier;
         RefPtr<StorageNamespace> m_localStorage;
         HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageNamespace>> m_transientLocalStorageMap;
index 5f1e062..fceb88d 100644 (file)
@@ -1,3 +1,26 @@
+2014-12-02  Anders Carlsson  <andersca@apple.com>
+
+        Remove visited link handling from PageGroup
+        https://bugs.webkit.org/show_bug.cgi?id=139185
+
+        Reviewed by Sam Weinig.
+
+        * History/WebHistory.mm:
+        (-[WebHistoryPrivate removeItemForURLString:]):
+        (-[WebHistoryPrivate removeAllItems]):
+        (+[WebHistory setOptionalSharedHistory:]):
+        (+[WebHistory _setVisitedLinkTrackingEnabled:]):
+        (+[WebHistory _removeAllVisitedLinks]):
+        (-[WebHistoryPrivate addVisitedLinksToPageGroup:]): Deleted.
+        (-[WebHistory _addVisitedLinksToPageGroup:]): Deleted.
+        * History/WebHistoryInternal.h:
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::populateVisitedLinks): Deleted.
+        * WebView/WebView.mm:
+        (-[WebView addVisitedLinks:]):
+        (-[WebView removeVisitedLink:]):
+
 2014-12-01  Timothy Horton  <timothy_horton@apple.com>
 
         Try to fix the Mac build.
index 20423bc..56d58e5 100644 (file)
@@ -111,8 +111,6 @@ private:
 - (void)setHistoryAgeInDaysLimit:(int)limit;
 - (int)historyAgeInDaysLimit;
 
-- (void)addVisitedLinksToPageGroup:(PageGroup&)group;
-
 @end
 
 @implementation WebHistoryPrivate
@@ -281,7 +279,7 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
 #endif
 
     if (![_entriesByURL count])
-        PageGroup::removeAllVisitedLinks();
+        WebVisitedLinkStore::removeAllVisitedLinks();
 
     return YES;
 }
@@ -447,7 +445,7 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
     [_orderedLastVisitedDays release];
     _orderedLastVisitedDays = nil;
 
-    PageGroup::removeAllVisitedLinks();
+    WebVisitedLinkStore::removeAllVisitedLinks();
 
     return YES;
 }
@@ -695,22 +693,6 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
     return result;
 }
 
-- (void)addVisitedLinksToPageGroup:(PageGroup&)group
-{
-    NSEnumerator *enumerator = [_entriesByURL keyEnumerator];
-    while (NSString *url = [enumerator nextObject]) {
-        size_t length = [url length];
-        const UChar* characters = CFStringGetCharactersPtr(reinterpret_cast<CFStringRef>(url));
-        if (characters)
-            group.addVisitedLink(characters, length);
-        else {
-            Vector<UChar, 512> buffer(length);
-            [url getCharacters:buffer.data()];
-            group.addVisitedLink(buffer.data(), length);
-        }
-    }
-}
-
 - (void)addVisitedLinksToVisitedLinkStore:(WebVisitedLinkStore&)visitedLinkStore
 {
     for (NSString *urlString in _entriesByURL)
@@ -735,8 +717,6 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
     [_sharedHistory release];
     _sharedHistory = [history retain];
 
-    PageGroup::setShouldTrackVisitedLinks(history);
-    PageGroup::removeAllVisitedLinks();
     WebVisitedLinkStore::setShouldTrackVisitedLinks(history);
     WebVisitedLinkStore::removeAllVisitedLinks();
 }
@@ -920,13 +900,11 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
 
 + (void)_setVisitedLinkTrackingEnabled:(BOOL)visitedLinkTrackingEnabled
 {
-    PageGroup::setShouldTrackVisitedLinks(visitedLinkTrackingEnabled);
     WebVisitedLinkStore::setShouldTrackVisitedLinks(visitedLinkTrackingEnabled);
 }
 
 + (void)_removeAllVisitedLinks
 {
-    PageGroup::removeAllVisitedLinks();
     WebVisitedLinkStore::removeAllVisitedLinks();
 }
 
@@ -948,11 +926,6 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
     [entries release];
 }
 
-- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group
-{
-    [_historyPrivate addVisitedLinksToPageGroup:group];
-}
-
 - (void)_addVisitedLinksToVisitedLinkStore:(WebVisitedLinkStore &)visitedLinkStore
 {
     [_historyPrivate addVisitedLinksToVisitedLinkStore:visitedLinkStore];
index bbc064e..83add2b 100644 (file)
@@ -36,6 +36,5 @@ namespace WebCore {
 
 @interface WebHistory (WebInternal)
 - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure;
-- (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group;
 - (void)_addVisitedLinksToVisitedLinkStore:(WebVisitedLinkStore&)visitedLinkStore;
 @end
index b56d1f3..80dad24 100644 (file)
@@ -124,7 +124,6 @@ public:
 #endif
     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) override;
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded) override;
-    virtual void populateVisitedLinks() override;
 
 #if ENABLE(DASHBOARD_SUPPORT)
     virtual void annotatedRegionsChanged() override;
index 2cb1c4b..70b0b30 100644 (file)
@@ -707,22 +707,6 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin,
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-void WebChromeClient::populateVisitedLinks()
-{
-    if ([m_webView historyDelegate]) {
-        WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(m_webView);
-        
-        if (implementations->populateVisitedLinksFunc)
-            CallHistoryDelegate(implementations->populateVisitedLinksFunc, m_webView, @selector(populateVisitedLinksForWebView:));
-
-        return;
-    }
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [[WebHistory optionalSharedHistory] _addVisitedLinksToPageGroup:[m_webView page]->group()];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
 #if ENABLE(DASHBOARD_SUPPORT)
 
 void WebChromeClient::annotatedRegionsChanged()
index a5d954c..2cc9217 100644 (file)
@@ -7005,28 +7005,12 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSC::JSValue j
     WebVisitedLinkStore& visitedLinkStore = _private->group->visitedLinkStore();
     for (NSString *urlString in visitedLinks)
         visitedLinkStore.addVisitedLink(urlString);
-
-    PageGroup& group = core(self)->group();
-
-    NSEnumerator *enumerator = [visitedLinks objectEnumerator];
-    while (NSString *url = [enumerator nextObject]) {
-        size_t length = [url length];
-        const UChar* characters = CFStringGetCharactersPtr(reinterpret_cast<CFStringRef>(url));
-        if (characters)
-            group.addVisitedLink(characters, length);
-        else {
-            Vector<UChar, 512> buffer(length);
-            [url getCharacters:buffer.data()];
-            group.addVisitedLink(buffer.data(), length);
-        }
-    }
 }
 
 #if PLATFORM(IOS)
 - (void)removeVisitedLink:(NSURL *)url
 {
     _private->group->visitedLinkStore().removeVisitedLink(URL(url).string());
-    core(self)->group().removeVisitedLink(url);
 }
 #endif
 
index 20b6f2e..475b3a5 100644 (file)
@@ -1,3 +1,14 @@
+2014-12-02  Anders Carlsson  <andersca@apple.com>
+
+        Remove visited link handling from PageGroup
+        https://bugs.webkit.org/show_bug.cgi?id=139185
+
+        Reviewed by Sam Weinig.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::populateVisitedLinks): Deleted.
+        * WebCoreSupport/WebChromeClient.h:
+
 2014-12-01  Anders Carlsson  <andersca@apple.com>
 
         Remove IWebCookieManager on Windows
index 6cd9f54..b8b60ff 100644 (file)
@@ -635,10 +635,6 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_
     notImplemented();
 }
 
-void WebChromeClient::populateVisitedLinks()
-{
-}
-
 void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
 {
     RefPtr<FileChooser> fileChooser = prpFileChooser;
index cd792c4..2154a4f 100644 (file)
@@ -119,8 +119,6 @@ public:
     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
 
-    virtual void populateVisitedLinks();
-
     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
     virtual void loadIconForFiles(const Vector<WTF::String>&, WebCore::FileIconLoader*);
 
index a126a40..c52d803 100644 (file)
@@ -6440,7 +6440,6 @@ HRESULT WebView::addVisitedLinks(BSTR* visitedURLs, unsigned visitedURLCount)
     for (unsigned i = 0; i < visitedURLCount; ++i) {
         BSTR url = visitedURLs[i];
         unsigned length = SysStringLen(url);
-        group.addVisitedLink(url, length);
 
         visitedLinkStore.addVisitedLink(String(url, length));
     }
index d0c11b7..b998efa 100644 (file)
@@ -1,3 +1,14 @@
+2014-12-02  Anders Carlsson  <andersca@apple.com>
+
+        Remove visited link handling from PageGroup
+        https://bugs.webkit.org/show_bug.cgi?id=139185
+
+        Reviewed by Sam Weinig.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::populateVisitedLinks): Deleted.
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
 2014-12-01  Anders Carlsson  <andersca@apple.com>
 
         Remove WKBundleRemoveAllVisitedLinks
index 46dde8c..bb3c681 100644 (file)
@@ -733,10 +733,6 @@ void WebChromeClient::annotatedRegionsChanged()
 }
 #endif
 
-void WebChromeClient::populateVisitedLinks()
-{
-}
-
 bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename)
 {
     generatedFilename = m_page->injectedBundleUIClient().shouldGenerateFileForUpload(m_page, path);
index c3c77a1..78238d2 100644 (file)
@@ -150,8 +150,6 @@ private:
     virtual void annotatedRegionsChanged() override;
 #endif
 
-    virtual void populateVisitedLinks() override;
-    
     virtual bool shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename) override;
     virtual String generateReplacementFile(const String& path) override;