Index: content/common/gpu/client/context_provider_command_buffer.h |
diff --git a/content/common/gpu/client/context_provider_command_buffer.h b/content/common/gpu/client/context_provider_command_buffer.h |
index dc490a304cc292ea6db7c6791830432481f5f284..216f9ac9b7f6967191db3ecdae642988b0e3ecda 100644 |
--- a/content/common/gpu/client/context_provider_command_buffer.h |
+++ b/content/common/gpu/client/context_provider_command_buffer.h |
@@ -8,6 +8,7 @@ |
#include <stdint.h> |
#include <memory> |
+#include <vector> |
#include "base/compiler_specific.h" |
#include "base/synchronization/lock.h" |
@@ -40,6 +41,7 @@ class CONTENT_EXPORT ContextProviderCommandBuffer |
ContextProviderCommandBuffer( |
std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
const gpu::SharedMemoryLimits& memory_limits, |
+ ContextProviderCommandBuffer* shared_context_provider, |
CommandBufferContextType type); |
gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
@@ -67,9 +69,22 @@ class CONTENT_EXPORT ContextProviderCommandBuffer |
void OnLostContext(); |
private: |
+ struct SharedProviders : public base::RefCountedThreadSafe<SharedProviders> { |
+ base::Lock lock; |
+ std::vector<ContextProviderCommandBuffer*> list; |
+ |
+ SharedProviders(); |
+ |
+ private: |
+ friend class base::RefCountedThreadSafe<SharedProviders>; |
+ ~SharedProviders(); |
+ }; |
+ |
base::ThreadChecker main_thread_checker_; |
base::ThreadChecker context_thread_checker_; |
+ scoped_refptr<SharedProviders> shared_providers_; |
+ |
std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |