summaryrefslogtreecommitdiffstats
path: root/ui/surface/transport_dib.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/surface/transport_dib.h')
-rw-r--r--ui/surface/transport_dib.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/surface/transport_dib.h b/ui/surface/transport_dib.h
index 3495c9d..70928ed 100644
--- a/ui/surface/transport_dib.h
+++ b/ui/surface/transport_dib.h
@@ -194,6 +194,15 @@ class SURFACE_EXPORT TransportDIB {
// Map the shared memory into the X server and return an id for the shared
// segment.
XID MapToX(Display* connection);
+
+ void IncreaseInFlightCounter() { inflight_counter_++; }
+ // Decreases the inflight counter, and deletes the transport DIB if it is
+ // detached.
+ void DecreaseInFlightCounter();
+
+ // Deletes this transport DIB and detaches the shared memory once the
+ // |inflight_counter_| is zero.
+ void Detach();
#endif
private:
@@ -207,6 +216,8 @@ class SURFACE_EXPORT TransportDIB {
void* address_; // mapped address
XSharedMemoryId x_shm_; // X id for the shared segment
Display* display_; // connection to the X server
+ size_t inflight_counter_; // How many requests to the X server are in flight
+ bool detached_; // If true, delete the transport DIB when it is idle
#endif
size_t size_; // length, in bytes