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

Side by Side Diff: content/browser/renderer_host/context_provider_factory_impl_android.cc

Issue 2233023003: content: Don't keep requesting the GpuChannelHost during shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer stop Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" 5 #include "content/browser/renderer_host/context_provider_factory_impl_android.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 FROM_HERE, base::TimeDelta::FromSeconds(kGpuChannelTimeoutInSeconds), 228 FROM_HERE, base::TimeDelta::FromSeconds(kGpuChannelTimeoutInSeconds),
229 this, &ContextProviderFactoryImpl::OnGpuChannelTimeout); 229 this, &ContextProviderFactoryImpl::OnGpuChannelTimeout);
230 230
231 return nullptr; 231 return nullptr;
232 } 232 }
233 233
234 void ContextProviderFactoryImpl::OnGpuChannelEstablished( 234 void ContextProviderFactoryImpl::OnGpuChannelEstablished(
235 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { 235 scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
236 establish_gpu_channel_timeout_.Stop(); 236 establish_gpu_channel_timeout_.Stop();
237 237
238 // This should happen only during shutdown. So early out instead of queuing
239 // more requests with the factory.
240 if (!gpu_channel)
241 return;
242
238 // We can queue the Gpu Channel initialization requests multiple times as 243 // We can queue the Gpu Channel initialization requests multiple times as
239 // we get context requests. So we might have already handled any pending 244 // we get context requests. So we might have already handled any pending
240 // requests when this callback runs. 245 // requests when this callback runs.
241 if (!context_provider_requests_.empty()) 246 if (!context_provider_requests_.empty())
242 HandlePendingRequests(); 247 HandlePendingRequests();
243 } 248 }
244 249
245 void ContextProviderFactoryImpl::OnGpuChannelTimeout() { 250 void ContextProviderFactoryImpl::OnGpuChannelTimeout() {
246 LOG(FATAL) << "Timed out waiting for GPU channel."; 251 LOG(FATAL) << "Timed out waiting for GPU channel.";
247 } 252 }
248 253
249 } // namespace content 254 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698