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

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: rebase on ImageStorage fix Created 3 years, 10 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: 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 dd9e6738818d53ca970815db9b34beccdcd2daec..b207268997d88a2fe291aabc0c0f9fc962442071 100644
--- a/gpu/command_buffer/service/mailbox_manager_sync.cc
+++ b/gpu/command_buffer/service/mailbox_manager_sync.cc
@@ -194,6 +194,7 @@ bool MailboxManagerSync::UsesSync() {
Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
base::AutoLock lock(g_lock.Get());
+ base::ScopedAllowCrossThreadRefCountAccess a;
TextureGroup* group = TextureGroup::FromName(mailbox);
if (!group)
return NULL;
@@ -221,6 +222,7 @@ Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
TextureBase* texture_base) {
base::AutoLock lock(g_lock.Get());
+ base::ScopedAllowCrossThreadRefCountAccess a;
Texture* texture = static_cast<Texture*>(texture_base);
DCHECK(texture != nullptr);
@@ -268,6 +270,7 @@ void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
void MailboxManagerSync::TextureDeleted(TextureBase* texture_base) {
base::AutoLock lock(g_lock.Get());
+ base::ScopedAllowCrossThreadRefCountAccess a;
Texture* texture = static_cast<Texture*>(texture_base);
DCHECK(texture != nullptr);
@@ -315,6 +318,7 @@ void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base,
void MailboxManagerSync::PushTextureUpdates(const SyncToken& token) {
base::AutoLock lock(g_lock.Get());
+ base::ScopedAllowCrossThreadRefCountAccess a;
gab 2017/02/17 21:10:41 Comment and full variable name everywhere.
tzik 2017/02/21 06:15:03 Done.
for (TextureToGroupMap::iterator it = texture_to_group_.begin();
it != texture_to_group_.end(); it++) {
@@ -328,6 +332,7 @@ void MailboxManagerSync::PullTextureUpdates(const SyncToken& token) {
std::vector<TextureUpdatePair> needs_update;
{
base::AutoLock lock(g_lock.Get());
+ base::ScopedAllowCrossThreadRefCountAccess a;
AcquireFenceLocked(token);
for (TextureToGroupMap::iterator it = texture_to_group_.begin();

Powered by Google App Engine
This is Rietveld 408576698