Bug 1458505 - grapping 'self' in mozilla::MakeScopeExit instead of '&' when needed, in HTMLMediaElement, r=me CLOSED TREE
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 03 May 2018 08:37:27 +0200
changeset 472925 2c900172250aa0fd23cec4d12cc0158f25fa2818
parent 472924 e44dc88af55ca3d293bd3f48311f529d9bfa13ae
child 472926 ba57284bc3bcd15dec389a3c46b1a4caf75028d9
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1458505
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1458505 - grapping 'self' in mozilla::MakeScopeExit instead of '&' when needed, in HTMLMediaElement, r=me CLOSED TREE
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4822,18 +4822,18 @@ nsresult HTMLMediaElement::InitializeDec
 
   DecoderDoctorDiagnostics diagnostics;
 
   nsAutoCString mimeType;
   aChannel->GetContentType(mimeType);
   NS_ASSERTION(!mimeType.IsEmpty(), "We should have the Content-Type.");
   NS_ConvertUTF8toUTF16 mimeUTF16(mimeType);
 
-  HTMLMediaElement* self = this;
-  auto reportCanPlay = [&](bool aCanPlay) {
+  RefPtr<HTMLMediaElement> self = this;
+  auto reportCanPlay = [&, self](bool aCanPlay) {
     diagnostics.StoreFormatDiagnostics(
       self->OwnerDoc(), mimeUTF16, aCanPlay, __func__);
     if (!aCanPlay) {
       nsAutoString src;
       self->GetCurrentSrc(src);
       const char16_t* params[] = { mimeUTF16.get(), src.get() };
       self->ReportLoadError(
         "MediaLoadUnsupportedMimeType", params, ArrayLength(params));