Commit Graph

4 Commits

Author SHA1 Message Date
Ryan Hunt
be6483bb76 Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond)
This changes the lifecycle and API for TextureReadLock to fix file descriptor exhaustion
crashes. These changes are partially superficial and mostly align the API of TextureReadLocks
with their actual usage.

The changes are:

1. Create the TextureReadLock in the TextureClient constructor so it's available before IPC creation
    a. This is superficial as EnableReadLock was always called before IPC creation
2. Send the ReadLockDescriptor in the PTextureConstructor message and close the file handle
3. Receive the ReadLockDescriptor in TextureHost and close the file handle
4. Send a boolean flag in layer transactions if the texture is read locked instead of a descriptor
5. Use a boolean flag in TextureHost to determine if the ReadLock must be unlocked instead of a nullptr

I believe that we can remove the InitReadLocks code from LayerTransaction as that was added to
prevent file descriptor limits in IPDL messages and is no longer needed with this change. But
that is a non-essential change and this patch is already big enough.

MozReview-Commit-ID: DzHujrOQejH
2018-03-12 08:10:13 -05:00
Matt Woodrow
7aec0e6f43 Bug 1341496 - Part 3: Make CrossProcessSemaphore allocation fallible. r=billm 2017-04-19 15:39:11 +12:00
Jeff Walden
a634aa1851 Bug 1287006 - Final bustage followup. r=bustage in a still-CLOSED TREE 2017-02-22 20:46:46 -08:00
Matt Woodrow
ee75ec29f4 Bug 1325227 - Part 8: Add CrossProcessSemaphore. r=billm 2017-02-14 21:10:35 +13:00