Changeset 64775 in webkit
- Timestamp:
- Aug 5, 2010 12:54:13 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 1 added
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64768 r64775 1 2010-08-05 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Add VisitedLinkProvider class 6 https://bugs.webkit.org/show_bug.cgi?id=43570 7 8 * Shared/CoreIPCSupport/WebProcessMessageKinds.h: 9 (WebProcessMessage::): 10 Add SetVisitedLinkTable, VisitedLinkStateChanged and AllVisitedLinkStateChanged. 11 12 * UIProcess/VisitedLinkProvider.cpp: Added. 13 (WebKit::VisitedLinkProvider::VisitedLinkProvider): 14 Initialize table. 15 16 (WebKit::VisitedLinkProvider::populateVisitedLinksIfNeeded): 17 Ask the context to populate visited links. 18 19 (WebKit::VisitedLinkProvider::addVisitedLink): 20 Add the link hash to the set of pending visited links and start the timer. 21 22 (WebKit::nextPowerOf2): 23 Add helper function. 24 25 (WebKit::tableSizeForKeyCount): 26 Given a key count, returns a table size. The table size is always a power of two, and 27 is chosen so that the table is always at least half empty. 28 29 (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired): 30 First, check if we need to resize the hash table and allocate new shared memory for it if that is the case. 31 Then, go through the pending link hash vector and insert all the elements in the table. Finally, notify the web 32 process about visited links whose state have changed. 33 34 * WebProcess/WebProcess.cpp: 35 (WebKit::WebProcess::didReceiveMessage): 36 Add case statements. 37 38 * win/WebKit2.vcproj: 39 * WebKit2.xcodeproj/project.pbxproj: 40 Add VisitedLinkProvider.cpp and VisitedLinkProvider.h. 41 1 42 2010-08-05 Anders Carlsson <andersca@apple.com> 2 43 -
trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
r64492 r64775 34 34 35 35 enum Kind { 36 SetVisitedLinkTable, 37 VisitedLinkStateChanged, 38 AllVisitedLinkStateChanged, 39 40 // FIXME: Remove AddVisitedLink. 36 41 AddVisitedLink, 37 42 LoadInjectedBundle, -
trunk/WebKit2/UIProcess/VisitedLinkProvider.h
r64768 r64775 24 24 */ 25 25 26 #ifndef WebProcessMessageKinds_h27 #define WebProcessMessageKinds_h26 #ifndef VisitedLinkProvider_h 27 #define VisitedLinkProvider_h 28 28 29 // Messages sent from WebKit to the web process. 29 #include "RunLoop.h" 30 #include "VisitedLinkTable.h" 31 #include <WebCore/LinkHash.h> 32 #include <wtf/HashSet.h> 33 #include <wtf/Noncopyable.h> 30 34 31 #include "MessageID.h" 35 namespace WebCore { 36 class String; 37 } 32 38 33 namespace Web ProcessMessage{39 namespace WebKit { 34 40 35 enum Kind { 36 AddVisitedLink, 37 LoadInjectedBundle, 38 SetApplicationCacheDirectory, 39 SetShouldTrackVisitedLinks, 40 Create, 41 RegisterURLSchemeAsEmptyDocument, 42 #if PLATFORM(MAC) 43 SetupAcceleratedCompositingPort 44 #endif 41 class WebContext; 42 43 class VisitedLinkProvider : Noncopyable { 44 public: 45 explicit VisitedLinkProvider(WebContext*); 46 47 void populateVisitedLinksIfNeeded(); 48 void addVisitedLink(WebCore::LinkHash); 49 50 private: 51 void pendingVisitedLinksTimerFired(); 52 53 WebContext* m_context; 54 bool m_visitedLinksPopulated; 55 56 unsigned m_keyCount; 57 unsigned m_tableSize; 58 VisitedLinkTable m_table; 59 60 HashSet<WebCore::LinkHash, WebCore::LinkHashHash> m_pendingVisitedLinks; 61 RunLoop::Timer<VisitedLinkProvider> m_pendingVisitedLinksTimer; 45 62 }; 46 63 47 } 64 } // namespace WebKit 48 65 49 namespace CoreIPC { 50 51 template<> struct MessageKindTraits<WebProcessMessage::Kind> { 52 static const MessageClass messageClass = MessageClassWebProcess; 53 }; 54 55 } 56 57 #endif // WebProcessMessageKinds_h 66 #endif // VisitedLinkProvider_h -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r64768 r64775 35 35 1A0F29CB120B37160053D1B9 /* VisitedLinkTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */; }; 36 36 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */; }; 37 1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */; }; 38 1A0F29E4120B44420053D1B9 /* VisitedLinkProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */; }; 37 39 1A10475A110A5AD500A43ECD /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */; }; 38 40 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C79A100E7FC50078DEBC /* WebCore.framework */; }; … … 345 347 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkTable.cpp; sourceTree = "<group>"; }; 346 348 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTable.h; sourceTree = "<group>"; }; 349 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkProvider.cpp; sourceTree = "<group>"; }; 350 1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkProvider.h; sourceTree = "<group>"; }; 347 351 1A1C648611F415B700553C19 /* WebContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMac.mm; sourceTree = "<group>"; }; 348 352 1A2161AE11F37664008AD0F5 /* NPRuntimeObjectMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPRuntimeObjectMap.h; sourceTree = "<group>"; }; … … 950 954 BC111B08112F5E3C00337BAB /* ResponsivenessTimer.cpp */, 951 955 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */, 956 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */, 957 1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */, 952 958 BC72BA1B11E64907001EB4EA /* WebBackForwardList.cpp */, 953 959 BC72BA1C11E64907001EB4EA /* WebBackForwardList.h */, … … 1390 1396 1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */, 1391 1397 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */, 1398 1A0F29E4120B44420053D1B9 /* VisitedLinkProvider.h in Headers */, 1392 1399 ); 1393 1400 runOnlyForDeploymentPostprocessing = 0; … … 1599 1606 1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */, 1600 1607 1A0F29CB120B37160053D1B9 /* VisitedLinkTable.cpp in Sources */, 1608 1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */, 1601 1609 ); 1602 1610 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/WebProcess.cpp
r64594 r64775 178 178 if (messageID.is<CoreIPC::MessageClassWebProcess>()) { 179 179 switch (messageID.get<WebProcessMessage::Kind>()) { 180 case WebProcessMessage::SetVisitedLinkTable: 181 case WebProcessMessage::VisitedLinkStateChanged: 182 case WebProcessMessage::AllVisitedLinkStateChanged: 183 // FIXME: Implement. 184 return; 185 180 186 case WebProcessMessage::AddVisitedLink: { 181 187 WebCore::LinkHash hash; -
trunk/WebKit2/win/WebKit2.vcproj
r64768 r64775 954 954 </File> 955 955 <File 956 RelativePath="..\UIProcess\VisitedLinkProvider.cpp" 957 > 958 </File> 959 <File 960 RelativePath="..\UIProcess\VisitedLinkProvider.h" 961 > 962 </File> 963 <File 956 964 RelativePath="..\UIProcess\WebBackForwardList.cpp" 957 965 >
Note: See TracChangeset
for help on using the changeset viewer.