Changeset 66895 in webkit
- Timestamp:
- Sep 7, 2010 11:29:29 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r66892 r66895 1 2010-09-07 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Media elements should derive from ActiveDOMObjects 6 https://bugs.webkit.org/show_bug.cgi?id=45306 7 <rdar://problem/7929062> 8 9 * html/HTMLMediaElement.cpp: 10 (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize ActiveDOMObject 11 (WebCore::HTMLMediaElement::stop): Call suspend, we want to do the same thing in both cases. 12 (WebCore::HTMLMediaElement::suspend): Rename from documentWillBecomeInactive. 13 (WebCore::HTMLMediaElement::resume): Rename from documentDidBecomeActive. 14 (WebCore::HTMLMediaElement::hasPendingActivity): Return true if the event queue is not empty 15 so the element can't be collected before they are sent. 16 * html/HTMLMediaElement.h: 17 (WebCore::HTMLMediaElement::canSuspend): 18 1 19 2010-09-07 Dimitri Glazkov <dglazkov@chromium.org> 2 20 -
trunk/WebCore/html/HTMLMediaElement.cpp
r66815 r66895 30 30 31 31 #include "Attribute.h" 32 #include "CSSHelper.h"33 #include "CSSPropertyNames.h"34 #include "CSSValueKeywords.h"35 32 #include "Chrome.h" 36 33 #include "ChromeClient.h" … … 38 35 #include "ClientRectList.h" 39 36 #include "ContentType.h" 37 #include "CSSHelper.h" 38 #include "CSSPropertyNames.h" 39 #include "CSSValueKeywords.h" 40 40 #include "Event.h" 41 41 #include "EventNames.h" … … 49 49 #include "HTMLSourceElement.h" 50 50 #include "HTMLVideoElement.h" 51 #include "MIMETypeRegistry.h"52 51 #include "MediaDocument.h" 53 52 #include "MediaError.h" … … 55 54 #include "MediaPlayer.h" 56 55 #include "MediaQueryEvaluator.h" 56 #include "MIMETypeRegistry.h" 57 57 #include "Page.h" 58 58 #include "RenderVideo.h" … … 81 81 using namespace HTMLNames; 82 82 83 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc) 84 : HTMLElement(tagName, doc) 83 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* document) 84 : HTMLElement(tagName, document) 85 , ActiveDOMObject(document, this) 85 86 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) 86 87 , m_asyncEventTimer(this, &HTMLMediaElement::asyncEventTimerFired) … … 133 134 , m_completelyLoaded(false) 134 135 { 135 document ()->registerForDocumentActivationCallbacks(this);136 document ()->registerForMediaVolumeCallbacks(this);136 document->registerForDocumentActivationCallbacks(this); 137 document->registerForMediaVolumeCallbacks(this); 137 138 } 138 139 … … 1850 1851 } 1851 1852 1852 void HTMLMediaElement::documentWillBecomeInactive() 1853 bool HTMLMediaElement::canSuspend() const 1854 { 1855 return true; 1856 } 1857 1858 void HTMLMediaElement::stop() 1859 { 1860 suspend(); 1861 } 1862 1863 void HTMLMediaElement::suspend() 1853 1864 { 1854 1865 if (m_isFullscreen) … … 1868 1879 } 1869 1880 1870 void HTMLMediaElement:: documentDidBecomeActive()1881 void HTMLMediaElement::resume() 1871 1882 { 1872 1883 m_inActiveDocument = true; … … 1886 1897 } 1887 1898 1899 bool HTMLMediaElement::hasPendingActivity() const 1900 { 1901 // Return true when we have pending events so we can't fire events after the JS 1902 // object gets collected. 1903 return m_pendingEvents.size(); 1904 } 1905 1888 1906 void HTMLMediaElement::mediaVolumeDidChange() 1889 1907 { -
trunk/WebCore/html/HTMLMediaElement.h
r66710 r66895 30 30 31 31 #include "HTMLElement.h" 32 #include "ActiveDOMObject.h" 32 33 #include "MediaCanStartListener.h" 33 34 #include "MediaPlayer.h" … … 52 53 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. 53 54 54 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener {55 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener, private ActiveDOMObject { 55 56 public: 56 57 MediaPlayer* player() const { return m_player.get(); } … … 197 198 void setTimeOffsetAttribute(const QualifiedName&, float value); 198 199 199 virtual void documentWillBecomeInactive(); 200 virtual void documentDidBecomeActive(); 200 // ActiveDOMObject functions. 201 virtual bool canSuspend() const; 202 virtual void suspend(); 203 virtual void resume(); 204 virtual void stop(); 205 virtual bool hasPendingActivity() const; 206 201 207 virtual void mediaVolumeDidChange(); 202 208
Note: See TracChangeset
for help on using the changeset viewer.