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

andersca at apple.com andersca at apple.com
Wed Dec 22 18:47:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b5b89a5bbd01cd118d31f1f2198320dd80574940
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 18 01:07:25 2010 +0000

    2010-12-17  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Sam Weinig.
    
            Resizing a WKView while loading a page can leave the page at a size that doesn't match the window
            https://bugs.webkit.org/show_bug.cgi?id=51282
            <rdar://problem/8133142>
    
            Fix a race condition in waitForMessage. If we time out on the wait condition, we would keep the
            m_waitForMessageMutex mutex unlocked for a brief period of time before taking the lock again and
            then removing the messageID/destinationID pair from the hash map. Under some circumstances, the
            connection queue would update the hash map right before we removed it, leading to a lost message.
    
            * Platform/CoreIPC/Connection.cpp:
            (CoreIPC::Connection::waitForMessage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74303 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index eb4ae55..1ec2bd4 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,21 @@
 2010-12-17  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Sam Weinig.
+
+        Resizing a WKView while loading a page can leave the page at a size that doesn't match the window
+        https://bugs.webkit.org/show_bug.cgi?id=51282
+        <rdar://problem/8133142>
+
+        Fix a race condition in waitForMessage. If we time out on the wait condition, we would keep the
+        m_waitForMessageMutex mutex unlocked for a brief period of time before taking the lock again and
+        then removing the messageID/destinationID pair from the hash map. Under some circumstances, the
+        connection queue would update the hash map right before we removed it, leading to a lost message.
+        
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::waitForMessage):
+
+2010-12-17  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by Simon Fraser.
 
         Clean up ChunkedUpdateDrawingAreaProxy
diff --git a/WebKit2/Platform/CoreIPC/Connection.cpp b/WebKit2/Platform/CoreIPC/Connection.cpp
index f9a808c..f1f1b69 100644
--- a/WebKit2/Platform/CoreIPC/Connection.cpp
+++ b/WebKit2/Platform/CoreIPC/Connection.cpp
@@ -140,10 +140,8 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForMessage(MessageID messageID, uint
         m_waitForMessageMap.set(messageAndDestination, 0);
     }
     
-    bool timedOut = false;
-    
     // Now wait for it to be set.
-    while (!timedOut) {
+    while (true) {
         MutexLocker locker(m_waitForMessageMutex);
 
         HashMap<std::pair<unsigned, uint64_t>, ArgumentDecoder*>::iterator it = m_waitForMessageMap.find(messageAndDestination);
@@ -154,14 +152,13 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForMessage(MessageID messageID, uint
             return arguments.release();
         }
         
-        // We didn't find it, keep waiting.
-        timedOut = !m_waitForMessageCondition.timedWait(m_waitForMessageMutex, absoluteTime);
-    }
+        // Now we wait.
+        if (!m_waitForMessageCondition.timedWait(m_waitForMessageMutex, absoluteTime)) {
+            // We timed out, now remove the pending wait.
+            m_waitForMessageMap.remove(messageAndDestination);
 
-    // We timed out, now remove the pending wait.
-    {
-        MutexLocker locker(m_waitForMessageMutex);
-        m_waitForMessageMap.remove(messageAndDestination);
+            break;
+        }
     }
     
     return PassOwnPtr<ArgumentDecoder>();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list