HTMLMediaPlayer should free m_player when src is set/changed
authorfischman@chromium.org <fischman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 01:38:30 +0000 (01:38 +0000)
committerfischman@chromium.org <fischman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 01:38:30 +0000 (01:38 +0000)
commit201f728e36b69f3a922d69f9258159b84329c13d
tree98665f87d9bcdbd8f9636b3f405bfc60ea9af4ca
parent7a2ee3abe6b20dcbc2ee5686747ede8b0f6a3462
HTMLMediaPlayer should free m_player when src is set/changed
https://bugs.webkit.org/show_bug.cgi?id=99647

Reviewed by Eric Carlson.

.:

* ManualTests/media-players-are-dropped-on-error.html: Added.
    Various scenarios are tested to make sure players aren't
    leaked in different ways for each of them.

Source/WebCore:

New ManualTest added; manual since leaking media players doesn't have layoutTestController-visible effects.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): clearMediaPlayer() when src is set/changed
(WebCore::HTMLMediaElement::userCancelledLoad): use new clearMediaPlayer() helper
(WebCore::HTMLMediaElement::clearMediaPlayer): clear m_player and associated timers/flags
(WebCore):
(WebCore::HTMLMediaElement::createMediaPlayer): whitespace-only change
* html/HTMLMediaElement.h: new method: createMediaPlayer().
(HTMLMediaElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
ManualTests/media-players-are-dropped-on-error.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h