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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.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: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 7a3f339affb5f9a4bfbca5c99731a70f8887da40..2e274e31b34846f65dfd94d31e7927c69bec45bd 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -251,6 +251,9 @@ BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() {
DCHECK(IsMainThread());
+ DCHECK(!in_shutdown_);
+
+ in_shutdown_ = true;
if (pending_request_.get())
pending_request_->Cancel();
for (size_t n = 0; n < established_callbacks_.size(); n++)
@@ -282,6 +285,11 @@ BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) {
void BrowserGpuChannelHostFactory::EstablishGpuChannel(
const gpu::GpuChannelEstablishedCallback& callback) {
DCHECK(!service_manager::ServiceManagerIsRemote());
+
+ // Don't queue any more requests if the factory is shutting down.
+ if (in_shutdown_)
boliu 2017/02/10 22:23:02 Hmm, I guess this is ok. But how hard is it to jus
Khushal 2017/02/10 22:42:39 Another thought was to set |instance_| to null in
boliu 2017/02/10 22:45:18 I'm actually worried about accidental infinite loo
Khushal 2017/02/10 22:51:30 Maye be we should always post to the message loop
boliu 2017/02/10 23:05:22 All depends on what happens in those callbacks tod
Khushal 2017/02/10 23:24:30 I had actually looked around when thinking about p
Khushal 2017/02/11 02:10:22 So I think the simplest solution would be to just
Khushal 2017/02/13 21:07:13 Done.
+ return;
+
if (gpu_channel_.get() && gpu_channel_->IsLost()) {
DCHECK(!pending_request_.get());
// Recreate the channel if it has been lost.

Powered by Google App Engine
This is Rietveld 408576698