[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 15:19:21 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4555bb29d85e328f84c122053ef5f8c3ca167558
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 31 20:20:42 2010 +0000

    2010-10-31  Darin Adler  <darin at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Visited links not populated correctly in new web processes after the first
            https://bugs.webkit.org/show_bug.cgi?id=48735
            rdar://problem/8442177
    
            * UIProcess/VisitedLinkProvider.cpp:
            (WebKit::VisitedLinkProvider::VisitedLinkProvider): Initialize
            m_webProcessHasVisitedLinkState.
            (WebKit::VisitedLinkProvider::processDidFinishLaunching): Renamed
            from populateVisitedLinksIfNeeded. Set m_webProcessHasVisitedLinkState
            to false, since this is a new process, and also start the timer
            so the visited links messages will be sent.
            (WebKit::VisitedLinkProvider::processDidClose): Renamed from
            stopVisitedLinksTimer.
            (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
            Added logic so we send SetVisitedLinkTable and
            AllVisitedLinkStateChanged once to each new process and to set
            m_webProcessHasVisitedLinkState to true once that is done.
    
            * UIProcess/VisitedLinkProvider.h: Updated for above changes.
    
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::processDidFinishLaunching): Called
            VisitedLinkProvider function under its new name. Also used
            ASSERT_UNUSED rather than ASSERT since the argument is used
            only for the assertion.
            (WebKit::WebContext::processDidClose): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70997 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 757b499..20dbe49 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,34 @@
+2010-10-31  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Visited links not populated correctly in new web processes after the first
+        https://bugs.webkit.org/show_bug.cgi?id=48735
+        rdar://problem/8442177
+
+        * UIProcess/VisitedLinkProvider.cpp:
+        (WebKit::VisitedLinkProvider::VisitedLinkProvider): Initialize
+        m_webProcessHasVisitedLinkState.
+        (WebKit::VisitedLinkProvider::processDidFinishLaunching): Renamed
+        from populateVisitedLinksIfNeeded. Set m_webProcessHasVisitedLinkState
+        to false, since this is a new process, and also start the timer
+        so the visited links messages will be sent.
+        (WebKit::VisitedLinkProvider::processDidClose): Renamed from
+        stopVisitedLinksTimer.
+        (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
+        Added logic so we send SetVisitedLinkTable and
+        AllVisitedLinkStateChanged once to each new process and to set
+        m_webProcessHasVisitedLinkState to true once that is done.
+
+        * UIProcess/VisitedLinkProvider.h: Updated for above changes.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::processDidFinishLaunching): Called
+        VisitedLinkProvider function under its new name. Also used
+        ASSERT_UNUSED rather than ASSERT since the argument is used
+        only for the assertion.
+        (WebKit::WebContext::processDidClose): Ditto.
+
 2010-10-30  Andreas Kling  <kling at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/UIProcess/VisitedLinkProvider.cpp b/WebKit2/UIProcess/VisitedLinkProvider.cpp
index 4d1871d..6beafff 100644
--- a/WebKit2/UIProcess/VisitedLinkProvider.cpp
+++ b/WebKit2/UIProcess/VisitedLinkProvider.cpp
@@ -39,14 +39,20 @@ static const int VisitedLinkTableMaxLoad = 2;
 VisitedLinkProvider::VisitedLinkProvider(WebContext* context)
     : m_context(context)
     , m_visitedLinksPopulated(false)
+    , m_webProcessHasVisitedLinkState(false)
     , m_keyCount(0)
     , m_tableSize(0)
     , m_pendingVisitedLinksTimer(RunLoop::main(), this, &VisitedLinkProvider::pendingVisitedLinksTimerFired)
 {
 }
 
-void VisitedLinkProvider::populateVisitedLinksIfNeeded()
+void VisitedLinkProvider::processDidFinishLaunching()
 {
+    m_webProcessHasVisitedLinkState = false;
+
+    if (m_keyCount)
+        m_pendingVisitedLinksTimer.startOneShot(0);
+
     if (m_visitedLinksPopulated)
         return;
 
@@ -63,7 +69,7 @@ void VisitedLinkProvider::addVisitedLink(LinkHash linkHash)
         m_pendingVisitedLinksTimer.startOneShot(0);
 }
 
-void VisitedLinkProvider::stopVisitedLinksTimer()
+void VisitedLinkProvider::processDidClose()
 {
     m_pendingVisitedLinksTimer.stop();
 }
@@ -149,7 +155,7 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()
 
     m_keyCount += pendingVisitedLinks.size();
 
-    if (currentTableSize != newTableSize) {
+    if (!m_webProcessHasVisitedLinkState || currentTableSize != newTableSize) {
         // Send the new visited link table.
         
         SharedMemory::Handle handle;
@@ -160,13 +166,14 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()
     }
     
     // We now need to let the web process know that we've added links.
-    if (addedVisitedLinks.size() <= 20) {
+    if (m_webProcessHasVisitedLinkState && addedVisitedLinks.size() <= 20) {
         m_context->process()->send(Messages::WebProcess::VisitedLinkStateChanged(addedVisitedLinks), 0);
         return;
     }
     
     // Just recalculate all the visited links.
     m_context->process()->send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
+    m_webProcessHasVisitedLinkState = true;
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/VisitedLinkProvider.h b/WebKit2/UIProcess/VisitedLinkProvider.h
index b8d53f1..015515c 100644
--- a/WebKit2/UIProcess/VisitedLinkProvider.h
+++ b/WebKit2/UIProcess/VisitedLinkProvider.h
@@ -41,16 +41,17 @@ class VisitedLinkProvider : Noncopyable {
 public:
     explicit VisitedLinkProvider(WebContext*);
 
-    void populateVisitedLinksIfNeeded();
     void addVisitedLink(WebCore::LinkHash);
 
-    void stopVisitedLinksTimer();
+    void processDidFinishLaunching();
+    void processDidClose();
 
 private:
     void pendingVisitedLinksTimerFired();
 
     WebContext* m_context;
     bool m_visitedLinksPopulated;
+    bool m_webProcessHasVisitedLinkState;
 
     unsigned m_keyCount;
     unsigned m_tableSize;
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 7044c2f..5efc791 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -189,17 +189,17 @@ void WebContext::ensureWebProcess()
 void WebContext::processDidFinishLaunching(WebProcessProxy* process)
 {
     // FIXME: Once we support multiple processes per context, this assertion won't hold.
-    ASSERT(process == m_process);
+    ASSERT_UNUSED(process, process == m_process);
 
-    m_visitedLinkProvider.populateVisitedLinksIfNeeded();
+    m_visitedLinkProvider.processDidFinishLaunching();
 }
 
 void WebContext::processDidClose(WebProcessProxy* process)
 {
     // FIXME: Once we support multiple processes per context, this assertion won't hold.
-    ASSERT(process == m_process);
+    ASSERT_UNUSED(process, process == m_process);
 
-    m_visitedLinkProvider.stopVisitedLinksTimer();
+    m_visitedLinkProvider.processDidClose();
 
     m_process = 0;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list