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

Issue 2902373003: Fix memory leak in unit test (Closed)

Created:
3 years, 7 months ago by xiaochu
Modified:
3 years, 7 months ago
Reviewers:
waffles, sky, Matt Giuca
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix memory leak CrOSComponentInstallerTest.BPPPCompatibleCrOSComponent unittest Replace raw pointer with a stack variable. BUG=chromium:690521, chromium:726579 TEST=passed trybots. Review-Url: https://codereview.chromium.org/2902373003 Cr-Commit-Position: refs/heads/master@{#474911} Committed: https://chromium.googlesource.com/chromium/src/+/44c957b81b919e80612133fc5e9d4847252b1258

Patch Set 1 #

Total comments: 2

Patch Set 2 : move bppp to member variable. #

Total comments: 2

Patch Set 3 : address comments from sky #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M chrome/browser/component_updater/cros_component_installer_unittest.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (14 generated)
xiaochu
One-line change to fix memory leak in unittest. Please take a look.
3 years, 7 months ago (2017-05-26 02:06:56 UTC) #6
sky
https://codereview.chromium.org/2902373003/diff/1/chrome/browser/component_updater/cros_component_installer_unittest.cc File chrome/browser/component_updater/cros_component_installer_unittest.cc (right): https://codereview.chromium.org/2902373003/diff/1/chrome/browser/component_updater/cros_component_installer_unittest.cc#newcode90 chrome/browser/component_updater/cros_component_installer_unittest.cc:90: std::unique_ptr<BrowserProcessPlatformPart> bppp( Can you instead declare BPPP on the ...
3 years, 7 months ago (2017-05-26 02:27:20 UTC) #7
xiaochu
I moved bppp to member variable and add a getBPPP function to CrOSComponentInstallerTest. https://codereview.chromium.org/2902373003/diff/1/chrome/browser/component_updater/cros_component_installer_unittest.cc File ...
3 years, 7 months ago (2017-05-26 02:47:47 UTC) #8
sky
https://codereview.chromium.org/2902373003/diff/20001/chrome/browser/component_updater/cros_component_installer_unittest.cc File chrome/browser/component_updater/cros_component_installer_unittest.cc (right): https://codereview.chromium.org/2902373003/diff/20001/chrome/browser/component_updater/cros_component_installer_unittest.cc#newcode96 chrome/browser/component_updater/cros_component_installer_unittest.cc:96: ASSERT_EQ(GetBPPP()->IsCompatibleCrOSComponent("a"), false); I'm suggesting you do this: BrowserProcessPlatformPart bppp; ...
3 years, 7 months ago (2017-05-26 03:11:12 UTC) #9
xiaochu
Sorry, I mis-understood (call) stack (unique_ptr does not allow me to get...). https://codereview.chromium.org/2902373003/diff/20001/chrome/browser/component_updater/cros_component_installer_unittest.cc File chrome/browser/component_updater/cros_component_installer_unittest.cc ...
3 years, 7 months ago (2017-05-26 03:21:21 UTC) #10
Matt Giuca
Please change BUG= line to 726579 (which is the issue for the memory leak as ...
3 years, 7 months ago (2017-05-26 04:10:01 UTC) #14
Matt Giuca
On 2017/05/26 04:10:01, Matt Giuca wrote: > Please change BUG= line to 726579 (which is ...
3 years, 7 months ago (2017-05-26 04:10:35 UTC) #15
Matt Giuca
On 2017/05/26 04:10:35, Matt Giuca wrote: > On 2017/05/26 04:10:01, Matt Giuca wrote: > > ...
3 years, 7 months ago (2017-05-26 04:11:33 UTC) #16
xiaochu
On 2017/05/26 04:11:33, Matt Giuca wrote: > On 2017/05/26 04:10:35, Matt Giuca wrote: > > ...
3 years, 7 months ago (2017-05-26 04:40:34 UTC) #20
sky
LGTM
3 years, 7 months ago (2017-05-26 04:43:29 UTC) #21
Matt Giuca
On 2017/05/26 04:43:29, sky wrote: > LGTM Thanks everyone for dealing with this outside of ...
3 years, 7 months ago (2017-05-26 04:48:37 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2902373003/40001
3 years, 7 months ago (2017-05-26 04:48:57 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/44c957b81b919e80612133fc5e9d4847252b1258
3 years, 7 months ago (2017-05-26 04:54:01 UTC) #27
xiaochu
3 years, 7 months ago (2017-05-26 04:54:33 UTC) #28
Message was sent while issue was closed.
On 2017/05/26 04:48:37, Matt Giuca wrote:
> On 2017/05/26 04:43:29, sky wrote:
> > LGTM
> 
> Thanks everyone for dealing with this outside of normal work hours.

Sorry for my causing the trouble... 
Thanks for code review!

Powered by Google App Engine
This is Rietveld 408576698