Fix leak in ServiceWorkerVersionTest.RepeatedlyObserveStatusChanges
In r262636 I deleted the Shutdown() methods from SWRegistration and SWVersion, but it caused a leak in RepeatedlyObserveStatusChanges. In the previous code the status change callback (ObserveStatusChanges) holds a ref to ServiceWorkerVersion, which was ok when we had Shutdown() (as we could explicitly clear the status change callback there), but now we don't, so we have cyclic reference there. I just changed make_scoped_refptr(version) to base::Unretained(version) when we pass the version to the callback, so that the callback no longer holds a ref to the Version. BUG=361504 TEST=ServiceWorkerVersionTest.RepeatedlyObserveStatusChanges with asan/lsan Review URL: https://codereview.chromium.org/230373003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262933 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment