From de736f1c55ca59fc8d0bcb837250103aa5cadf72 Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Tue, 19 Mar 2019 15:14:04 +0000 Subject: [PATCH] Bug 1532253 - Hold lock in mozilla::dom::IsType() r=baku Differential Revision: https://phabricator.services.mozilla.com/D24018 --HG-- extra : moz-landing-system : lando --- dom/file/uri/BlobURLProtocolHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/file/uri/BlobURLProtocolHandler.cpp b/dom/file/uri/BlobURLProtocolHandler.cpp index 74d425a382dd..bad51c7ae1cc 100644 --- a/dom/file/uri/BlobURLProtocolHandler.cpp +++ b/dom/file/uri/BlobURLProtocolHandler.cpp @@ -956,8 +956,8 @@ namespace mozilla { namespace dom { bool IsType(nsIURI* aUri, DataInfo::ObjectType aType) { - MOZ_ASSERT(NS_IsMainThread(), - "without locking gDataTable is main-thread only"); + // We lock because this may be called off-main-thread + StaticMutexAutoLock lock(sMutex); DataInfo* info = GetDataInfoFromURI(aUri); if (!info) { return false;