summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-04 00:26:19 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-04 00:26:19 +0000
commit840a1d1a56005c26f82acb78c04bc27c7cc515c4 (patch)
tree1c3b42f4f2fb9565b45b7a33c9382f2913ad5ff4 /content
parent84dc19518f664bfd73575af6f8569c3f6aac234b (diff)
downloadchromium_src-840a1d1a56005c26f82acb78c04bc27c7cc515c4.zip
chromium_src-840a1d1a56005c26f82acb78c04bc27c7cc515c4.tar.gz
chromium_src-840a1d1a56005c26f82acb78c04bc27c7cc515c4.tar.bz2
Don't reuse a GpuProcessHost that failed to send a message
When the GPU process dies/gets killed, the Send() can fail (e.g. EPIPE), triggering lost context recreation, before OnChannelError gets called (happening when we return to the message loop) which ends up deleting the GpuProcessHost. So, in the mean time, make sure we don't try to reuse that GpuProcessHost to recreate a channel. BUG=129067 Review URL: https://chromiumcodereview.appspot.com/10834165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu/gpu_process_host.cc11
-rw-r--r--content/browser/gpu/gpu_process_host.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 51be97f..7a13cbf 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) {
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index be82a75..761c057 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -171,6 +171,9 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
// Qeueud messages to send when the process launches.
std::queue<IPC::Message*> queued_messages_;
+ // Whether the GPU process is valid, set to false after Send() failed.
+ bool valid_;
+
// Whether we are running a GPU thread inside the browser process instead
// of a separate GPU process.
bool in_process_;