Changeset 39060 in webkit
- Timestamp:
- Dec 5, 2008 6:27:15 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r39059 r39060 1 2008-12-04 Brett Wilson <brettw@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Make the page group use the proper link hashing functions rather than 6 calling the string hash functions directly. Add Chromium-specfic ifdefs 7 in the visited link computation functions to allow integration. 8 9 * page/PageGroup.cpp: 10 (WebCore::PageGroup::isLinkVisited): 11 (WebCore::PageGroup::addVisitedLink): 12 * platform/LinkHash.cpp: 13 (WebCore::visitedLinkHash): 14 * platform/LinkHash.h: 15 1 16 2008-12-05 Chris Marrin <cmarrin@apple.com> 2 17 -
trunk/WebCore/page/PageGroup.cpp
r38661 r39060 35 35 #include "LocalStorage.h" 36 36 #include "StorageArea.h" 37 #endif 38 39 #if PLATFORM(CHROMIUM) 40 #include "ChromiumBridge.h" 37 41 #endif 38 42 … … 120 124 bool PageGroup::isLinkVisited(LinkHash visitedLinkHash) 121 125 { 126 #if PLATFORM(CHROMIUM) 127 // Use Chromium's built-in visited link database. 128 return ChromiumBridge::isLinkVisited(visitedLinkHash); 129 #else 122 130 if (!m_visitedLinksPopulated) { 123 131 m_visitedLinksPopulated = true; … … 126 134 } 127 135 return m_visitedLinkHashes.contains(visitedLinkHash); 136 #endif 128 137 } 129 138 130 inline void PageGroup::addVisitedLink(LinkHash stringHash)139 inline void PageGroup::addVisitedLink(LinkHash hash) 131 140 { 132 141 ASSERT(shouldTrackVisitedLinks); 133 LinkHash visitedLinkHash = LinkHashHash::avoidDeletedValue(stringHash); 134 if (!m_visitedLinkHashes.add( visitedLinkHash).second)142 #if !PLATFORM(CHROMIUM) 143 if (!m_visitedLinkHashes.add(hash).second) 135 144 return; 136 Page::visitedStateChanged(this, visitedLinkHash); 145 #endif 146 Page::visitedStateChanged(this, hash); 137 147 } 138 148 … … 142 152 return; 143 153 ASSERT(!url.isEmpty()); 144 addVisitedLink( url.string().impl()->hash());154 addVisitedLink(visitedLinkHash(url.string().characters(), url.string().length())); 145 155 } 146 156 … … 149 159 if (!shouldTrackVisitedLinks) 150 160 return; 151 addVisitedLink( StringImpl::computeHash(characters, length));161 addVisitedLink(visitedLinkHash(characters, length)); 152 162 } 153 163 -
trunk/WebCore/platform/LinkHash.cpp
r38661 r39060 28 28 #include "PlatformString.h" 29 29 #include "StringHash.h" 30 #include "StringImpl.h" 30 31 31 32 namespace WebCore { … … 147 148 } 148 149 150 LinkHash visitedLinkHash(const UChar* url, unsigned length) 151 { 152 return AlreadyHashed::avoidDeletedValue(StringImpl::computeHash(url, length)); 153 } 154 149 155 LinkHash visitedLinkHash(const KURL& base, const AtomicString& attributeURL) 150 156 { … … 168 174 169 175 if (hasColonSlashSlash && !needsTrailingSlash(characters, length)) 170 return AlreadyHashed::avoidDeletedValue(attributeURL.string().impl()->hash());176 return visitedLinkHash(attributeURL.characters(), attributeURL.length()); 171 177 172 178 Vector<UChar, 512> buffer; … … 177 183 buffer.append(characters, length); 178 184 buffer.append('/'); 179 return AlreadyHashed::avoidDeletedValue(StringImpl::computeHash(buffer.data(), buffer.size()));185 return visitedLinkHash(buffer.data(), buffer.size()); 180 186 } 181 187 … … 199 205 } 200 206 201 return AlreadyHashed::avoidDeletedValue(StringImpl::computeHash(buffer.data(), buffer.size()));207 return visitedLinkHash(buffer.data(), buffer.size()); 202 208 } 203 209 -
trunk/WebCore/platform/LinkHash.h
r38663 r39060 54 54 }; 55 55 56 // Returns the has of the string that will be used for visited link coloring. 57 LinkHash visitedLinkHash(const UChar* url, unsigned length); 58 56 59 // Resolves the potentially relative URL "attributeURL" relative to the given 57 60 // base URL, and returns the hash of the string that will be used for visited
Note: See TracChangeset
for help on using the changeset viewer.