Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Issue 230373003: Fix leak in ServiceWorkerVersionTest.RepeatedlyObserveStatusChanges (Closed)

Created:
6 years, 8 months ago by kinuko
Modified:
6 years, 8 months ago
Reviewers:
falken, michaeln
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, alecflett+watch_chromium.org
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262933

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -3 lines) Patch
M content/browser/service_worker/service_worker_version.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
kinuko
PTL
6 years, 8 months ago (2014-04-09 10:04:21 UTC) #1
falken
lgtm
6 years, 8 months ago (2014-04-09 20:09:01 UTC) #2
falken
+michaeln for OWNER review
6 years, 8 months ago (2014-04-09 20:11:49 UTC) #3
kinuko
The CQ bit was checked by kinuko@chromium.org
6 years, 8 months ago (2014-04-10 00:53:39 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinuko@chromium.org/230373003/1
6 years, 8 months ago (2014-04-10 00:53:45 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-10 01:16:19 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 8 months ago (2014-04-10 01:16:20 UTC) #7
kinuko
The CQ bit was checked by kinuko@chromium.org
6 years, 8 months ago (2014-04-10 01:31:00 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinuko@chromium.org/230373003/1
6 years, 8 months ago (2014-04-10 01:31:18 UTC) #9
commit-bot: I haz the power
6 years, 8 months ago (2014-04-10 05:29:43 UTC) #10
Message was sent while issue was closed.
Change committed as 262933

Powered by Google App Engine
This is Rietveld 408576698