Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1531)

Unified Diff: ui/compositor/compositor_lock.cc

Issue 2773433003: Fix CompositorResizeLock to do something. (Closed)
Patch Set: resizelock: observer-rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/compositor_lock.h ('k') | ui/compositor/compositor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor_lock.cc
diff --git a/ui/compositor/compositor_lock.cc b/ui/compositor/compositor_lock.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8b001debe0083b618ade99dfc997977301a07748
--- /dev/null
+++ b/ui/compositor/compositor_lock.cc
@@ -0,0 +1,25 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/compositor_lock.h"
+
+namespace ui {
+
+CompositorLock::CompositorLock(CompositorLockClient* client,
+ base::WeakPtr<CompositorLockDelegate> delegate)
+ : client_(client), delegate_(std::move(delegate)) {}
+
+CompositorLock::~CompositorLock() {
+ if (delegate_)
+ delegate_->RemoveCompositorLock(this);
+}
+
+void CompositorLock::TimeoutLock() {
+ delegate_->RemoveCompositorLock(this);
+ delegate_ = nullptr;
+ if (client_)
+ client_->CompositorLockTimedOut();
+}
+
+} // namespace ui
« no previous file with comments | « ui/compositor/compositor_lock.h ('k') | ui/compositor/compositor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698