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

Issue 22929012: Change Canvas2DLayerBridge to stay alive until last mailbox is returned. (Closed)

Created:
7 years, 4 months ago by Justin Novosad
Modified:
7 years, 3 months ago
Reviewers:
danakj, Stephen White, piman
CC:
blink-reviews, eae+blinkwatch, dglazkov+blink, Rik, Stephen Chennney, jeez, pdr.
Visibility:
Public.

Description

Change Canvas2DLayerBridge to stay alive until last mailbox is returned. This change modifies the destruction mechanism for Canvas2DLayerBridge. When the owning ImageBuffer object is destroyed, the Canvas2DLayerBridge will no longer be destroyed if it has unreleased texture mailboxes. Instead, the object is leaked and becomes responsible for self-destructing as soon as its outstanding texture mailboxes are returned by the compositor. BUG=274113 TEST=leak and use after free verified by valgrind and asan layout test runs. Proper tear-down inspected and validated manually using debugger. R=senorblanco@chromium.org,piman@chromium.org,danakj@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157147

Patch Set 1 #

Total comments: 7

Patch Set 2 : Re-write to use RefPtr and empty mailbox #

Patch Set 3 : Fixing unit tests #

Total comments: 2

Patch Set 4 : Make prepareMailbox return false during tear-down #

Total comments: 3

Patch Set 5 : ASSERT(!m_destructionInProgress) in prepareMailbox #

Patch Set 6 : +1 -> -1 #

Patch Set 7 : preparMailbox to handle destructionInProgress #

Patch Set 8 : #

Patch Set 9 : compile fix #

Patch Set 10 : gcc build fix #

Total comments: 6

Patch Set 11 : applied senorblanco feedback #

Total comments: 1

Patch Set 12 : removed ->ref() #

Patch Set 13 : Trivial fix for layout test failure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -55 lines) Patch
M Source/core/platform/graphics/ImageBuffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +2 lines, -2 lines 0 comments Download
M Source/core/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +24 lines, -4 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +70 lines, -8 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp View 1 2 3 4 5 6 7 5 chunks +41 lines, -36 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
Justin Novosad
PTAL https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode106 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:106: m_layer->layer()->removeFromParent(); This line appears to be necessary if ...
7 years, 4 months ago (2013-08-20 15:51:09 UTC) #1
danakj
https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode106 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:106: m_layer->layer()->removeFromParent(); On 2013/08/20 15:51:10, junov wrote: > This line ...
7 years, 4 months ago (2013-08-20 16:57:08 UTC) #2
piman
LGTM for the mailbox logic. One comment below. https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode106 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:106: m_layer->layer()->removeFromParent(); ...
7 years, 4 months ago (2013-08-20 17:03:06 UTC) #3
Justin Novosad
On 2013/08/20 17:03:06, piman wrote: > > Could it make sense to make Canvas2DLayerBridge refcounted, ...
7 years, 4 months ago (2013-08-20 17:15:54 UTC) #4
Justin Novosad
On 2013/08/20 16:57:08, danakj wrote: > You could also set the texture mailbox on the ...
7 years, 4 months ago (2013-08-20 17:19:23 UTC) #5
Stephen White
Please try to use refcounting, as piman suggests. The ownership model gets really muddy with ...
7 years, 4 months ago (2013-08-20 17:32:18 UTC) #6
danakj
On 2013/08/20 17:19:23, junov wrote: > On 2013/08/20 16:57:08, danakj wrote: > > You could ...
7 years, 4 months ago (2013-08-20 17:33:35 UTC) #7
danakj
On 2013/08/20 17:33:35, danakj wrote: > On 2013/08/20 17:19:23, junov wrote: > > On 2013/08/20 ...
7 years, 4 months ago (2013-08-20 17:34:03 UTC) #8
jamesr
On 2013/08/20 17:03:06, piman wrote: > https://codereview.chromium.org/22929012/diff/1/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode106 > Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:106: > m_layer->layer()->removeFromParent(); > On 2013/08/20 15:51:10, ...
7 years, 4 months ago (2013-08-20 18:40:53 UTC) #9
Justin Novosad
New patch. Using RefPtr to manage destruction. Using empty mailboxes to phase-out the layer's textures.
7 years, 4 months ago (2013-08-20 21:10:25 UTC) #10
Justin Novosad
Another new patch: Fixed unit tests: Must not allocate RefCounted objects on the stack
7 years, 4 months ago (2013-08-20 21:43:19 UTC) #11
danakj
https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode266 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:266: return true; Should this be false, re piman's earlier ...
7 years, 4 months ago (2013-08-20 21:45:16 UTC) #12
danakj
https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode266 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:266: return true; On 2013/08/20 21:45:17, danakj wrote: > Should ...
7 years, 4 months ago (2013-08-20 21:46:15 UTC) #13
Justin Novosad
On 2013/08/20 21:46:15, danakj wrote: > https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp > File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): > > https://codereview.chromium.org/22929012/diff/21001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode266 > ...
7 years, 4 months ago (2013-08-20 22:07:09 UTC) #14
piman
https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode119 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:119: if (this->refCount() == m_liveMailboxCount + 1 && !m_destructionInProgress) { ...
7 years, 4 months ago (2013-08-20 22:09:00 UTC) #15
Justin Novosad
On 2013/08/20 22:09:00, piman wrote: > https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp > File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): > > https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode119 > ...
7 years, 4 months ago (2013-08-21 13:05:46 UTC) #16
Justin Novosad
Try failures prove that that there is in fact a need to handle the m_destructionInProgress ...
7 years, 4 months ago (2013-08-21 15:13:08 UTC) #17
piman
On Wed, Aug 21, 2013 at 6:05 AM, <junov@chromium.org> wrote: > On 2013/08/20 22:09:00, piman ...
7 years, 4 months ago (2013-08-21 16:20:35 UTC) #18
Stephen White
https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/1010/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode119 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:119: if (this->refCount() == m_liveMailboxCount + 1 && !m_destructionInProgress) { ...
7 years, 4 months ago (2013-08-21 17:13:29 UTC) #19
Justin Novosad
Gotcha. That sounds good.
7 years, 4 months ago (2013-08-21 17:15:22 UTC) #20
Justin Novosad
New Patch.
7 years, 4 months ago (2013-08-22 18:44:09 UTC) #21
Stephen White
https://codereview.chromium.org/22929012/diff/52001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/52001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode51 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:51: m_ptr.clear(); MicroNit: This is probably redundant, since we'll be ...
7 years, 4 months ago (2013-08-23 14:45:27 UTC) #22
Justin Novosad
On 2013/08/23 14:45:27, Stephen White wrote: > https://codereview.chromium.org/22929012/diff/52001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp > File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): > > https://codereview.chromium.org/22929012/diff/52001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode51 ...
7 years, 3 months ago (2013-08-26 20:25:28 UTC) #23
Justin Novosad
New Patch
7 years, 3 months ago (2013-08-26 20:59:25 UTC) #24
Stephen White
https://codereview.chromium.org/22929012/diff/63001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/22929012/diff/63001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode335 Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp:335: this->ref(); // Because we are adopting an already referenced ...
7 years, 3 months ago (2013-08-26 21:15:43 UTC) #25
Justin Novosad
On 2013/08/26 21:15:43, Stephen White wrote: > https://codereview.chromium.org/22929012/diff/63001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp > File Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp (right): > > https://codereview.chromium.org/22929012/diff/63001/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp#newcode335 ...
7 years, 3 months ago (2013-08-26 21:36:27 UTC) #26
Stephen White
LGTM
7 years, 3 months ago (2013-08-26 21:40:28 UTC) #27
piman
LGTM2
7 years, 3 months ago (2013-08-26 21:44:02 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/22929012/70001
7 years, 3 months ago (2013-08-26 21:46:20 UTC) #29
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=3202
7 years, 3 months ago (2013-08-27 00:43:48 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/22929012/91001
7 years, 3 months ago (2013-09-03 17:43:42 UTC) #31
commit-bot: I haz the power
7 years, 3 months ago (2013-09-03 21:36:19 UTC) #32
Message was sent while issue was closed.
Change committed as 157147

Powered by Google App Engine
This is Rietveld 408576698