Bug 1444680: Follow-up: Release StreamFilterParent::mChannel on main thread. r=mixedpuppy a=bustage DONTBUILD CLOSED TREE
authorKris Maglione <maglione.k@gmail.com>
Mon, 12 Mar 2018 15:04:02 -0700
changeset 407821 dfdfc8e56c31538f820d436a42fcfb24d583b26a
parent 407820 e3f724fca687943e6f91254a8a5873ba63657c7e
child 407822 4c68b341cf1410f01113fcb6fb4cccbb9f31dc61
push id33621
push userapavel@mozilla.com
push dateTue, 13 Mar 2018 17:12:05 +0000
treeherdermozilla-central@deb7714a7bcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, bustage
bugs1444680
milestone60.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 1444680: Follow-up: Release StreamFilterParent::mChannel on main thread. r=mixedpuppy a=bustage DONTBUILD CLOSED TREE Running the StreamFilter tests as parallel xpcshell tests uncovered a race, in which we sometimes wind up releasing the last reference to an HttpChannel on a background thread, and its destructor attempts to free things which can only be freed on the main thread.
toolkit/components/extensions/webrequest/StreamFilterParent.cpp
--- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
+++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
@@ -111,16 +111,18 @@ StreamFilterParent::StreamFilterParent()
   , mSentStop(false)
   , mContext(nullptr)
   , mOffset(0)
   , mState(State::Uninitialized)
 {}
 
 StreamFilterParent::~StreamFilterParent()
 {
+  NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mChannel",
+                                    mChannel.forget());
   NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mOrigListener",
                                     mOrigListener.forget());
   NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mContext",
                                     mContext.forget());
 }
 
 bool
 StreamFilterParent::Create(dom::ContentParent* aContentParent, uint64_t aChannelId, const nsAString& aAddonId,