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

Side by Side Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 277113002: Fixed flakiness of context_lost tests on GPU bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed more review feedback from creis. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/gpu/client/gpu_channel_host.h" 5 #include "content/common/gpu/client/gpu_channel_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 GPUCreateCommandBufferConfig init_params; 138 GPUCreateCommandBufferConfig init_params;
139 init_params.share_group_id = 139 init_params.share_group_id =
140 share_group ? share_group->GetRouteID() : MSG_ROUTING_NONE; 140 share_group ? share_group->GetRouteID() : MSG_ROUTING_NONE;
141 init_params.attribs = attribs; 141 init_params.attribs = attribs;
142 init_params.active_url = active_url; 142 init_params.active_url = active_url;
143 init_params.gpu_preference = gpu_preference; 143 init_params.gpu_preference = gpu_preference;
144 int32 route_id = GenerateRouteID(); 144 int32 route_id = GenerateRouteID();
145 if (!factory_->CreateViewCommandBuffer(surface_id, init_params, route_id)) { 145 if (!factory_->CreateViewCommandBuffer(surface_id, init_params, route_id)) {
146 LOG(ERROR) << "GpuChannelHost::CreateViewCommandBuffer failed."; 146 LOG(ERROR) << "GpuChannelHost::CreateViewCommandBuffer failed.";
147
148 // The most likely reason CreateViewCommandBuffer will fail is
149 // that the GPU process crashed. In this case the GPU channel
150 // needs to be considered lost. The caller will then set up a new
151 // connection, and the GPU channel and any view command buffers
152 // will all be associated with the same GPU process.
153 DCHECK(MessageLoopProxy::current().get());
154
155 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
156 io_loop->PostTask(FROM_HERE,
157 base::Bind(&GpuChannelHost::MessageFilter::OnChannelError,
158 channel_filter_.get()));
159
147 return NULL; 160 return NULL;
148 } 161 }
149 162
150 CommandBufferProxyImpl* command_buffer = 163 CommandBufferProxyImpl* command_buffer =
151 new CommandBufferProxyImpl(this, route_id); 164 new CommandBufferProxyImpl(this, route_id);
152 AddRoute(route_id, command_buffer->AsWeakPtr()); 165 AddRoute(route_id, command_buffer->AsWeakPtr());
153 166
154 AutoLock lock(context_lock_); 167 AutoLock lock(context_lock_);
155 proxies_[route_id] = command_buffer; 168 proxies_[route_id] = command_buffer;
156 return command_buffer; 169 return command_buffer;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 390
378 listeners_.clear(); 391 listeners_.clear();
379 } 392 }
380 393
381 bool GpuChannelHost::MessageFilter::IsLost() const { 394 bool GpuChannelHost::MessageFilter::IsLost() const {
382 AutoLock lock(lock_); 395 AutoLock lock(lock_);
383 return lost_; 396 return lost_;
384 } 397 }
385 398
386 } // namespace content 399 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698