diff options
Diffstat (limited to 'ui/surface/transport_dib_linux.cc')
-rw-r--r-- | ui/surface/transport_dib_linux.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/surface/transport_dib_linux.cc b/ui/surface/transport_dib_linux.cc index b1a5469..7763c0e 100644 --- a/ui/surface/transport_dib_linux.cc +++ b/ui/surface/transport_dib_linux.cc @@ -22,6 +22,8 @@ TransportDIB::TransportDIB() : address_(kInvalidAddress), x_shm_(0), display_(NULL), + inflight_counter_(0), + detached_(false), size_(0) { } @@ -138,3 +140,17 @@ XID TransportDIB::MapToX(Display* display) { return x_shm_; } + +void TransportDIB::DecreaseInFlightCounter() { + CHECK(inflight_counter_); + inflight_counter_--; + if (!inflight_counter_ && detached_) + delete this; +} + +void TransportDIB::Detach() { + CHECK(!detached_); + detached_ = true; + if (!inflight_counter_) + delete this; +} |