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

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

Issue 1322853005: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 53ce2d7ee543787639fe8e1d0d14af7e50d20764..374a2584abbceca18fb873ccda2817d3bd3d2ecb 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -45,10 +45,17 @@ CommandBufferProxyImpl::~CommandBufferProxyImpl() {
FOR_EACH_OBSERVER(DeletionObserver,
deletion_observers_,
OnWillDeleteImpl());
- if (channel_) {
- channel_->DestroyCommandBuffer(this);
- channel_ = nullptr;
- }
+ Destroy();
+}
+
+void CommandBufferProxyImpl::Destroy() {
piman 2015/09/09 19:14:22 The lock needs to be held here. Should this CheckL
+ if (!channel_)
+ return;
+
+ channel_->DestroyCommandBuffer(this);
Ken Russell (switch to Gerrit) 2015/09/09 06:09:11 Doesn't DestroyCommandBuffer need to be called on
reveman 2015/09/09 13:45:23 Correct. ::Destroy has the same thread usage restr
+ channel_ = nullptr;
+ last_state_.error = gpu::error::kLostContext;
piman 2015/09/09 19:14:22 If we lose the context, we have to lose all contex
+ last_state_.context_lost_reason = gpu::error::kGpuChannelLost;
}
bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) {

Powered by Google App Engine
This is Rietveld 408576698