[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

aroben at apple.com aroben at apple.com
Sun Feb 20 23:57:45 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 5f54494674906a8f4bd2e0243cf3497ab3f347e0
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 27 06:40:54 2011 +0000

    Add assertions that CACFLayerTreeHost gains and loses an HWND only once
    
    CACFLayerTreeHost doesn't support any other use pattern.
    
    Reviewed by Sam Weinig.
    
    * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
    (WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Initialize new member.
    (WebCore::CACFLayerTreeHost::setWindow): Assert that we transition from not having a window,
    to having a window, to not having a window just once over the lifetime of this object.
    
    * platform/graphics/ca/win/CACFLayerTreeHost.h: Added m_state.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76763 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5f96fb9..26b2217 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,5 +1,20 @@
 2011-01-26  Adam Roben  <aroben at apple.com>
 
+        Add assertions that CACFLayerTreeHost gains and loses an HWND only once
+
+        CACFLayerTreeHost doesn't support any other use pattern.
+
+        Reviewed by Sam Weinig.
+
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Initialize new member.
+        (WebCore::CACFLayerTreeHost::setWindow): Assert that we transition from not having a window,
+        to having a window, to not having a window just once over the lifetime of this object.
+
+        * platform/graphics/ca/win/CACFLayerTreeHost.h: Added m_state.
+
+2011-01-26  Adam Roben  <aroben at apple.com>
+
         Notify layers that their animations have started when we flush the context, not when we
         render
 
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
index 09d8965..c27c1b6 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
@@ -190,6 +190,9 @@ CACFLayerTreeHost::CACFLayerTreeHost()
     , m_mustResetLostDeviceBeforeRendering(false)
     , m_shouldFlushPendingGraphicsLayerChanges(false)
     , m_isFlushingLayerChanges(false)
+#if !ASSERT_DISABLED
+    , m_state(WindowNotSet)
+#endif
 {
     // Point the CACFContext to this
     wkCACFContextSetUserData(m_context, this);
@@ -233,6 +236,24 @@ void CACFLayerTreeHost::setWindow(HWND window)
     if (window == m_window)
         return;
 
+#if !ASSERT_DISABLED
+    switch (m_state) {
+    case WindowNotSet:
+        ASSERT_ARG(window, window);
+        ASSERT(!m_window);
+        m_state = WindowSet;
+        break;
+    case WindowSet:
+        ASSERT_ARG(window, !window);
+        ASSERT(m_window);
+        m_state = WindowCleared;
+        break;
+    case WindowCleared:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+#endif
+
     if (m_window)
         destroyRenderer();
 
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
index 8e82bf5..61a6fcc 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
@@ -118,6 +118,9 @@ private:
 #ifndef NDEBUG
     bool m_printTree;
 #endif
+#if !ASSERT_DISABLED
+    enum { WindowNotSet, WindowSet, WindowCleared } m_state;
+#endif
 };
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list