Title: [96490] trunk/Source/WebKit/chromium
Revision
96490
Author
[email protected]
Date
2011-10-03 04:58:07 -0700 (Mon, 03 Oct 2011)

Log Message

Unreviewed, rolling out r96481.
http://trac.webkit.org/changeset/96481
https://bugs.webkit.org/show_bug.cgi?id=69251

Breaks webkit_unit_tests on Linux(dbg) (Requested by hwennborg
on #webkit).

Patch by Sheriff Bot <[email protected]> on 2011-10-03

* WebKit.gypi:
* public/WebCompositor.h:
* public/WebWidgetClient.h:
* src/WebCompositorImpl.cpp:
(WebKit::WebCompositorImpl::WebCompositorImpl):
(WebKit::WebCompositorImpl::~WebCompositorImpl):
(WebKit::WebCompositorImpl::setClient):
(WebKit::WebCompositorImpl::handleInputEvent):
* src/WebCompositorImpl.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:
* tests/CCLayerTreeHostTest.cpp:
(WTF::MockLayerTreeHost::MockLayerTreeHost):
* tests/WebCompositorImplTest.cpp: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (96489 => 96490)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-10-03 11:58:07 UTC (rev 96490)
@@ -1,3 +1,28 @@
+2011-10-03  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r96481.
+        http://trac.webkit.org/changeset/96481
+        https://bugs.webkit.org/show_bug.cgi?id=69251
+
+        Breaks webkit_unit_tests on Linux(dbg) (Requested by hwennborg
+        on #webkit).
+
+        * WebKit.gypi:
+        * public/WebCompositor.h:
+        * public/WebWidgetClient.h:
+        * src/WebCompositorImpl.cpp:
+        (WebKit::WebCompositorImpl::WebCompositorImpl):
+        (WebKit::WebCompositorImpl::~WebCompositorImpl):
+        (WebKit::WebCompositorImpl::setClient):
+        (WebKit::WebCompositorImpl::handleInputEvent):
+        * src/WebCompositorImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        * src/WebViewImpl.h:
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::MockLayerTreeHost::MockLayerTreeHost):
+        * tests/WebCompositorImplTest.cpp: Removed.
+
 2011-10-02  James Robinson  <[email protected]>
 
         [chromium] Add WebWidget API for accessing the current WebCompositor

Modified: trunk/Source/WebKit/chromium/WebKit.gypi (96489 => 96490)


--- trunk/Source/WebKit/chromium/WebKit.gypi	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/WebKit.gypi	2011-10-03 11:58:07 UTC (rev 96490)
@@ -76,7 +76,6 @@
             'tests/TreeSynchronizerTest.cpp',
             'tests/TreeTestHelpers.cpp',
             'tests/TreeTestHelpers.h',
-            'tests/WebCompositorImplTest.cpp',
             'tests/WebFrameTest.cpp',
             'tests/WebURLRequestTest.cpp',
         ],

Modified: trunk/Source/WebKit/chromium/public/WebCompositor.h (96489 => 96490)


--- trunk/Source/WebKit/chromium/public/WebCompositor.h	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/public/WebCompositor.h	2011-10-03 11:58:07 UTC (rev 96490)
@@ -40,7 +40,6 @@
 public:
     // This must be called once with a non-null WebThread before any compositors attempt to initialize.
     WEBKIT_EXPORT static void setThread(WebThread*);
-    WEBKIT_EXPORT static WebCompositor* fromIdentifier(int);
 
     virtual void setClient(WebCompositorClient*) = 0;
     virtual void handleInputEvent(const WebInputEvent&) = 0;

Modified: trunk/Source/WebKit/chromium/public/WebWidgetClient.h (96489 => 96490)


--- trunk/Source/WebKit/chromium/public/WebWidgetClient.h	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/public/WebWidgetClient.h	2011-10-03 11:58:07 UTC (rev 96490)
@@ -52,15 +52,8 @@
     virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) { }
 
     // Called when the compositor enables or disables.
-    // FIXME: Remove when all implementations switch over to didEnable.../didDisable...
     virtual void didActivateAcceleratedCompositing(bool active) { }
 
-    // Called when the compositor is enabled or disabled.
-    // The WebCompositor identifier can be used on the compositor thread to get access
-    // to the WebCompositor instance associated with this WebWidget.
-    virtual void didActivateCompositor(int compositorIdentifier) { }
-    virtual void didDeactivateCompositor() { }
-
     // Called when a call to WebWidget::composite is required
     virtual void scheduleComposite() { }
 

Modified: trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp (96489 => 96490)


--- trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp	2011-10-03 11:58:07 UTC (rev 96490)
@@ -31,7 +31,6 @@
 #include "WebCompositorClient.h"
 #include "WebInputEvent.h"
 #include "cc/CCThreadProxy.h"
-#include <wtf/ThreadingPrimitives.h>
 
 using namespace WebCore;
 
@@ -43,72 +42,23 @@
     CCThreadProxy::setThread(CCThreadImpl::create(compositorThread).leakPtr());
 }
 
-int WebCompositorImpl::s_nextAvailableIdentifier = 1;
-
-// These data structures are always allocated from the main thread, but may
-// be accessed and mutated on the main or compositor thread.
-// s_compositors is deleted when it has no elements. s_compositorsLock is never
-// deleted.
-HashSet<WebCompositorImpl*>* WebCompositorImpl::s_compositors = 0;
-Mutex* WebCompositorImpl::s_compositorsLock = 0;
-
-WebCompositor* WebCompositor::fromIdentifier(int identifier)
-{
-    return WebCompositorImpl::fromIdentifier(identifier);
-}
-
-WebCompositor* WebCompositorImpl::fromIdentifier(int identifier)
-{
-    ASSERT(CCProxy::isImplThread());
-    if (!s_compositorsLock)
-        return 0;
-
-    MutexLocker lock(*s_compositorsLock);
-    if (!s_compositors)
-        return 0;
-
-    for (HashSet<WebCompositorImpl*>::iterator it = s_compositors->begin(); it != s_compositors->end(); ++it) {
-        if ((*it)->identifier() == identifier)
-            return *it;
-    }
-    return 0;
-}
-
 WebCompositorImpl::WebCompositorImpl()
     : m_client(0)
-    , m_identifier(s_nextAvailableIdentifier++)
 {
-    ASSERT(CCProxy::isMainThread());
-    if (!s_compositorsLock)
-        s_compositorsLock = new Mutex;
-    MutexLocker lock(*s_compositorsLock);
-    if (!s_compositors)
-        s_compositors = new HashSet<WebCompositorImpl*>;
-    s_compositors->add(this);
 }
 
 WebCompositorImpl::~WebCompositorImpl()
 {
-    ASSERT(s_compositorsLock);
-    MutexLocker lock(*s_compositorsLock);
-    ASSERT(s_compositors);
-    s_compositors->remove(this);
-    if (!s_compositors->size()) {
-        delete s_compositors;
-        s_compositors = 0;
-    }
 }
 
 void WebCompositorImpl::setClient(WebCompositorClient* client)
 {
-    ASSERT(CCProxy::isImplThread());
     ASSERT(client);
     m_client = client;
 }
 
 void WebCompositorImpl::handleInputEvent(const WebInputEvent& event)
 {
-    ASSERT(CCProxy::isImplThread());
     // FIXME: Do something interesting with the event here.
     m_client->didHandleInputEvent(false);
 }

Modified: trunk/Source/WebKit/chromium/src/WebCompositorImpl.h (96489 => 96490)


--- trunk/Source/WebKit/chromium/src/WebCompositorImpl.h	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/src/WebCompositorImpl.h	2011-10-03 11:58:07 UTC (rev 96490)
@@ -27,15 +27,9 @@
 #define WebCompositorImpl_h
 
 #include "WebCompositor.h"
-
-#include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/PassOwnPtr.h>
 
-namespace WTF {
-class Mutex;
-}
-
 namespace WebKit {
 
 class WebCompositorClient;
@@ -43,8 +37,6 @@
 class WebCompositorImpl : public WebCompositor {
     WTF_MAKE_NONCOPYABLE(WebCompositorImpl);
 public:
-    static WebCompositor* fromIdentifier(int identifier);
-
     static PassOwnPtr<WebCompositorImpl> create()
     {
         return adoptPtr(new WebCompositorImpl);
@@ -55,18 +47,10 @@
     virtual void setClient(WebCompositorClient*);
     virtual void handleInputEvent(const WebInputEvent&);
 
-    int identifier() const { return m_identifier; }
-
 private:
     WebCompositorImpl();
 
     WebCompositorClient* m_client;
-    int m_identifier;
-
-    static HashSet<WebCompositorImpl*>* s_compositors;
-    static Mutex* s_compositorsLock;
-
-    static int s_nextAvailableIdentifier;
 };
 
 }

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (96489 => 96490)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-10-03 11:58:07 UTC (rev 96490)
@@ -103,7 +103,6 @@
 #include "Vector.h"
 #include "WebAccessibilityObject.h"
 #include "WebAutofillClient.h"
-#include "WebCompositorImpl.h"
 #include "WebDevToolsAgentImpl.h"
 #include "WebDevToolsAgentPrivate.h"
 #include "WebDragData.h"
@@ -2646,13 +2645,11 @@
         if (m_layerTreeHost)
             m_layerTreeHost->finishAllRendering();
         m_client->didActivateAcceleratedCompositing(false);
-        m_client->didDeactivateCompositor();
     } else if (m_layerTreeHost) {
         m_isAcceleratedCompositingActive = true;
         updateLayerTreeViewport();
 
         m_client->didActivateAcceleratedCompositing(true);
-        m_client->didActivateCompositor(m_webCompositorImpl->identifier());
     } else {
         TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0);
 
@@ -2670,11 +2667,8 @@
         m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this));
         m_layerTreeHost = CCLayerTreeHost::create(this, m_nonCompositedContentHost->topLevelRootLayer()->platformLayer(), ccSettings);
         if (m_layerTreeHost) {
-            m_webCompositorImpl = WebCompositorImpl::create();
-            // FIXME: Hook the m_webCompositorImpl up with the CCLayerTreeHost somehow.
             updateLayerTreeViewport();
             m_client->didActivateAcceleratedCompositing(true);
-            m_client->didActivateCompositor(m_webCompositorImpl->identifier());
             m_isAcceleratedCompositingActive = true;
             m_compositorCreationFailed = false;
             if (m_pageOverlay)
@@ -2682,7 +2676,6 @@
         } else {
             m_isAcceleratedCompositingActive = false;
             m_client->didActivateAcceleratedCompositing(false);
-            m_client->didDeactivateCompositor();
             m_compositorCreationFailed = true;
         }
     }

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (96489 => 96490)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-10-03 11:58:07 UTC (rev 96490)
@@ -82,7 +82,6 @@
 class GeolocationClientProxy;
 class SpeechInputClientImpl;
 class WebAccessibilityObject;
-class WebCompositorImpl;
 class WebDevToolsAgentClient;
 class WebDevToolsAgentPrivate;
 class WebFrameImpl;
@@ -576,7 +575,6 @@
     WebCore::IntRect m_rootLayerScrollDamage;
     OwnPtr<WebCore::NonCompositedContentHost> m_nonCompositedContentHost;
     RefPtr<WebCore::CCLayerTreeHost> m_layerTreeHost;
-    OwnPtr<WebCompositorImpl> m_webCompositorImpl;
     WebCore::GraphicsLayer* m_rootGraphicsLayer;
     bool m_isAcceleratedCompositingActive;
     bool m_compositorCreationFailed;

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (96489 => 96490)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-10-03 11:58:07 UTC (rev 96490)
@@ -117,7 +117,6 @@
     {
         bool success = initialize();
         ASSERT(success);
-        UNUSED_PARAM(success);
     }
 
     TestHooks* m_testHooks;

Deleted: trunk/Source/WebKit/chromium/tests/WebCompositorImplTest.cpp (96489 => 96490)


--- trunk/Source/WebKit/chromium/tests/WebCompositorImplTest.cpp	2011-10-03 11:37:54 UTC (rev 96489)
+++ trunk/Source/WebKit/chromium/tests/WebCompositorImplTest.cpp	2011-10-03 11:58:07 UTC (rev 96490)
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "WebCompositorImpl.h"
-
-#include "cc/CCProxy.h"
-
-#include <gtest/gtest.h>
-#include <wtf/OwnPtr.h>
-
-using WebKit::WebCompositor;
-using WebKit::WebCompositorImpl;
-
-namespace {
-
-TEST(WebCompositorImpl, fromIdentifier)
-{
-#ifndef NDEBUG
-    // WebCompositor APIs can only be called from the compositor thread.
-    WebCore::CCProxy::setImplThread(true);
-#endif
-
-    // Before creating any WebCompositors, lookups for any value should fail and not crash.
-    EXPECT_EQ(0, WebCompositor::fromIdentifier(2));
-    EXPECT_EQ(0, WebCompositor::fromIdentifier(0));
-    EXPECT_EQ(0, WebCompositor::fromIdentifier(-1));
-
-    int compositorIdentifier = -1;
-    {
-#ifndef NDEBUG
-        WebCore::CCProxy::setImplThread(false);
-#endif
-        OwnPtr<WebCompositorImpl> comp = WebCompositorImpl::create();
-#ifndef NDEBUG
-        WebCore::CCProxy::setImplThread(true);
-#endif
-        compositorIdentifier = comp->identifier();
-        // The compositor we just created should be locatable.
-        EXPECT_EQ(comp.get(), WebCompositor::fromIdentifier(compositorIdentifier));
-
-        // But nothing else.
-        EXPECT_EQ(0, WebCompositor::fromIdentifier(comp->identifier() + 10));
-    }
-
-    // After the compositor is destroyed, its entry should be removed from the map.
-    EXPECT_EQ(0, WebCompositor::fromIdentifier(compositorIdentifier));
-}
-
-}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to