Title: [98050] trunk/Source/WebCore
Revision
98050
Author
dpra...@chromium.org
Date
2011-10-20 17:33:26 -0700 (Thu, 20 Oct 2011)

Log Message

Still lots of crashes in the chromium debug bots.

Unreviewed, rolling out r97982.
http://trac.webkit.org/changeset/97982
https://bugs.webkit.org/show_bug.cgi?id=70328

crashing in asserts in chromium debug builds

* dom/DeviceMotionController.cpp:
(WebCore::DeviceMotionController::timerFired):
(WebCore::DeviceMotionController::addListener):
(WebCore::DeviceMotionController::removeListener):
(WebCore::DeviceMotionController::removeAllListeners):
* dom/DeviceMotionController.h:
* dom/DeviceOrientationController.cpp:
* dom/DeviceOrientationController.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* page/GeolocationController.cpp:
* page/GeolocationController.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98049 => 98050)


--- trunk/Source/WebCore/ChangeLog	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/ChangeLog	2011-10-21 00:33:26 UTC (rev 98050)
@@ -1,3 +1,27 @@
+2011-10-20  Dirk Pranke  <dpra...@chromium.org>
+
+        Still lots of crashes in the chromium debug bots.
+
+        Unreviewed, rolling out r97982.
+        http://trac.webkit.org/changeset/97982
+        https://bugs.webkit.org/show_bug.cgi?id=70328
+
+        crashing in asserts in chromium debug builds
+
+        * dom/DeviceMotionController.cpp:
+        (WebCore::DeviceMotionController::timerFired):
+        (WebCore::DeviceMotionController::addListener):
+        (WebCore::DeviceMotionController::removeListener):
+        (WebCore::DeviceMotionController::removeAllListeners):
+        * dom/DeviceMotionController.h:
+        * dom/DeviceOrientationController.cpp:
+        * dom/DeviceOrientationController.h:
+        * dom/Document.cpp:
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        * page/GeolocationController.cpp:
+        * page/GeolocationController.h:
+
 2011-10-20  Adam Barth  <aba...@webkit.org>
 
         Attempt to fix the GTK build.

Modified: trunk/Source/WebCore/dom/DeviceMotionController.cpp (98049 => 98050)


--- trunk/Source/WebCore/dom/DeviceMotionController.cpp	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/DeviceMotionController.cpp	2011-10-21 00:33:26 UTC (rev 98050)
@@ -48,10 +48,10 @@
 void DeviceMotionController::timerFired(Timer<DeviceMotionController>* timer)
 {
     ASSERT_UNUSED(timer, timer == &m_timer);
-    ASSERT(m_client->currentDeviceMotion());
+    ASSERT(!m_client || m_client->currentDeviceMotion());
     m_timer.stop();
     
-    RefPtr<DeviceMotionData> deviceMotionData = m_client->currentDeviceMotion();
+    RefPtr<DeviceMotionData> deviceMotionData = m_client ? m_client->currentDeviceMotion() : DeviceMotionData::create();
     RefPtr<DeviceMotionEvent> event = DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionData.get());
  
     Vector<RefPtr<DOMWindow> > listenersVector;
@@ -63,9 +63,9 @@
     
 void DeviceMotionController::addListener(DOMWindow* window)
 {
-    // If the client already has motion data,
+    // If no client is present or the client already has motion data,
     // immediately trigger an asynchronous response.
-    if (m_client->currentDeviceMotion()) {
+    if (!m_client || m_client->currentDeviceMotion()) {
         m_newListeners.add(window);
         if (!m_timer.isActive())
             m_timer.startOneShot(0);
@@ -73,7 +73,7 @@
     
     bool wasEmpty = m_listeners.isEmpty();
     m_listeners.add(window);
-    if (wasEmpty)
+    if (wasEmpty && m_client)
         m_client->startUpdating();
 }
 
@@ -81,7 +81,7 @@
 {
     m_listeners.remove(window);
     m_newListeners.remove(window);
-    if (m_listeners.isEmpty())
+    if (m_listeners.isEmpty() && m_client)
         m_client->stopUpdating();
 }
 
@@ -93,22 +93,10 @@
 
     m_listeners.removeAll(window);
     m_newListeners.remove(window);
-    if (m_listeners.isEmpty())
+    if (m_listeners.isEmpty() && m_client)
         m_client->stopUpdating();
 }
 
-void DeviceMotionController::suspend()
-{
-    if (!m_listeners.isEmpty())
-        m_client->stopUpdating();
-}
-
-void DeviceMotionController::resume()
-{
-    if (!m_listeners.isEmpty())
-        m_client->startUpdating();
-}
-
 void DeviceMotionController::didChangeDeviceMotion(DeviceMotionData* deviceMotionData)
 {
     RefPtr<DeviceMotionEvent> event = DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionData);

Modified: trunk/Source/WebCore/dom/DeviceMotionController.h (98049 => 98050)


--- trunk/Source/WebCore/dom/DeviceMotionController.h	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/DeviceMotionController.h	2011-10-21 00:33:26 UTC (rev 98050)
@@ -44,9 +44,6 @@
     void removeListener(DOMWindow*);
     void removeAllListeners(DOMWindow*);
 
-    void suspend();
-    void resume();
-
     void didChangeDeviceMotion(DeviceMotionData*);
 
     bool isActive() { return !m_listeners.isEmpty(); }

Modified: trunk/Source/WebCore/dom/DeviceOrientationController.cpp (98049 => 98050)


--- trunk/Source/WebCore/dom/DeviceOrientationController.cpp	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/DeviceOrientationController.cpp	2011-10-21 00:33:26 UTC (rev 98050)
@@ -99,18 +99,6 @@
         m_client->stopUpdating();
 }
 
-void DeviceOrientationController::suspend()
-{
-    if (!m_listeners.isEmpty())
-        m_client->stopUpdating();
-}
-
-void DeviceOrientationController::resume()
-{
-    if (!m_listeners.isEmpty())
-        m_client->startUpdating();
-}
-
 void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientation* orientation)
 {
     RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation);

Modified: trunk/Source/WebCore/dom/DeviceOrientationController.h (98049 => 98050)


--- trunk/Source/WebCore/dom/DeviceOrientationController.h	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/DeviceOrientationController.h	2011-10-21 00:33:26 UTC (rev 98050)
@@ -46,9 +46,6 @@
     void removeListener(DOMWindow*);
     void removeAllListeners(DOMWindow*);
 
-    void suspend();
-    void resume();
-
     void didChangeDeviceOrientation(DeviceOrientation*);
 
     bool isActive() { return !m_listeners.isEmpty(); }

Modified: trunk/Source/WebCore/dom/Document.cpp (98049 => 98050)


--- trunk/Source/WebCore/dom/Document.cpp	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-10-21 00:33:26 UTC (rev 98050)
@@ -47,10 +47,6 @@
 #include "DOMImplementation.h"
 #include "DOMWindow.h"
 #include "DateComponents.h"
-#include "DeviceMotionController.h"
-#include "DeviceMotionEvent.h"
-#include "DeviceOrientationController.h"
-#include "DeviceOrientationEvent.h"
 #include "DocumentFragment.h"
 #include "DocumentLoader.h"
 #include "DocumentMarkerController.h"
@@ -74,7 +70,6 @@
 #include "FrameSelection.h"
 #include "FrameTree.h"
 #include "FrameView.h"
-#include "GeolocationController.h"
 #include "HashChangeEvent.h"
 #include "HTMLAllCollection.h"
 #include "HTMLAnchorElement.h"
@@ -1840,66 +1835,6 @@
         node->removeAllEventListeners();
 }
 
-void Document::suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension why)
-{
-    ScriptExecutionContext::suspendActiveDOMObjects(why);
-
-    if (!page())
-        return;
-
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
-    if (page()->geolocationController() && usingGeolocation())
-        page()->geolocationController()->suspend();
-#endif
-
-#if ENABLE(DEVICE_ORIENTATION)
-    if (page()->deviceMotionController())
-        page()->deviceMotionController()->suspend();
-    if (page()->deviceOrientationController())
-        page()->deviceOrientationController()->suspend();
-#endif
-}
-
-void Document::resumeActiveDOMObjects()
-{
-    ScriptExecutionContext::resumeActiveDOMObjects();
-
-    if (!page())
-        return;
-
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
-    if (page()->geolocationController() && usingGeolocation())
-        page()->geolocationController()->resume();
-#endif
-
-#if ENABLE(DEVICE_ORIENTATION)
-    if (page()->deviceMotionController())
-        page()->deviceMotionController()->resume();
-    if (page()->deviceOrientationController())
-        page()->deviceOrientationController()->resume();
-#endif
-}
-
-void Document::stopActiveDOMObjects()
-{
-    ScriptExecutionContext::stopActiveDOMObjects();
-
-    if (!page())
-        return;
-
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
-    if (page()->geolocationController() && usingGeolocation())
-        page()->geolocationController()->suspend();
-#endif
-
-#if ENABLE(DEVICE_ORIENTATION)
-    if (page()->deviceMotionController())
-        page()->deviceMotionController()->suspend();
-    if (page()->deviceOrientationController())
-        page()->deviceOrientationController()->suspend();
-#endif
-}
-
 RenderView* Document::renderView() const
 {
     return toRenderView(renderer());

Modified: trunk/Source/WebCore/dom/Document.h (98049 => 98050)


--- trunk/Source/WebCore/dom/Document.h	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/Document.h	2011-10-21 00:33:26 UTC (rev 98050)
@@ -564,11 +564,6 @@
     virtual void attach();
     virtual void detach();
 
-    // Override ScriptExecutionContext methods to do additional work
-    virtual void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension) OVERRIDE;
-    virtual void resumeActiveDOMObjects() OVERRIDE;
-    virtual void stopActiveDOMObjects() OVERRIDE;
-
     RenderArena* renderArena() { return m_renderArena.get(); }
 
     RenderView* renderView() const;

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (98049 => 98050)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.h	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h	2011-10-21 00:33:26 UTC (rev 98050)
@@ -109,10 +109,9 @@
         bool canSuspendActiveDOMObjects();
         // Active objects can be asked to suspend even if canSuspendActiveDOMObjects() returns 'false' -
         // step-by-step JS debugging is one example.
-        virtual void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
-        virtual void resumeActiveDOMObjects();
-        virtual void stopActiveDOMObjects();
-
+        void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
+        void resumeActiveDOMObjects();
+        void stopActiveDOMObjects();
         void createdActiveDOMObject(ActiveDOMObject*, void* upcastPointer);
         void destroyedActiveDOMObject(ActiveDOMObject*);
         typedef const HashMap<ActiveDOMObject*, void*> ActiveDOMObjectsMap;

Modified: trunk/Source/WebCore/page/GeolocationController.cpp (98049 => 98050)


--- trunk/Source/WebCore/page/GeolocationController.cpp	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/page/GeolocationController.cpp	2011-10-21 00:33:26 UTC (rev 98050)
@@ -80,18 +80,6 @@
     }
 }
 
-void GeolocationController::suspend()
-{
-    if (m_client && !m_observers.isEmpty())
-        m_client->stopUpdating();
-}
-
-void GeolocationController::resume()
-{
-    if (m_client && !m_observers.isEmpty())
-        m_client->startUpdating();
-}
-
 void GeolocationController::requestPermission(Geolocation* geolocation)
 {
     if (m_client)

Modified: trunk/Source/WebCore/page/GeolocationController.h (98049 => 98050)


--- trunk/Source/WebCore/page/GeolocationController.h	2011-10-21 00:27:47 UTC (rev 98049)
+++ trunk/Source/WebCore/page/GeolocationController.h	2011-10-21 00:33:26 UTC (rev 98050)
@@ -49,9 +49,6 @@
     void addObserver(Geolocation*, bool enableHighAccuracy);
     void removeObserver(Geolocation*);
 
-    void suspend();
-    void resume();
-
     void requestPermission(Geolocation*);
     void cancelPermissionRequest(Geolocation*);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to