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

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

Issue 25367003: aura: Attach lost context callback to the shared main thread context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 7 years, 2 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
« no previous file with comments | « no previous file | content/browser/aura/image_transport_factory_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9080f03efafec531bda87582a838b5e27f0066a..2d09b244e8be30767ee4279cb2c42a5196b03c69 100644
--- a/content/browser/aura/gpu_process_transport_factory.cc
+++ b/content/browser/aura/gpu_process_transport_factory.cc
@@ -407,16 +407,6 @@ GpuProcessTransportFactory::OffscreenCompositorContextProvider() {
GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(),
"Compositor-Offscreen");
- if (!offscreen_compositor_contexts_.get())
- return NULL;
-
- if (!ui::Compositor::WasInitializedWithThread()) {
- offscreen_compositor_contexts_->SetLostContextCallback(base::Bind(
- &GpuProcessTransportFactory::
- OnLostMainThreadSharedContextInsideCallback,
- callback_factory_.GetWeakPtr()));
- }
-
return offscreen_compositor_contexts_;
}
@@ -440,9 +430,14 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
OffscreenCompositorContextProvider().get());
}
- if (shared_main_thread_contexts_ &&
- !shared_main_thread_contexts_->BindToCurrentThread())
- shared_main_thread_contexts_ = NULL;
+ if (shared_main_thread_contexts_) {
+ shared_main_thread_contexts_->SetLostContextCallback(
+ base::Bind(&GpuProcessTransportFactory::
+ OnLostMainThreadSharedContextInsideCallback,
+ callback_factory_.GetWeakPtr()));
+ if (!shared_main_thread_contexts_->BindToCurrentThread())
+ shared_main_thread_contexts_ = NULL;
+ }
return shared_main_thread_contexts_;
}
« no previous file with comments | « no previous file | content/browser/aura/image_transport_factory_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698