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

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

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kbr's comment Created 5 years, 8 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/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 257e084645ca7261fcdf0473c28e505b49fa5fa4..8ca94b32e45f47442afd11724319713d2c91ace9 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -71,23 +71,24 @@ void CommandBufferProxyImpl::OnChannelError() {
scoped_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
- OnDestroyed(gpu::error::kUnknown);
+ OnDestroyed(gpu::error::kGpuChannelLost, gpu::error::kLostContext);
}
-void CommandBufferProxyImpl::OnDestroyed(gpu::error::ContextLostReason reason) {
+void CommandBufferProxyImpl::OnDestroyed(gpu::error::ContextLostReason reason,
+ gpu::error::Error error) {
CheckLock();
// Prevent any further messages from being sent.
channel_ = NULL;
// When the client sees that the context is lost, they should delete this
// CommandBufferProxyImpl and create a new one.
- last_state_.error = gpu::error::kLostContext;
+ last_state_.error = error;
last_state_.context_lost_reason = reason;
- if (!channel_error_callback_.is_null()) {
- channel_error_callback_.Run();
+ if (!context_lost_callback_.is_null()) {
+ context_lost_callback_.Run();
// Avoid calling the error callback more than once.
- channel_error_callback_.Reset();
+ context_lost_callback_.Reset();
}
}
@@ -134,10 +135,10 @@ void CommandBufferProxyImpl::OnSignalSyncPointAck(uint32 id) {
callback.Run();
}
-void CommandBufferProxyImpl::SetChannelErrorCallback(
+void CommandBufferProxyImpl::SetContextLostCallback(
const base::Closure& callback) {
CheckLock();
- channel_error_callback_ = callback;
+ context_lost_callback_ = callback;
}
bool CommandBufferProxyImpl::Initialize() {
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/context_provider_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698