Descriptioncc: Drop ContextProvider references on the impl thread before quitting
When passing a TextureMailbox from the impl thread out to the cc
embedder on the main thread, we need to keep a ref on the ContextProvider
that owns the texture in the mailbox, to keep the mailbox alive while
the embedder is receiving it.
However if the compositor shutsdown and the impl thread goes away, we
must have already dropped the ref on the ContextProvider or it will be
destroyed (a) on the wrong thread and (b) after the global GPU process
objects it holds pointers to have been destroyed. Crash will occur.
So, we add a TextureMailboxDeleter class that the GLRenderer uses to
generate a TextureMailbox release callback for the main thread instead
of rolling its own thing. The TMDeleter class' lifetime is bounded by
the life of the compositor instance on the impl thread, so it is
destroyed before the impl thread is joined. And when it is destroyed it
deletes the textures it was meant to destroy, and drops its ref on the
context provider.
BUG=283625
R=piman
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=222207
Patch Set 1 #Patch Set 2 : callbackcontrolcenter: Add test #Patch Set 3 : callbackcontrolcenter: Add another test #Patch Set 4 : callbackcontrolcenter: rebase #Patch Set 5 : callbackcontrolcenter: rebase #
Messages
Total messages: 11 (0 generated)
|