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

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

Issue 1128233004: Fix GpuChannelHost destruction and races (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: content/common/gpu/client/gpu_channel_host.h
diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h
index fbff47b5b9c2f6a58d74fbd8628703bd55742019..b692ec18254b79a114efaadb30366e0519ef92b5 100644
--- a/content/common/gpu/client/gpu_channel_host.h
+++ b/content/common/gpu/client/gpu_channel_host.h
@@ -151,7 +151,8 @@ class GpuChannelHost : public IPC::Sender,
// Destroy a command buffer created by this channel.
void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer);
- // Destroy this channel.
+ // Destroy this channel. Must be called on the main thread, before
+ // destruction.
void DestroyChannel();
// Add a route for the current message loop.
@@ -246,7 +247,6 @@ class GpuChannelHost : public IPC::Sender,
const gpu::GPUInfo gpu_info_;
- scoped_ptr<IPC::SyncChannel> channel_;
scoped_refptr<MessageFilter> channel_filter_;
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
@@ -263,8 +263,9 @@ class GpuChannelHost : public IPC::Sender,
// Route IDs are allocated in sequence.
base::AtomicSequenceNumber next_route_id_;
- // Protects proxies_.
+ // Protects channel_ and proxies_.
mutable base::Lock context_lock_;
+ scoped_ptr<IPC::SyncChannel> channel_;
// Used to look up a proxy from its routing id.
typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap;
ProxyMap proxies_;
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698