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

Unified Diff: content/browser/renderer_host/gpu_message_filter.cc

Issue 270633008: Check for a restarted GPU process in OnCreateViewCommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/renderer_host/gpu_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/gpu_message_filter.cc
diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc
index 856d14b9ecc83e356a5f25098b7ec166d97e7ddd..9a3bf2558b10edf5515557ce3c8848b1f51c158a 100644
--- a/content/browser/renderer_host/gpu_message_filter.cc
+++ b/content/browser/renderer_host/gpu_message_filter.cc
@@ -103,6 +103,25 @@ void GpuMessageFilter::EndFrameSubscription(int route_id) {
}
}
+GpuProcessHost* GpuMessageFilter::GetGpuProcessHost(
+ CauseForGpuLaunch cause_for_gpu_launch) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_);
+ if (!host) {
+ host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
+ cause_for_gpu_launch);
+ if (!host) {
+ return NULL;
+ }
+
+ gpu_process_id_ = host->host_id();
+
+ // Apply all frame subscriptions to the new GpuProcessHost.
+ BeginAllFrameSubscriptions();
+ }
+
+ return host;
+}
+
void GpuMessageFilter::OnEstablishGpuChannel(
CauseForGpuLaunch cause_for_gpu_launch,
IPC::Message* reply_ptr) {
@@ -116,20 +135,11 @@ void GpuMessageFilter::OnEstablishGpuChannel(
// terminates, the renderer process will not find itself unknowingly sending
// IPCs to a newly launched GPU process. Also, I will rename this function
// to something like OnCreateGpuProcess.
- GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_);
+ GpuProcessHost* host = GetGpuProcessHost(cause_for_gpu_launch);
if (!host) {
- host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
- cause_for_gpu_launch);
- if (!host) {
- reply->set_reply_error();
- Send(reply.release());
- return;
- }
-
- gpu_process_id_ = host->host_id();
-
- // Apply all frame subscriptions to the new GpuProcessHost.
- BeginAllFrameSubscriptions();
+ reply->set_reply_error();
+ Send(reply.release());
+ return;
}
bool share_contexts = true;
@@ -169,7 +179,9 @@ void GpuMessageFilter::OnCreateViewCommandBuffer(
compositing_surface = gfx::GLSurfaceHandle();
}
- GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_);
+ GpuProcessHost* host = GetGpuProcessHost(
+ // This is currently the only creator of a view command buffer.
+ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE);
piman 2014/05/08 03:29:21 So, relaunching the GPU process is not actually go
Ken Russell (switch to Gerrit) 2014/05/09 01:36:13 Thanks for the feedback. I'll redo this as a check
if (!host || compositing_surface.is_null()) {
// TODO(apatrick): Eventually, this IPC message will be routed to a
// GpuProcessStub with a particular routing ID. The error will be set if
« no previous file with comments | « content/browser/renderer_host/gpu_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698