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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 383303004: Added more detailed result codes for CreateViewCommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/common/gpu/client/gpu_channel_host.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index dc1a3ce23a4af0c1583d8d9754829e4ab0970d7a..b610edc1978f4a25d318fabb657e27ffa8acb2c9 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -142,20 +142,25 @@ CommandBufferProxyImpl* GpuChannelHost::CreateViewCommandBuffer(
init_params.active_url = active_url;
init_params.gpu_preference = gpu_preference;
int32 route_id = GenerateRouteID();
- if (!factory_->CreateViewCommandBuffer(surface_id, init_params, route_id)) {
+ CreateCommandBufferResult result = factory_->CreateViewCommandBuffer(
+ surface_id, init_params, route_id);
+ if (result != CREATE_CMDBUF_SUCCEEDED) {
LOG(ERROR) << "GpuChannelHost::CreateViewCommandBuffer failed.";
- // The most likely reason CreateViewCommandBuffer will fail is
- // that the GPU process crashed. In this case the GPU channel
- // needs to be considered lost. The caller will then set up a new
- // connection, and the GPU channel and any view command buffers
- // will all be associated with the same GPU process.
- DCHECK(MessageLoopProxy::current().get());
-
- scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
- io_loop->PostTask(FROM_HERE,
- base::Bind(&GpuChannelHost::MessageFilter::OnChannelError,
- channel_filter_.get()));
+ if (result == CREATE_CMDBUF_FAILED_AND_CHANNEL_LOST) {
+ // The GPU channel needs to be considered lost. The caller will
+ // then set up a new connection, and the GPU channel and any
+ // view command buffers will all be associated with the same GPU
+ // process.
+ DCHECK(MessageLoopProxy::current().get());
+
+ scoped_refptr<base::MessageLoopProxy> io_loop =
+ factory_->GetIOLoopProxy();
+ io_loop->PostTask(
+ FROM_HERE,
+ base::Bind(&GpuChannelHost::MessageFilter::OnChannelError,
+ channel_filter_.get()));
+ }
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698