summaryrefslogtreecommitdiffstats
path: root/ui/compositor/test/in_process_context_provider.h
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2015-02-12 16:57:48 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-13 00:58:24 +0000
commit35952093f8967bdb6bf596817486a61b70118dde (patch)
tree13e8890270fbae02ed8e997bc4b5fd4e663108de /ui/compositor/test/in_process_context_provider.h
parent2ab75b551fc63ce2b086802ad19d3308cd55b9e8 (diff)
downloadchromium_src-35952093f8967bdb6bf596817486a61b70118dde.zip
chromium_src-35952093f8967bdb6bf596817486a61b70118dde.tar.gz
chromium_src-35952093f8967bdb6bf596817486a61b70118dde.tar.bz2
Add a lock on context provider for use from multiple threads.
If SetupLock() is called on the context provider, it can be used from multiple threads if the lock returned from GetLock() is held around every call into the context. BUG=454500 Review URL: https://codereview.chromium.org/918793003 Cr-Commit-Position: refs/heads/master@{#316108}
Diffstat (limited to 'ui/compositor/test/in_process_context_provider.h')
-rw-r--r--ui/compositor/test/in_process_context_provider.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/compositor/test/in_process_context_provider.h b/ui/compositor/test/in_process_context_provider.h
index 4b63ed4..4033a7c 100644
--- a/ui/compositor/test/in_process_context_provider.h
+++ b/ui/compositor/test/in_process_context_provider.h
@@ -48,6 +48,8 @@ class InProcessContextProvider : public cc::ContextProvider {
gpu::gles2::GLES2Interface* ContextGL() override;
gpu::ContextSupport* ContextSupport() override;
class GrContext* GrContext() override;
+ void SetupLock() override;
+ base::Lock* GetLock() override;
bool IsContextLost() override;
void VerifyContexts() override;
void DeleteCachedResources() override;
@@ -77,6 +79,8 @@ class InProcessContextProvider : public cc::ContextProvider {
base::Lock destroyed_lock_;
bool destroyed_;
+ base::Lock context_lock_;
+
DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider);
};