Skip to content

Commit

Permalink
Bug 1378113 - Avoid LayerManager reentrency issues when propagating c…
Browse files Browse the repository at this point in the history
…omposite notifications. r=dvander
  • Loading branch information
nical committed Jul 19, 2017
1 parent c392c2f commit 390cb7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gfx/layers/client/ClientLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,12 @@ ClientLayerManager::DidComposite(uint64_t aTransactionId,
{
MOZ_ASSERT(mWidget);

// Notifying the observers may tick the refresh driver which can cause
// a lot of different things to happen that may affect the lifetime of
// this layer manager. So let's make sure this object stays alive until
// the end of the method invocation.
RefPtr<ClientLayerManager> selfRef = this;

// |aTransactionId| will be > 0 if the compositor is acknowledging a shadow
// layers transaction.
if (aTransactionId) {
Expand Down
6 changes: 6 additions & 0 deletions gfx/layers/wr/WebRenderLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,12 @@ WebRenderLayerManager::DidComposite(uint64_t aTransactionId,
{
MOZ_ASSERT(mWidget);

// Notifying the observers may tick the refresh driver which can cause
// a lot of different things to happen that may affect the lifetime of
// this layer manager. So let's make sure this object stays alive until
// the end of the method invocation.
RefPtr<WebRenderLayerManager> selfRef = this;

// |aTransactionId| will be > 0 if the compositor is acknowledging a shadow
// layers transaction.
if (aTransactionId) {
Expand Down

0 comments on commit 390cb7a

Please sign in to comment.