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

Unified Diff: ui/aura/desktop.cc

Issue 8805033: Makes tests either use mock compositor or mock WebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years 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
Index: ui/aura/desktop.cc
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 38818e69f46b9ae7776eb9f29d2b8a256da85d82..c3256f69738e816486d21ca6beb9e494b71efe79 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -415,23 +415,21 @@ Desktop::Desktop()
host_->SetDesktop(this);
last_mouse_location_ = host_->QueryMouseLocation();
- if (ui::Compositor::compositor_factory()) {
- compositor_ = (*ui::Compositor::compositor_factory())(this);
- } else {
#ifdef USE_WEBKIT_COMPOSITOR
- ui::CompositorCC::Initialize(false);
+ ui::CompositorCC::Initialize(false);
#endif
- compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(),
- host_->GetSize());
- }
+ compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(),
+ host_->GetSize());
DCHECK(compositor_.get());
}
Desktop::~Desktop() {
in_destructor_ = true;
+ // Make sure to NULL out the compositor before terminating so that state is
+ // cleared and we don't hit asserts.
+ compositor_ = NULL;
#ifdef USE_WEBKIT_COMPOSITOR
- if (!ui::Compositor::compositor_factory())
- ui::CompositorCC::Terminate();
+ ui::CompositorCC::Terminate();
#endif
if (instance_ == this)
instance_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698