Bug 1356317: Part 1 - Mark SurfaceMemoryReporter refcounting as threadsafe. r?njn draft
authorKris Maglione <maglione.k@gmail.com>
Mon, 29 May 2017 17:32:54 -0700
changeset 586224 4d82ee47e7cb8ad47879702c8af19e8723e2b62e
parent 586223 d16aafd6d14329a00700071f94118c3e6aec4ed0
child 630924 7dac858cc3a124764361be8b81a970c31b6c1ae9
push id61333
push usermaglione.k@gmail.com
push dateTue, 30 May 2017 00:33:14 +0000
reviewersnjn
bugs1356317
milestone55.0a1
Bug 1356317: Part 1 - Mark SurfaceMemoryReporter refcounting as threadsafe. r?njn MozReview-Commit-ID: 9U5KLMyKSbk
gfx/thebes/gfxASurface.cpp
--- 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];