Changeset 98005 in webkit
- Timestamp:
- Oct 20, 2011, 11:26:15 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98002 r98005 1 2011-10-20 Eugene Nalimov <enal@chromium.org> 2 3 Playing HTMLAudioElement can be garbage collected 4 https://bugs.webkit.org/show_bug.cgi?id=66878 5 6 Reviewed by Adam Barth. 7 8 Make HTMLAudioElement an 'active' one, meaning that it cannot be 9 garbage collected if it has panding activity. Had to make 10 HTMLMediaElement::hasPendingActivity() and 11 HTMLAudioElement::hasPendingActivity() public, otherwise automatically 12 generated code would not compile. 13 14 Test: no test, as automatic test is blocked by 15 https://bugs.webkit.org/show_bug.cgi?id=70421 16 You don't want to sit down and listen if audio stream played completely, 17 and cannot rely on 'ended' event because events are lost when events 18 listener is collected. 19 20 * html/HTMLAudioElement.idl: 21 * html/HTMLAudioElement.h: 22 (WebCore::HTMLAudioElement::hasPendingActivity): 23 * html/HTMLMediaElement.h: 24 1 25 2011-10-20 Mark Hahnenberg <mhahnenberg@apple.com> 2 26 -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
r97929 r98005 48 48 namespace WebCore { 49 49 50 WrapperTypeInfo V8HTMLAudioElementConstructor::info = { V8HTMLAudioElementConstructor::GetTemplate, 0, 0, 0 };50 WrapperTypeInfo V8HTMLAudioElementConstructor::info = { V8HTMLAudioElementConstructor::GetTemplate, V8HTMLAudioElement::derefObject, V8HTMLAudioElement::toActiveDOMObject, 0 }; 51 51 52 52 static v8::Handle<v8::Value> v8HTMLAudioElementConstructorCallback(const v8::Arguments& args) … … 72 72 toV8(document); 73 73 74 75 74 String src; 76 75 if (args.Length() > 0) … … 80 79 V8DOMWrapper::setDOMWrapper(args.Holder(), &V8HTMLAudioElementConstructor::info, audio.get()); 81 80 audio->ref(); 82 V8DOMWrapper::setJSWrapperFor DOMNode(audio.get(), v8::Persistent<v8::Object>::New(args.Holder()));81 V8DOMWrapper::setJSWrapperForActiveDOMObject(audio.get(), v8::Persistent<v8::Object>::New(args.Holder())); 83 82 return args.Holder(); 84 83 } -
trunk/Source/WebCore/html/HTMLAudioElement.h
r74812 r98005 41 41 static PassRefPtr<HTMLAudioElement> createForJSConstructor(Document*, const String& src); 42 42 43 virtual bool hasPendingActivity() const { return isPlaying() || HTMLMediaElement::hasPendingActivity(); } 44 43 45 private: 44 46 HTMLAudioElement(const QualifiedName&, Document*); -
trunk/Source/WebCore/html/HTMLAudioElement.idl
r92327 r98005 26 26 module html { 27 27 interface [ 28 ActiveDOMObject, 28 29 Conditional=VIDEO 29 30 ] HTMLAudioElement : HTMLMediaElement { 30 31 31 32 }; 32 33 } -
trunk/Source/WebCore/html/HTMLMediaElement.h
r97926 r98005 66 66 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. 67 67 68 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener, p rivateActiveDOMObject68 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, private MediaCanStartListener, public ActiveDOMObject 69 69 #if ENABLE(VIDEO_TRACK) 70 70 , private TextTrackClient … … 221 221 bool isPlaying() const { return m_playing; } 222 222 223 virtual bool hasPendingActivity() const; 224 223 225 #if ENABLE(WEB_AUDIO) 224 226 MediaElementAudioSourceNode* audioSourceNode() { return m_audioSourceNode; } … … 284 286 virtual void resume(); 285 287 virtual void stop(); 286 virtual bool hasPendingActivity() const;287 288 288 289 virtual void mediaVolumeDidChange();
Note:
See TracChangeset
for help on using the changeset viewer.