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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 10834165: Don't reuse a GpuProcessHost that failed to send a message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add parens to silence clang Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 51be97fa5099958aedd793cdf591366889167418..7a13cbf3d6e7274f0aa81c4c2d65bbf64fe10daa 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -240,8 +240,9 @@ bool GpuProcessHost::HostIsValid(GpuProcessHost* host) {
// blacklisted, and we can kill it and start over.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU) ||
- host->software_rendering() ||
- !GpuDataManagerImpl::GetInstance()->ShouldUseSoftwareRendering()) {
+ (host->valid_ &&
+ (host->software_rendering() ||
+ !GpuDataManagerImpl::GetInstance()->ShouldUseSoftwareRendering()))) {
return true;
}
@@ -307,6 +308,7 @@ GpuProcessHost* GpuProcessHost::FromID(int host_id) {
GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
: host_id_(host_id),
+ valid_(true),
in_process_(false),
software_rendering_(false),
kind_(kind),
@@ -443,7 +445,10 @@ bool GpuProcessHost::Send(IPC::Message* msg) {
return true;
}
- return process_->Send(msg);
+ bool result = process_->Send(msg);
+ if (!result)
+ valid_ = false;
+ return result;
}
bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698