Bug 1548994 - Release nsCompleteUpgradeData.mUpgradeListener on the main thread as it is not always threadsafe r=dragana
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 13 May 2019 22:49:02 +0000
changeset 535622 aa14d710b4ccd7ff72693f988c006aff700b9183
parent 535621 2d94f58711b3c1b501d72ed05845198fc3aeb6e8
child 535623 386a0b72c793860f7b40fdf7383b7a9078f02091
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1548994
milestone68.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 1548994 - Release nsCompleteUpgradeData.mUpgradeListener on the main thread as it is not always threadsafe r=dragana Differential Revision: https://phabricator.services.mozilla.com/D30022
netwerk/protocol/http/nsHttpConnectionMgr.cpp
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -561,17 +561,20 @@ class nsCompleteUpgradeData : public ARe
 
   nsCOMPtr<nsISocketTransport> mSocketTransport;
   nsCOMPtr<nsIAsyncInputStream> mSocketIn;
   nsCOMPtr<nsIAsyncOutputStream> mSocketOut;
 
   bool mJsWrapped;
 
  private:
-  virtual ~nsCompleteUpgradeData() = default;
+  virtual ~nsCompleteUpgradeData() {
+    NS_ReleaseOnMainThreadSystemGroup("nsCompleteUpgradeData.mUpgradeListener",
+                                      mUpgradeListener.forget());
+  }
 };
 
 nsresult nsHttpConnectionMgr::CompleteUpgrade(
     nsHttpTransaction* aTrans, nsIHttpUpgradeListener* aUpgradeListener) {
   // test if aUpgradeListener is a wrapped JsObject
   nsCOMPtr<nsIXPConnectWrappedJS> wrapper = do_QueryInterface(aUpgradeListener);
 
   bool wrapped = !!wrapper;