diff options
author | jbauman <jbauman@chromium.org> | 2015-02-12 16:57:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-13 00:58:24 +0000 |
commit | 35952093f8967bdb6bf596817486a61b70118dde (patch) | |
tree | 13e8890270fbae02ed8e997bc4b5fd4e663108de /webkit | |
parent | 2ab75b551fc63ce2b086802ad19d3308cd55b9e8 (diff) | |
download | chromium_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 'webkit')
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.cc | 7 | ||||
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/webkit/common/gpu/context_provider_in_process.cc b/webkit/common/gpu/context_provider_in_process.cc index 7eb90a9..f2844b2 100644 --- a/webkit/common/gpu/context_provider_in_process.cc +++ b/webkit/common/gpu/context_provider_in_process.cc @@ -156,6 +156,13 @@ class GrContext* ContextProviderInProcess::GrContext() { return gr_context_->get(); } +void ContextProviderInProcess::SetupLock() { +} + +base::Lock* ContextProviderInProcess::GetLock() { + return nullptr; +} + bool ContextProviderInProcess::IsContextLost() { DCHECK(lost_context_callback_proxy_); // Is bound to thread. DCHECK(context_thread_checker_.CalledOnValidThread()); diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h index 0ab7542..b719d71 100644 --- a/webkit/common/gpu/context_provider_in_process.h +++ b/webkit/common/gpu/context_provider_in_process.h @@ -52,6 +52,8 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess ::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; |