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

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

Issue 2083853002: exo: Recreate Surface resources on context lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix browser test Created 4 years, 6 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 bool IsRunningInMojoShell(base::CommandLine* command_line) { 48 bool IsRunningInMojoShell(base::CommandLine* command_line) {
49 const char kMojoShellFlag[] = "mojo-platform-channel-handle"; 49 const char kMojoShellFlag[] = "mojo-platform-channel-handle";
50 return command_line->HasSwitch(kMojoShellFlag); 50 return command_line->HasSwitch(kMojoShellFlag);
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 namespace ui { 55 namespace ui {
56 56
57 ContextFactory::~ContextFactory() {}
58
59 void ContextFactory::AddObserver(ContextFactoryObserver* observer) {
60 observer_list_.AddObserver(observer);
61 }
62
63 void ContextFactory::RemoveObserver(ContextFactoryObserver* observer) {
64 observer_list_.RemoveObserver(observer);
65 }
66
67 ContextFactory::ContextFactory() {}
68
57 CompositorLock::CompositorLock(Compositor* compositor) 69 CompositorLock::CompositorLock(Compositor* compositor)
58 : compositor_(compositor) { 70 : compositor_(compositor) {
59 if (compositor_->locks_will_time_out_) { 71 if (compositor_->locks_will_time_out_) {
60 compositor_->task_runner_->PostDelayedTask( 72 compositor_->task_runner_->PostDelayedTask(
61 FROM_HERE, 73 FROM_HERE,
62 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), 74 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()),
63 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); 75 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs));
64 } 76 }
65 } 77 }
66 78
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 observer_list_, 510 observer_list_,
499 OnCompositingLockStateChanged(this)); 511 OnCompositingLockStateChanged(this));
500 } 512 }
501 513
502 void Compositor::CancelCompositorLock() { 514 void Compositor::CancelCompositorLock() {
503 if (compositor_lock_) 515 if (compositor_lock_)
504 compositor_lock_->CancelLock(); 516 compositor_lock_->CancelLock();
505 } 517 }
506 518
507 } // namespace ui 519 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698