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

Unified Diff: ppapi/proxy/ppapi_command_buffer_proxy.h

Issue 547733002: [Pepper GL] Use shared state to fix a memory leak in MapSub GL extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remve base/memory/shared_memory.h from DEPS Created 6 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
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppapi_command_buffer_proxy.h
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h
index 45daf2f281ef7da825852b24333124e6a1ee62d8..115baf716eaca08cc5dd0b20185a40dc1da0138f 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -7,8 +7,10 @@
#include "base/callback.h"
#include "base/containers/hash_tables.h"
+#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/common/command_buffer.h"
+#include "gpu/command_buffer/common/command_buffer_shared.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/host_resource.h"
@@ -20,12 +22,14 @@ namespace ppapi {
namespace proxy {
class ProxyChannel;
+class SerializedHandle;
class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer,
public gpu::GpuControl {
public:
PpapiCommandBufferProxy(const HostResource& resource,
- ProxyChannel* channel);
+ ProxyChannel* channel,
+ const SerializedHandle& shared_state);
virtual ~PpapiCommandBufferProxy();
// gpu::CommandBuffer implementation:
@@ -63,7 +67,14 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer,
bool Send(IPC::Message* msg);
void UpdateState(const gpu::CommandBuffer::State& state, bool success);
+ // Try to read an updated copy of the state from shared memory.
+ void TryUpdateState();
+
+ // The shared memory area used to update state.
+ gpu::CommandBufferSharedState* shared_state() const;
+
State last_state_;
+ scoped_ptr<base::SharedMemory> shared_state_shm_;
HostResource resource_;
ProxyChannel* channel_;
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698