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

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

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tear down Created 5 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
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 1e0d23f82b915609416ce8473e6d4f83d6fd24bb..2dd5ef5dc48749594d42bb92f7967ea43e587966 100644
--- a/content/common/gpu/client/context_provider_command_buffer.h
+++ b/content/common/gpu/client/context_provider_command_buffer.h
@@ -30,6 +30,11 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
CommandBufferProxyImpl* GetCommandBufferProxy();
+ // Destroy WebGraphicsContext3DCommandBufferImpl context and GrContext. This
+ // should only be used if content provider has been set up for multi-threaded
+ // usage by calling SetupLock().
+ void Destroy();
+
// cc_blink::ContextProviderWebContext implementation.
WebGraphicsContext3DCommandBufferImpl* WebContext3D() override;
@@ -45,12 +50,13 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
Capabilities ContextCapabilities() override;
void VerifyContexts() override;
void DeleteCachedResources() override;
- bool DestroyedOnMainThread() override;
+ bool HasBeenLostOnMainThread() override;
void SetLostContextCallback(
const LostContextCallback& lost_context_callback) override;
void SetMemoryPolicyChangedCallback(
const MemoryPolicyChangedCallback& memory_policy_changed_callback)
override;
+ bool HasBeenDestroyed() override;
protected:
ContextProviderCommandBuffer(
@@ -63,6 +69,7 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
private:
void InitializeCapabilities();
+ void DestroyWithLockAcquired();
base::ThreadChecker main_thread_checker_;
base::ThreadChecker context_thread_checker_;
@@ -78,9 +85,10 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
MemoryPolicyChangedCallback memory_policy_changed_callback_;
base::Lock main_thread_lock_;
- bool destroyed_;
+ bool lost_;
base::Lock context_lock_;
+ bool destroyed_;
class LostContextCallbackProxy;
scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698