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

Side by Side Diff: ui/compositor/compositor.cc

Issue 1081223002: Use MessageLoop for CompositorTest.LocksTimeOut (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@impl
Patch Set: move constant to header Created 5 years, 8 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 unified diff | Download patch
OLDNEW
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/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 #include "ui/compositor/layer_animator_collection.h" 33 #include "ui/compositor/layer_animator_collection.h"
34 #include "ui/gfx/frame_time.h" 34 #include "ui/gfx/frame_time.h"
35 #include "ui/gl/gl_context.h" 35 #include "ui/gl/gl_context.h"
36 #include "ui/gl/gl_switches.h" 36 #include "ui/gl/gl_switches.h"
37 37
38 namespace { 38 namespace {
39 39
40 const double kDefaultRefreshRate = 60.0; 40 const double kDefaultRefreshRate = 60.0;
41 const double kTestRefreshRate = 200.0; 41 const double kTestRefreshRate = 200.0;
42 42
43 const int kCompositorLockTimeoutMs = 67;
44
45 } // namespace 43 } // namespace
46 44
47 namespace ui { 45 namespace ui {
48 46
49 CompositorLock::CompositorLock(Compositor* compositor) 47 CompositorLock::CompositorLock(Compositor* compositor)
50 : compositor_(compositor) { 48 : compositor_(compositor) {
51 if (compositor_->locks_will_time_out_) { 49 if (compositor_->locks_will_time_out_) {
52 compositor_->task_runner_->PostDelayedTask( 50 compositor_->task_runner_->PostDelayedTask(
53 FROM_HERE, 51 FROM_HERE,
54 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), 52 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()),
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 observer_list_, 417 observer_list_,
420 OnCompositingLockStateChanged(this)); 418 OnCompositingLockStateChanged(this));
421 } 419 }
422 420
423 void Compositor::CancelCompositorLock() { 421 void Compositor::CancelCompositorLock() {
424 if (compositor_lock_) 422 if (compositor_lock_)
425 compositor_lock_->CancelLock(); 423 compositor_lock_->CancelLock();
426 } 424 }
427 425
428 } // namespace ui 426 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698