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

Issue 16423: Fix for WebContents unit tests memory trashing (Closed)

Created:
12 years ago by jcampan
Modified:
9 years, 7 months ago
Reviewers:
cpu_(ooo_6.6-7.5)
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

My Friday fix for some stack trashing introduced some heap trashing! The tests create PageInterstitial objects which are self-owned (they delete themselves when hidden). The tests test whether the PageInterstitial instance has been deleted by passing a local variable boolean to its constructor that the InterstitialPage sets to true when deleted. In the stack trashing case, in one of the test the interstitial was deleted from the TearDown() method, so outside of the scope of the test. The interstitial was still accessing the local variable from the test scope, trashing the stack. My previous fix introduced a state guard class allocated on the stack that would notify the InterstitialPage when deleted so it would clear any reference to the local vars, which fixed the stack trashing. But this created a new problem: when the interstitial is deleted in the scope of the unit tests, the state guard object still holds a reference to the now deleted interstitial and calls a method on it when itself deleted. This CL ensures the state guard class does not access any deleted interstitial. BUG=5789 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=7384

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -20 lines) Patch
M chrome/browser/web_contents_unittest.cc View 1 17 chunks +37 lines, -20 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
jcampan
12 years ago (2008-12-22 19:57:51 UTC) #1
cpu_(ooo_6.6-7.5)
12 years ago (2008-12-22 22:13:53 UTC) #2
lgtm

Powered by Google App Engine
This is Rietveld 408576698