Bug 1377920 - Too many WARNING: 'obs' from imagelib in debug builds. r=aosmond
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 04 Jul 2017 14:49:04 +0200
changeset 367318 5bfa0808e8d9a3e9d28a1efeb5102d886112be5d
parent 367317 a7d99ed85d5ed33327d56914772e3b815dcaeda6
child 367319 26b5da28266efb13aa701b3c12ad265d979626c2
push id92189
push userphilringnalda@gmail.com
push dateWed, 05 Jul 2017 03:32:26 +0000
treeherdermozilla-inbound@6cb10c35c617 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1377920
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1377920 - Too many WARNING: 'obs' from imagelib in debug builds. r=aosmond MozReview-Commit-ID: 5Rt7VUYpOmt
image/ImageFactory.cpp
image/RasterImage.cpp
image/VectorImage.cpp
--- a/image/ImageFactory.cpp
+++ b/image/ImageFactory.cpp
@@ -91,17 +91,18 @@ ImageFactory::CreateImage(nsIRequest* aR
 
   // Compute the image's initialization flags.
   uint32_t imageFlags = ComputeImageFlags(aURI, aMimeType, aIsMultiPart);
 
 #ifdef DEBUG
   // Record the image load for startup performance testing.
   if (NS_IsMainThread()) {
     nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
-    if (NS_WARN_IF(obs)) {
+    NS_WARNING_ASSERTION(obs, "Can't get an observer service handle");
+    if (obs) {
       nsAutoCString spec;
       aURI->GetSpec(spec);
       obs->NotifyObservers(nullptr, "image-loading", NS_ConvertUTF8toUTF16(spec).get());
     }
   }
 #endif
 
   // Select the type of image to create based on MIME type.
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -1394,17 +1394,18 @@ RasterImage::DrawInternal(DrawableSurfac
   gfxContextMatrixAutoSaveRestore saveMatrix(aContext);
   ImageRegion region(aRegion);
   bool frameIsFinished = aSurface->IsFinished();
 
 #ifdef DEBUG
   // Record the image drawing for startup performance testing.
   if (NS_IsMainThread()) {
     nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
-    if (NS_WARN_IF(obs)) {
+    NS_WARNING_ASSERTION(obs, "Can't get an observer service handle");
+    if (obs) {
       nsCOMPtr<nsIURI> imageURI = mURI->ToIURI();
       nsAutoCString spec;
       imageURI->GetSpec(spec);
       obs->NotifyObservers(nullptr, "image-drawing", NS_ConvertUTF8toUTF16(spec).get());
     }
   }
 #endif
 
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -1024,17 +1024,18 @@ VectorImage::Show(gfxDrawable* aDrawable
                              SurfaceFormat::B8G8R8A8,
                              aParams.samplingFilter,
                              aParams.flags, aParams.opacity);
 
 #ifdef DEBUG
   // Record the image drawing for startup performance testing.
   if (NS_IsMainThread()) {
     nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
-    if (NS_WARN_IF(obs)) {
+    NS_WARNING_ASSERTION(obs, "Can't get an observer service handle");
+    if (obs) {
       nsCOMPtr<nsIURI> imageURI = mURI->ToIURI();
       nsAutoCString spec;
       imageURI->GetSpec(spec);
       obs->NotifyObservers(nullptr, "image-drawing", NS_ConvertUTF8toUTF16(spec).get());
     }
   }
 #endif