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

eric.carlson at apple.com eric.carlson at apple.com
Wed Dec 22 13:08:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8c040eaef1e9b857825310f4028b58cbb388e3cf
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 7 18:29:29 2010 +0000

    2010-09-07  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Darin Adler.
    
            Media elements should derive from ActiveDOMObjects
            https://bugs.webkit.org/show_bug.cgi?id=45306
            <rdar://problem/7929062>
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize ActiveDOMObject
            (WebCore::HTMLMediaElement::stop): Call suspend, we want to do the same thing in both cases.
            (WebCore::HTMLMediaElement::suspend): Rename from documentWillBecomeInactive.
            (WebCore::HTMLMediaElement::resume): Rename from documentDidBecomeActive.
            (WebCore::HTMLMediaElement::hasPendingActivity): Return true if the event queue is not empty
            so the element can't be collected before they are sent.
            * html/HTMLMediaElement.h:
            (WebCore::HTMLMediaElement::canSuspend):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66895 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 77e3aa4..75d0c0b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-07  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Media elements should derive from ActiveDOMObjects
+        https://bugs.webkit.org/show_bug.cgi?id=45306
+        <rdar://problem/7929062>
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize ActiveDOMObject
+        (WebCore::HTMLMediaElement::stop): Call suspend, we want to do the same thing in both cases.
+        (WebCore::HTMLMediaElement::suspend): Rename from documentWillBecomeInactive.
+        (WebCore::HTMLMediaElement::resume): Rename from documentDidBecomeActive.
+        (WebCore::HTMLMediaElement::hasPendingActivity): Return true if the event queue is not empty
+        so the element can't be collected before they are sent.
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::canSuspend):
+
 2010-09-07  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Unreviewed, rolling out r66886.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 0f4a514..9e4d32f 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -29,14 +29,14 @@
 #include "HTMLMediaElement.h"
 
 #include "Attribute.h"
-#include "CSSHelper.h"
-#include "CSSPropertyNames.h"
-#include "CSSValueKeywords.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "ClientRect.h"
 #include "ClientRectList.h"
 #include "ContentType.h"
+#include "CSSHelper.h"
+#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
@@ -48,12 +48,12 @@
 #include "HTMLNames.h"
 #include "HTMLSourceElement.h"
 #include "HTMLVideoElement.h"
-#include "MIMETypeRegistry.h"
 #include "MediaDocument.h"
 #include "MediaError.h"
 #include "MediaList.h"
 #include "MediaPlayer.h"
 #include "MediaQueryEvaluator.h"
+#include "MIMETypeRegistry.h"
 #include "Page.h"
 #include "RenderVideo.h"
 #include "RenderView.h"
@@ -80,8 +80,9 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
-    : HTMLElement(tagName, doc)
+HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* document)
+    : HTMLElement(tagName, document)
+    , ActiveDOMObject(document, this)
     , m_loadTimer(this, &HTMLMediaElement::loadTimerFired)
     , m_asyncEventTimer(this, &HTMLMediaElement::asyncEventTimerFired)
     , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired)
@@ -132,8 +133,8 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
     , m_loadInitiatedByUserGesture(false)
     , m_completelyLoaded(false)
 {
-    document()->registerForDocumentActivationCallbacks(this);
-    document()->registerForMediaVolumeCallbacks(this);
+    document->registerForDocumentActivationCallbacks(this);
+    document->registerForMediaVolumeCallbacks(this);
 }
 
 HTMLMediaElement::~HTMLMediaElement()
@@ -1849,7 +1850,17 @@ void HTMLMediaElement::userCancelledLoad()
     m_readyState = HAVE_NOTHING;
 }
 
-void HTMLMediaElement::documentWillBecomeInactive()
+bool HTMLMediaElement::canSuspend() const
+{
+    return true; 
+}
+
+void HTMLMediaElement::stop()
+{
+    suspend();
+}
+
+void HTMLMediaElement::suspend()
 {
     if (m_isFullscreen)
         exitFullscreen();
@@ -1867,7 +1878,7 @@ void HTMLMediaElement::documentWillBecomeInactive()
     cancelPendingEventsAndCallbacks();
 }
 
-void HTMLMediaElement::documentDidBecomeActive()
+void HTMLMediaElement::resume()
 {
     m_inActiveDocument = true;
     setPausedInternal(false);
@@ -1885,6 +1896,13 @@ void HTMLMediaElement::documentDidBecomeActive()
         renderer()->updateFromElement();
 }
 
+bool HTMLMediaElement::hasPendingActivity() const
+{
+    // Return true when we have pending events so we can't fire events after the JS 
+    // object gets collected.
+    return m_pendingEvents.size();
+}
+
 void HTMLMediaElement::mediaVolumeDidChange()
 {
     updateVolume();
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index b595604..0a8f8dd 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -29,6 +29,7 @@
 #if ENABLE(VIDEO)
 
 #include "HTMLElement.h"
+#include "ActiveDOMObject.h"
 #include "MediaCanStartListener.h"
 #include "MediaPlayer.h"
 
@@ -51,7 +52,7 @@ class Widget;
 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it
 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement.
 
-class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener {
+class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener, private ActiveDOMObject {
 public:
     MediaPlayer* player() const { return m_player.get(); }
     
@@ -196,8 +197,13 @@ private:
     float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
     void setTimeOffsetAttribute(const QualifiedName&, float value);
     
-    virtual void documentWillBecomeInactive();
-    virtual void documentDidBecomeActive();
+    // ActiveDOMObject functions.
+    virtual bool canSuspend() const;
+    virtual void suspend();
+    virtual void resume();
+    virtual void stop();
+    virtual bool hasPendingActivity() const;
+    
     virtual void mediaVolumeDidChange();
 
     virtual void updateDisplayState() { }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list