Bug 1356317: Part 1 - Mark SurfaceMemoryReporter refcounting as threadsafe. r?njn
MozReview-Commit-ID: 9U5KLMyKSbk
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -467,17 +467,17 @@ public:
static void AdjustUsedMemory(gfxSurfaceType aType, int32_t aBytes)
{
// A read-modify-write operation like += would require a memory barrier
// here, which would defeat the purpose of using relaxed memory
// ordering. So separate out the read and write operations.
sSurfaceMemoryUsed[size_t(aType)] = sSurfaceMemoryUsed[size_t(aType)] + aBytes;
};
- NS_DECL_ISUPPORTS
+ NS_DECL_THREADSAFE_ISUPPORTS
NS_IMETHOD CollectReports(nsIHandleReportCallback *aHandleReport,
nsISupports *aData, bool aAnonymize) override
{
const size_t len = ArrayLength(sSurfaceMemoryReporterAttrs);
for (size_t i = 0; i < len; i++) {
int64_t amount = sSurfaceMemoryUsed[i];