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

Issue 214453005: RefCounted::derefBase() should do the decrement from 1 to 0 (Closed)

Created:
6 years, 9 months ago by haraken
Modified:
6 years, 9 months ago
CC:
blink-reviews, Mikhail, adamk+blink_chromium.org, Inactive, abarth-chromium
Visibility:
Public.

Description

RefCounted::derefBase() should do the decrement from 1 to 0 Currently derefBase() does not do the decrement from 1 to 0 because an object that has 0 refcount is going to die immediately (there is no need to do the decrement). However, in the oilpan world, it's possible that an object that has 0 refcount is resurrected, because the object can still be retained through oilpan handles. Thus we need to manage the refcount correctly even when the refcount is going to be 0. I'm making this change separately from oilpan changes, since this change might regress performance of something. derefBase() is performance-sensitive. BUG=340522 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170256

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M Source/wtf/RefCounted.h View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
haraken
PTAL
6 years, 9 months ago (2014-03-28 02:03:16 UTC) #1
tkent
lgtm.
6 years, 9 months ago (2014-03-28 02:10:09 UTC) #2
haraken
The CQ bit was checked by haraken@chromium.org
6 years, 9 months ago (2014-03-28 02:22:51 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/214453005/1
6 years, 9 months ago (2014-03-28 02:22:57 UTC) #4
commit-bot: I haz the power
Change committed as 170256
6 years, 9 months ago (2014-03-28 03:29:15 UTC) #5
Mads Ager (chromium)
LGTM If this regresses the non-oilpan build we can do the ref counting manually for ...
6 years, 9 months ago (2014-03-28 06:32:22 UTC) #6
Mads Ager (chromium)
On 2014/03/28 06:32:22, Mads Ager (chromium) wrote: > LGTM > > If this regresses the ...
6 years, 9 months ago (2014-03-28 06:34:02 UTC) #7
haraken
6 years, 9 months ago (2014-03-28 07:06:17 UTC) #8
Message was sent while issue was closed.
On 2014/03/28 06:34:02, Mads Ager (chromium) wrote:
> On 2014/03/28 06:32:22, Mads Ager (chromium) wrote:
> > LGTM
> > 
> > If this regresses the non-oilpan build we can do the ref counting manually
for
> > ThreadSafeRefCountedGarbageCollected we already do that for
> > RefCountedGarbageCollected. :-)
> 
> We might have to anyway because as you write, with oilpan we do not have the
> invariant that the ref count can never become non-zero when it reaches zero. I
> think that will trip asserts in the current ref counting code so it might be
> cleaner that we do it ourselves.

I'm fine with either way: adding #if ENABLE_OILPAN to the existing RefCounted.h
or duplicating RefCounted.h.

Powered by Google App Engine
This is Rietveld 408576698