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

Unified Diff: services/ui/public/cpp/gpu/gpu.cc

Issue 2686243002: content/ui[Android]: Remove ContextProviderFactory. (Closed)
Patch Set: .. Created 3 years, 10 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: services/ui/public/cpp/gpu/gpu.cc
diff --git a/services/ui/public/cpp/gpu/gpu.cc b/services/ui/public/cpp/gpu/gpu.cc
index 06238988ac9cfa9d4b02527955740b3cf5a3a21e..8634525475b22fab3be96ca8a462df75e081168d 100644
--- a/services/ui/public/cpp/gpu/gpu.cc
+++ b/services/ui/public/cpp/gpu/gpu.cc
@@ -46,6 +46,9 @@ Gpu::Gpu(service_manager::Connector* connector,
Gpu::~Gpu() {
DCHECK(IsMainThread());
+ DCHECK(!in_shutdown_);
+
+ in_shutdown_ = true;
for (const auto& callback : establish_callbacks_)
callback.Run(nullptr);
shutdown_event_.Signal();
@@ -90,6 +93,10 @@ scoped_refptr<cc::ContextProvider> Gpu::CreateContextProvider(
void Gpu::EstablishGpuChannel(
const gpu::GpuChannelEstablishedCallback& callback) {
DCHECK(IsMainThread());
+
+ if (in_shutdown_)
+ return;
+
scoped_refptr<gpu::GpuChannelHost> channel = GetGpuChannel();
if (channel) {
main_task_runner_->PostTask(FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698