Changeset 64797 in webkit
- Timestamp:
- Aug 5, 2010, 5:00:45 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64793 r64797 1 2010-08-05 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Use the visited link provider for visited links 6 https://bugs.webkit.org/show_bug.cgi?id=43583 7 8 Export Page::visitedStateChanged and Page::allvisitedStateChanged. 9 10 * WebCore.exp.in: 11 1 12 2010-08-05 Eric Seidel <eric@webkit.org> 2 13 -
trunk/WebCore/WebCore.exp.in
r64518 r64797 559 559 __ZN7WebCore4Page17willMoveOffscreenEv 560 560 __ZN7WebCore4Page18removeSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE 561 __ZN7WebCore4Page19visitedStateChangedEPNS_9PageGroupEy 562 __ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE 561 563 __ZN7WebCore4Page23clearUndoRedoOperationsEv 562 564 __ZN7WebCore4Page27setJavaScriptURLsAreAllowedEb -
trunk/WebKit2/ChangeLog
r64795 r64797 1 2010-08-05 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Use the visited link provider for visited links 6 https://bugs.webkit.org/show_bug.cgi?id=43583 7 8 * Shared/CoreIPCSupport/WebProcessMessageKinds.h: 9 (WebProcessMessage::): 10 Remove AddVisitedLink. 11 12 * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h: 13 (WebProcessProxyMessage::): 14 Remove PopulateVisitedLinks and add AddVisitedLink. 15 16 * UIProcess/WebContext.cpp: 17 (WebKit::WebContext::sharedProcessContext): 18 Initialize the main run loop before creating the context. 19 20 (WebKit::WebContext::sharedThreadContext): 21 Ditto. 22 23 (WebKit::WebContext::create): 24 Ditto. 25 26 (WebKit::WebContext::WebContext): 27 Initialize the visited link provider. 28 29 (WebKit::WebContext::processDidFinishLaunching): 30 Ask the visited link provider to populate visited links. 31 32 (WebKit::WebContext::addVisitedLink): 33 Ask the visited link provider to add the visited link. 34 35 * UIProcess/WebProcessProxy.cpp: 36 (WebKit::WebProcessProxy::addVisitedLink): 37 Call WebContext::addVisitedLink. 38 39 (WebKit::WebProcessProxy::didReceiveMessage): 40 Handle AddVisitedLink. 41 42 (WebKit::WebProcessProxy::didFinishLaunching): 43 Call WebContext::processdidFinishLaunching. 44 45 * UIProcess/WebProcessProxy.h: 46 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 47 (WebKit::WebChromeClient::populateVisitedLinks): 48 Don't send the WebProcessProxyMessage::PopulateVisitedLinks message. 49 50 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: 51 (WebKit::WebPlatformStrategies::isLinkVisited): 52 Call WebProcess::isLinkVisited. 53 54 (WebKit::WebPlatformStrategies::addVisitedLink): 55 Call WebProcess::addVisitedLink. 56 57 * WebProcess/WebProcess.cpp: 58 (WebKit::WebProcess::setVisitedLinkTable): 59 Create a shared memory object and tell the visited link table about it. 60 61 (WebKit::WebProcess::visitedLinkStateChanged): 62 Go through the link hashes and call Page::visitedStateChanged. 63 64 (WebKit::WebProcess::allVisitedLinkStateChanged): 65 Call Page::allVisitedStateChanged. 66 67 (WebKit::WebProcess::isLinkVisited): 68 Call VisitedLinkTable::isLinkVisited. 69 70 (WebKit::WebProcess::addVisitedLink): 71 Inform the UI process about the added link. 72 73 (WebKit::WebProcess::didReceiveMessage): 74 Handle new messages. 75 1 76 2010-08-05 Steve Falkenburg <sfalken@apple.com> 2 77 -
trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
r64775 r64797 38 38 AllVisitedLinkStateChanged, 39 39 40 // FIXME: Remove AddVisitedLink.41 AddVisitedLink,42 40 LoadInjectedBundle, 43 41 SetApplicationCacheDirectory, -
trunk/WebKit2/Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h
r64396 r64797 35 35 enum Kind { 36 36 AddBackForwardItem, 37 AddVisitedLink, 37 38 DidNavigateWithNavigationData, 38 39 DidPerformClientRedirect, … … 40 41 DidUpdateHistoryTitle, 41 42 GetPluginHostConnection, 42 GetPlugins, 43 PopulateVisitedLinks, 43 GetPlugins 44 44 }; 45 45 -
trunk/WebKit2/UIProcess/WebContext.cpp
r64492 r64797 175 175 WebContext* WebContext::sharedProcessContext() 176 176 { 177 RunLoop::initializeMainRunLoop(); 177 178 static WebContext* context = adoptRef(new WebContext(ProcessModelSharedSecondaryProcess, String())).leakRef(); 178 179 return context; … … 181 182 WebContext* WebContext::sharedThreadContext() 182 183 { 184 RunLoop::initializeMainRunLoop(); 183 185 static WebContext* context = adoptRef(new WebContext(ProcessModelSharedSecondaryThread, String())).leakRef(); 184 186 return context; 185 187 } 186 188 189 PassRefPtr<WebContext> WebContext::create(const String& injectedBundlePath) 190 { 191 RunLoop::initializeMainRunLoop(); 192 return adoptRef(new WebContext(ProcessModelSecondaryProcess, injectedBundlePath)); 193 } 194 187 195 WebContext::WebContext(ProcessModel processModel, const WebCore::String& injectedBundlePath) 188 196 : m_processModel(processModel) 189 197 , m_injectedBundlePath(injectedBundlePath) 198 , m_visitedLinkProvider(this) 190 199 { 191 200 RunLoop::initializeMainRunLoop(); … … 237 246 } 238 247 248 void WebContext::processDidFinishLaunching(WebProcessProxy* process) 249 { 250 // FIXME: Once we support multiple processes per context, this assertion won't hold. 251 ASSERT(process == m_process); 252 253 m_visitedLinkProvider.populateVisitedLinksIfNeeded(); 254 } 255 239 256 WebPageProxy* WebContext::createWebPage(WebPageNamespace* pageNamespace) 240 257 { … … 372 389 return; 373 390 374 WebCore::LinkHash hash = visitedLinkHash(visitedURL.characters(), visitedURL.length()); 375 m_process->send(WebProcessMessage::AddVisitedLink, 0, CoreIPC::In(hash)); 376 } 377 391 LinkHash linkHash = visitedLinkHash(visitedURL.characters(), visitedURL.length()); 392 addVisitedLink(linkHash); 393 } 394 395 void WebContext::addVisitedLink(LinkHash linkHash) 396 { 397 m_visitedLinkProvider.addVisitedLink(linkHash); 398 } 399 378 400 void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments) 379 401 { -
trunk/WebKit2/UIProcess/WebContext.h
r64492 r64797 30 30 #include "PluginInfoStore.h" 31 31 #include "ProcessModel.h" 32 #include "VisitedLinkProvider.h" 32 33 #include "WebContextInjectedBundleClient.h" 33 34 #include "WebHistoryClient.h" 34 35 #include "WebProcessProxy.h" 36 #include <WebCore/LinkHash.h> 35 37 #include <WebCore/PlatformString.h> 36 38 #include <WebCore/StringHash.h> … … 55 57 static WebContext* sharedThreadContext(); 56 58 57 static PassRefPtr<WebContext> create(const WebCore::String& injectedBundlePath) 58 { 59 return adoptRef(new WebContext(ProcessModelSecondaryProcess, injectedBundlePath)); 60 } 59 static PassRefPtr<WebContext> create(const WebCore::String& injectedBundlePath); 61 60 62 61 ~WebContext(); … … 67 66 ProcessModel processModel() const { return m_processModel; } 68 67 WebProcessProxy* process() const { return m_process.get(); } 68 69 void processDidFinishLaunching(WebProcessProxy*); 69 70 70 71 WebPageProxy* createWebPage(WebPageNamespace*); … … 102 103 103 104 void addVisitedLink(const WebCore::String&); 105 void addVisitedLink(WebCore::LinkHash); 104 106 105 107 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder&); … … 127 129 128 130 PluginInfoStore m_pluginInfoStore; 129 131 VisitedLinkProvider m_visitedLinkProvider; 132 130 133 HashSet<WebCore::String> m_schemesToRegisterAsEmptyDocument; 131 134 }; -
trunk/WebKit2/UIProcess/WebProcessProxy.cpp
r64744 r64797 217 217 } 218 218 219 void WebProcessProxy::addVisitedLink(LinkHash linkHash) 220 { 221 m_context->addVisitedLink(linkHash); 222 } 223 219 224 void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) 220 225 { … … 232 237 } 233 238 239 case WebProcessProxyMessage::AddVisitedLink: { 240 LinkHash linkHash; 241 242 if (!arguments->decode(CoreIPC::Out(linkHash))) 243 return; 244 245 addVisitedLink(linkHash); 246 return; 247 } 248 234 249 case WebProcessProxyMessage::DidNavigateWithNavigationData: { 235 250 uint64_t pageID; … … 291 306 break; 292 307 } 293 case WebProcessProxyMessage::PopulateVisitedLinks: {294 m_context->populateVisitedLinks();295 break;296 }297 308 298 309 // These are synchronous messages and should never be handled here. … … 355 366 case WebProcessProxyMessage::DidPerformServerRedirect: 356 367 case WebProcessProxyMessage::DidUpdateHistoryTitle: 357 case WebProcessProxyMessage::PopulateVisitedLinks:358 368 case WebProcessProxyMessage::AddBackForwardItem: 369 case WebProcessProxyMessage::AddVisitedLink: 359 370 ASSERT_NOT_REACHED(); 360 371 break; … … 416 427 } 417 428 418 m_pendingMessages.clear(); 429 m_pendingMessages.clear(); 430 431 // Tell the context that we finished launching. 432 m_context->processDidFinishLaunching(this); 419 433 } 420 434 -
trunk/WebKit2/UIProcess/WebProcessProxy.h
r64396 r64797 34 34 #include "ResponsivenessTimer.h" 35 35 #include "WebPageProxy.h" 36 #include <WebCore/LinkHash.h> 36 37 #include <wtf/HashMap.h> 37 38 #include <wtf/PassRefPtr.h> … … 101 102 102 103 void addOrUpdateBackForwardListItem(uint64_t itemID, const WebCore::String& originalURLString, const WebCore::String& urlString, const WebCore::String& title); 104 void addVisitedLink(WebCore::LinkHash); 103 105 104 106 // CoreIPC::Connection::Client -
trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r64594 r64797 411 411 void WebChromeClient::populateVisitedLinks() 412 412 { 413 WebProcess::shared().connection()->send(WebProcessProxyMessage::PopulateVisitedLinks, 0, CoreIPC::In());414 413 } 415 414 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
r64563 r64797 813 813 814 814 // VisitedLinkStrategy 815 bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) 816 { 817 // FIXME: Have WebKit2 manage its own visited links 818 return page->group().isLinkVisited(hash); 819 } 820 821 void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash) 822 { 823 // FIXME: Have WebKit2 manage its own visited links 824 return page->group().addVisitedLinkHash(hash); 815 bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash linkHash) 816 { 817 return WebProcess::shared().isLinkVisited(linkHash); 818 } 819 820 void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash linkHash) 821 { 822 WebProcess::shared().addVisitedLink(linkHash); 825 823 } 826 824 -
trunk/WebKit2/WebProcess/WebProcess.cpp
r64775 r64797 34 34 #include "WebPlatformStrategies.h" 35 35 #include "WebPreferencesStore.h" 36 #include "WebProcessProxyMessageKinds.h" 36 37 #include "WebProcessMessageKinds.h" 37 38 #include <WebCore/ApplicationCacheStorage.h> 39 #include <WebCore/Page.h> 38 40 #include <WebCore/PageGroup.h> 39 41 #include <WebCore/SchemeRegistry.h> … … 111 113 } 112 114 113 void WebProcess::addVisitedLinkHash(WebCore::LinkHash hash) 114 { 115 PageGroup* group = PageGroup::pageGroup("WebKit2Group"); 116 ASSERT(group); 117 if (!group) { 118 printf("Cannot find PageGroup named 'WebKit2Group'\n"); 119 return; 120 } 121 group->addVisitedLinkHash(hash); 115 void WebProcess::setVisitedLinkTable(const SharedMemory::Handle& handle) 116 { 117 RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle, SharedMemory::ReadOnly); 118 if (!sharedMemory) 119 return; 120 121 m_visitedLinkTable.setSharedMemory(sharedMemory.release()); 122 } 123 124 static PageGroup* webKit2PageGroup() 125 { 126 return PageGroup::pageGroup("WebKit2Group"); 127 } 128 129 void WebProcess::visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes) 130 { 131 for (size_t i = 0; i < linkHashes.size(); ++i) 132 Page::visitedStateChanged(webKit2PageGroup(), linkHashes[i]); 133 } 134 135 void WebProcess::allVisitedLinkStateChanged() 136 { 137 Page::allVisitedStateChanged(webKit2PageGroup()); 138 } 139 140 bool WebProcess::isLinkVisited(LinkHash linkHash) const 141 { 142 return m_visitedLinkTable.isLinkVisited(linkHash); 143 } 144 145 void WebProcess::addVisitedLink(WebCore::LinkHash linkHash) 146 { 147 if (isLinkVisited(linkHash)) 148 return; 149 150 m_connection->send(WebProcessProxyMessage::AddVisitedLink, 0, CoreIPC::In(linkHash)); 122 151 } 123 152 … … 178 207 if (messageID.is<CoreIPC::MessageClassWebProcess>()) { 179 208 switch (messageID.get<WebProcessMessage::Kind>()) { 180 case WebProcessMessage::SetVisitedLinkTable: 181 case WebProcessMessage::VisitedLinkStateChanged: 209 case WebProcessMessage::SetVisitedLinkTable: { 210 SharedMemory::Handle handle; 211 if (!arguments->decode(CoreIPC::Out(handle))) 212 return; 213 214 setVisitedLinkTable(handle); 215 return; 216 } 217 case WebProcessMessage::VisitedLinkStateChanged: { 218 Vector<LinkHash> linkHashes; 219 if (!arguments->decode(CoreIPC::Out(linkHashes))) 220 return; 221 visitedLinkStateChanged(linkHashes); 222 } 182 223 case WebProcessMessage::AllVisitedLinkStateChanged: 183 // FIXME: Implement.224 allVisitedLinkStateChanged(); 184 225 return; 185 226 186 case WebProcessMessage::AddVisitedLink: {187 WebCore::LinkHash hash;188 if (!arguments->decode(CoreIPC::Out(hash)))189 return;190 191 addVisitedLinkHash(hash);192 return;193 }194 227 case WebProcessMessage::LoadInjectedBundle: { 195 228 String path; -
trunk/WebKit2/WebProcess/WebProcess.h
r64594 r64797 29 29 #include "Connection.h" 30 30 #include "DrawingArea.h" 31 #include "SharedMemory.h" 32 #include "VisitedLinkTable.h" 31 33 #include <WebCore/LinkHash.h> 32 34 #include <wtf/HashMap.h> … … 64 66 #endif 65 67 68 void addVisitedLink(WebCore::LinkHash); 69 bool isLinkVisited(WebCore::LinkHash) const; 70 66 71 private: 67 72 WebProcess(); … … 75 80 void setApplicationCacheDirectory(const WebCore::String&); 76 81 void registerURLSchemeAsEmptyDocument(const WebCore::String&); 77 void addVisitedLinkHash(WebCore::LinkHash);78 82 83 void setVisitedLinkTable(const SharedMemory::Handle&); 84 void visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes); 85 void allVisitedLinkStateChanged(); 86 79 87 // CoreIPC::Connection::Client 80 88 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); … … 90 98 RunLoop* m_runLoop; 91 99 100 // FIXME: The visited link table should not be per process. 101 VisitedLinkTable m_visitedLinkTable; 102 92 103 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC) 93 104 mach_port_t m_compositingRenderServerPort;
Note:
See TracChangeset
for help on using the changeset viewer.