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

Unified Diff: gpu/command_buffer/service/mailbox_manager_sync.cc

Issue 2666423002: Assert sequence validity on non-thread-safe RefCount manipulations (2) (Closed)
Patch Set: remove DisableSequenceConsistencyAssertions Created 3 years, 9 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 | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | ppapi/shared_impl/proxy_lock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mailbox_manager_sync.cc
diff --git a/gpu/command_buffer/service/mailbox_manager_sync.cc b/gpu/command_buffer/service/mailbox_manager_sync.cc
index a9110de18faf265f5d0c9b6d7578b74dad5daf6d..d92d29f93ca5871530a49a7f611eb12cd2748f79 100644
--- a/gpu/command_buffer/service/mailbox_manager_sync.cc
+++ b/gpu/command_buffer/service/mailbox_manager_sync.cc
@@ -195,6 +195,10 @@ bool MailboxManagerSync::UsesSync() {
Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
base::AutoLock lock(g_lock.Get());
+ // Relax the cross-thread access restriction to non-thread-safe RefCount.
+ // The lock above protects non-thread-safe RefCount in TextureGroup.
+ base::ScopedAllowCrossThreadRefCountAccess
+ scoped_allow_cross_thread_ref_count_access;
TextureGroup* group = TextureGroup::FromName(mailbox);
if (!group)
return NULL;
@@ -222,6 +226,10 @@ Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
TextureBase* texture_base) {
base::AutoLock lock(g_lock.Get());
+ // Relax the cross-thread access restriction to non-thread-safe RefCount.
+ // The lock above protects non-thread-safe RefCount in TextureGroup.
+ base::ScopedAllowCrossThreadRefCountAccess
+ scoped_allow_cross_thread_ref_count_access;
Texture* texture = static_cast<Texture*>(texture_base);
DCHECK(texture != nullptr);
@@ -269,6 +277,10 @@ void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
void MailboxManagerSync::TextureDeleted(TextureBase* texture_base) {
base::AutoLock lock(g_lock.Get());
+ // Relax the cross-thread access restriction to non-thread-safe RefCount.
+ // The lock above protects non-thread-safe RefCount in TextureGroup.
+ base::ScopedAllowCrossThreadRefCountAccess
+ scoped_allow_cross_thread_ref_count_access;
Texture* texture = static_cast<Texture*>(texture_base);
DCHECK(texture != nullptr);
@@ -316,6 +328,10 @@ void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base,
void MailboxManagerSync::PushTextureUpdates(const SyncToken& token) {
base::AutoLock lock(g_lock.Get());
+ // Relax the cross-thread access restriction to non-thread-safe RefCount.
+ // The lock above protects non-thread-safe RefCount in TextureGroup.
+ base::ScopedAllowCrossThreadRefCountAccess
+ scoped_allow_cross_thread_ref_count_access;
for (TextureToGroupMap::iterator it = texture_to_group_.begin();
it != texture_to_group_.end(); it++) {
@@ -329,6 +345,10 @@ void MailboxManagerSync::PullTextureUpdates(const SyncToken& token) {
std::vector<TextureUpdatePair> needs_update;
{
base::AutoLock lock(g_lock.Get());
+ // Relax the cross-thread access restriction to non-thread-safe RefCount.
+ // The lock above protects non-thread-safe RefCount in TextureGroup.
+ base::ScopedAllowCrossThreadRefCountAccess
+ scoped_allow_cross_thread_ref_count_access;
AcquireFenceLocked(token);
for (TextureToGroupMap::iterator it = texture_to_group_.begin();
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | ppapi/shared_impl/proxy_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698