OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 static_cast<Window*>(consumer) : NULL; | 83 static_cast<Window*>(consumer) : NULL; |
84 } | 84 } |
85 | 85 |
86 } // namespace | 86 } // namespace |
87 | 87 |
88 CompositorLock::CompositorLock(RootWindow* root_window) | 88 CompositorLock::CompositorLock(RootWindow* root_window) |
89 : root_window_(root_window) { | 89 : root_window_(root_window) { |
90 MessageLoop::current()->PostDelayedTask( | 90 MessageLoop::current()->PostDelayedTask( |
91 FROM_HERE, | 91 FROM_HERE, |
92 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), | 92 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), |
93 kCompositorLockTimeoutMs); | 93 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); |
94 } | 94 } |
95 | 95 |
96 CompositorLock::~CompositorLock() { | 96 CompositorLock::~CompositorLock() { |
97 CancelLock(); | 97 CancelLock(); |
98 } | 98 } |
99 | 99 |
100 void CompositorLock::CancelLock() { | 100 void CompositorLock::CancelLock() { |
101 if (!root_window_) | 101 if (!root_window_) |
102 return; | 102 return; |
103 root_window_->UnlockCompositor(); | 103 root_window_->UnlockCompositor(); |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 void RootWindow::UnlockCompositor() { | 1029 void RootWindow::UnlockCompositor() { |
1030 DCHECK(compositor_lock_); | 1030 DCHECK(compositor_lock_); |
1031 compositor_lock_ = NULL; | 1031 compositor_lock_ = NULL; |
1032 if (draw_on_compositor_unlock_) { | 1032 if (draw_on_compositor_unlock_) { |
1033 draw_on_compositor_unlock_ = false; | 1033 draw_on_compositor_unlock_ = false; |
1034 ScheduleDraw(); | 1034 ScheduleDraw(); |
1035 } | 1035 } |
1036 } | 1036 } |
1037 | 1037 |
1038 } // namespace aura | 1038 } // namespace aura |
OLD | NEW |