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

Unified Diff: content/browser/aura/gpu_process_transport_factory.cc

Issue 21052007: aura: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: All work maybe? Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/aura/gpu_process_transport_factory.cc
diff --git a/content/browser/aura/gpu_process_transport_factory.cc b/content/browser/aura/gpu_process_transport_factory.cc
index 6ac45f7665d22277ed3448c62c0fc14a1b32f9dc..23834855c799e23d9a76494a9faad35efd1fd6d2 100644
--- a/content/browser/aura/gpu_process_transport_factory.cc
+++ b/content/browser/aura/gpu_process_transport_factory.cc
@@ -319,6 +319,8 @@ void GpuProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) {
gl_helper_.reset();
}
+bool GpuProcessTransportFactory::UsesTestContexts() { return false; }
+
ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() {
return this;
}
@@ -405,14 +407,15 @@ GpuProcessTransportFactory::OffscreenContextProviderForMainThread() {
base::Bind(&GpuProcessTransportFactory::
CreateOffscreenCommandBufferContext,
base::Unretained(this)));
- shared_contexts_main_thread_->SetLostContextCallback(base::Bind(
- &GpuProcessTransportFactory::
- OnLostMainThreadSharedContextInsideCallback,
- callback_factory_.GetWeakPtr()));
-
- if (shared_contexts_main_thread_.get() &&
- !shared_contexts_main_thread_->BindToCurrentThread())
- shared_contexts_main_thread_ = NULL;
+ if (shared_contexts_main_thread_) {
+ shared_contexts_main_thread_->SetLostContextCallback(base::Bind(
+ &GpuProcessTransportFactory::
+ OnLostMainThreadSharedContextInsideCallback,
+ callback_factory_.GetWeakPtr()));
+
+ if (!shared_contexts_main_thread_->BindToCurrentThread())
+ shared_contexts_main_thread_ = NULL;
+ }
}
return shared_contexts_main_thread_;
}

Powered by Google App Engine
This is Rietveld 408576698