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

Issue 10387063: Let WeakPtrFactory operations fail once its dtor is called (Closed)

Created:
8 years, 7 months ago by oshima
Modified:
8 years, 7 months ago
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org
Visibility:
Public.

Description

Let WeakPtrFactory operations fail once its dtor is called We had a weird bug (crbug.com/127534) where the task was posted and executed even after WeakPtrFactory has been deleted. It turns out that someone was posting a task AFTER its detor was called while executing destructor, and bots (including valgrind) couldn't catch this because the memory stays valid until the hosting object is deleted. This CL is to catch such case early by resetting the ptr_. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=137963

Patch Set 1 #

Patch Set 2 : . #

Total comments: 4

Patch Set 3 : style fix, NULL only if !ndebug || dcheck_always_on #

Patch Set 4 : sync #

Patch Set 5 : enable for release #

Total comments: 1

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -0 lines) Patch
M base/memory/weak_ptr.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
oshima
8 years, 7 months ago (2012-05-17 00:43:02 UTC) #1
darin (slow to review)
http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h File base/memory/weak_ptr.h (right): http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h#newcode234 base/memory/weak_ptr.h:234: ~WeakPtrFactory(){ nit: add new line above the destructor http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h#newcode235 ...
8 years, 7 months ago (2012-05-17 22:00:52 UTC) #2
oshima
http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h File base/memory/weak_ptr.h (right): http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h#newcode234 base/memory/weak_ptr.h:234: ~WeakPtrFactory(){ On 2012/05/17 22:00:52, darin wrote: > nit: add ...
8 years, 7 months ago (2012-05-17 22:16:41 UTC) #3
darin (slow to review)
On Thu, May 17, 2012 at 3:16 PM, <oshima@chromium.org> wrote: > > http://codereview.chromium.**org/10387063/diff/6002/base/** > memory/weak_ptr.h<http://codereview.chromium.org/10387063/diff/6002/base/memory/weak_ptr.h> ...
8 years, 7 months ago (2012-05-17 22:22:18 UTC) #4
oshima
On 2012/05/17 22:22:18, darin wrote: > On Thu, May 17, 2012 at 3:16 PM, <mailto:oshima@chromium.org> ...
8 years, 7 months ago (2012-05-18 00:43:34 UTC) #5
darin (slow to review)
I think your first patch is probably best, but I've asked jschuh to comment too ...
8 years, 7 months ago (2012-05-18 17:45:13 UTC) #6
jschuh
On 2012/05/18 17:45:13, darin wrote: > I think your first patch is probably best, but ...
8 years, 7 months ago (2012-05-18 18:11:38 UTC) #7
darin (slow to review)
Justin wrote: "Just for reference, from a security perspective a NULL pointer is always better ...
8 years, 7 months ago (2012-05-18 18:12:15 UTC) #8
oshima
Uploaded new patch. PTAL. On 2012/05/18 18:12:15, darin wrote: > Justin wrote: "Just for reference, ...
8 years, 7 months ago (2012-05-18 19:26:53 UTC) #9
darin (slow to review)
LGTM
8 years, 7 months ago (2012-05-18 20:20:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oshima@chromium.org/10387063/5
8 years, 7 months ago (2012-05-18 20:21:19 UTC) #11
commit-bot: I haz the power
8 years, 7 months ago (2012-05-18 21:33:05 UTC) #12
Change committed as 137963

Powered by Google App Engine
This is Rietveld 408576698