From f851af8541efd1e297cd114280fe875f0edc1eab Mon Sep 17 00:00:00 2001 From: Rick Eyre Date: Tue, 24 Sep 2013 15:17:15 -0400 Subject: [PATCH] Bug 919265 - Part 2: Add ClearOnShutdown() call on the static WebVTTParserWrapper. r=bz --- content/media/TextTrackCue.cpp | 2 ++ content/media/test/Makefile.in | 11 +++++---- content/media/test/test_bug919265.html | 32 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 content/media/test/test_bug919265.html diff --git a/content/media/TextTrackCue.cpp b/content/media/TextTrackCue.cpp index 0f60d79d1c6..41c0f3189ff 100644 --- a/content/media/TextTrackCue.cpp +++ b/content/media/TextTrackCue.cpp @@ -8,6 +8,7 @@ #include "nsIFrame.h" #include "nsVideoFrame.h" #include "nsComponentManagerUtils.h" +#include "mozilla/ClearOnShutdown.h" // Alternate value for the 'auto' keyword. #define WEBVTT_AUTO -1 @@ -162,6 +163,7 @@ TextTrackCue::GetCueAsHTML() return mDocument->CreateDocumentFragment(); } sParserWrapper = parserWrapper; + ClearOnShutdown(&sParserWrapper); } nsPIDOMWindow* window = mDocument->GetWindow(); diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index d507d2df3b6..cf06adc3b24 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -64,10 +64,16 @@ MOCHITEST_FILES = \ test_audio1.html \ test_audio2.html \ test_autoplay.html \ + test_bug448534.html \ + test_bug463162.xhtml \ test_bug495145.html \ test_bug495300.html \ test_bug654550.html \ test_bug686942.html \ + test_bug883173.html \ + test_bug895305.html \ + test_bug895091.html \ + test_bug919265.html \ test_can_play_type.html \ test_can_play_type_mpeg.html \ test_closing_connections.html \ @@ -118,8 +124,6 @@ MOCHITEST_FILES = \ test_mozHasAudio.html \ test_source_media.html \ test_autoplay_contentEditable.html \ - test_bug448534.html \ - test_bug463162.xhtml \ test_decoder_disable.html \ test_mediarecorder_record_no_timeslice.html \ test_mediarecorder_reload_crash.html \ @@ -146,9 +150,6 @@ MOCHITEST_FILES = \ test_VideoPlaybackQuality.html \ test_VideoPlaybackQuality_disabled.html \ test_webvtt_disabled.html \ - test_bug895305.html \ - test_bug895091.html \ - test_bug883173.html \ $(NULL) # Don't run in suite diff --git a/content/media/test/test_bug919265.html b/content/media/test/test_bug919265.html new file mode 100644 index 00000000000..76433419da2 --- /dev/null +++ b/content/media/test/test_bug919265.html @@ -0,0 +1,32 @@ + + + + + + Regression test for bug 919265 - Leak on VTTCue::GetCueAsHTML() + + + + + +

+ +
+
+
+ +