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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 const int kCompositorLockTimeoutMs = 67; | 81 const int kCompositorLockTimeoutMs = 67; |
82 | 82 |
83 } // namespace | 83 } // namespace |
84 | 84 |
85 CompositorLock::CompositorLock(RootWindow* root_window) | 85 CompositorLock::CompositorLock(RootWindow* root_window) |
86 : root_window_(root_window) { | 86 : root_window_(root_window) { |
87 MessageLoop::current()->PostDelayedTask( | 87 MessageLoop::current()->PostDelayedTask( |
88 FROM_HERE, | 88 FROM_HERE, |
89 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), | 89 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), |
90 kCompositorLockTimeoutMs); | 90 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); |
91 } | 91 } |
92 | 92 |
93 CompositorLock::~CompositorLock() { | 93 CompositorLock::~CompositorLock() { |
94 CancelLock(); | 94 CancelLock(); |
95 } | 95 } |
96 | 96 |
97 void CompositorLock::CancelLock() { | 97 void CompositorLock::CancelLock() { |
98 if (!root_window_) | 98 if (!root_window_) |
99 return; | 99 return; |
100 root_window_->UnlockCompositor(); | 100 root_window_->UnlockCompositor(); |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 void RootWindow::UnlockCompositor() { | 1031 void RootWindow::UnlockCompositor() { |
1032 DCHECK(compositor_lock_); | 1032 DCHECK(compositor_lock_); |
1033 compositor_lock_ = NULL; | 1033 compositor_lock_ = NULL; |
1034 if (draw_on_compositor_unlock_) { | 1034 if (draw_on_compositor_unlock_) { |
1035 draw_on_compositor_unlock_ = false; | 1035 draw_on_compositor_unlock_ = false; |
1036 ScheduleDraw(); | 1036 ScheduleDraw(); |
1037 } | 1037 } |
1038 } | 1038 } |
1039 | 1039 |
1040 } // namespace aura | 1040 } // namespace aura |
OLD | NEW |