DescriptionReland r206537 - cc: Don't return mailboxes if the TextureLayer is removed from the tree.
When the TextureLayer is removed from the tree, the TextureLayerImpl is
destroyed, so it will return the mailbox to the main thread. Prior to this patch
we would return the mailbox to the client. When re-attaching the TextureLayer,
we would then not push the mailbox to the new TextureLayerImpl, and stop drawing
the layer.
Instead, keep the mailbox on the TextureLayer. If the TextureLayer is re-attached to the tree, we
push the mailbox again (which is ok to do now).
Only after the impl side has returned the mailbox *and* the mailbox is replaced
on the TextureLayer (or it is destroyed), will we call the callback.
To do that we add a refcounted MailboxHolder whose job is to call the callback
when it's destroyed. It's referenced by the TextureLayer itself, while being the
current mailbox, and the closures we give to the impl thread.
BUG=249535
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=207081
Patch Set 1 #Patch Set 2 : Fix threading issues #
Total comments: 4
Patch Set 3 : Safer semantics #
Total comments: 8
Patch Set 4 : nits #
Messages
Total messages: 8 (0 generated)
|