OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/compositor/compositor_lock.h" |
| 6 |
| 7 namespace ui { |
| 8 |
| 9 CompositorLock::CompositorLock(CompositorLockClient* client, |
| 10 base::WeakPtr<CompositorLockDelegate> delegate) |
| 11 : client_(client), delegate_(std::move(delegate)) {} |
| 12 |
| 13 CompositorLock::~CompositorLock() { |
| 14 if (delegate_) |
| 15 delegate_->RemoveCompositorLock(this); |
| 16 } |
| 17 |
| 18 void CompositorLock::TimeoutLock() { |
| 19 delegate_->RemoveCompositorLock(this); |
| 20 delegate_ = nullptr; |
| 21 if (client_) |
| 22 client_->CompositorLockTimedOut(); |
| 23 } |
| 24 |
| 25 } // namespace ui |
OLD | NEW |