Bug 1377920 - Too many WARNING: 'obs' from imagelib in debug builds. r=aosmond

MozReview-Commit-ID: 5Rt7VUYpOmt

--HG--
extra : rebase_source : 30add1827cba8508263d0a3c351e104bc5732fa7
This commit is contained in:
Marco Bonardo 2017-07-04 14:49:04 +02:00
parent 747ea49209
commit 4346bdf652
3 changed files with 6 additions and 3 deletions

View File

@ -96,7 +96,8 @@ ImageFactory::CreateImage(nsIRequest* aRequest,
// 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());

View File

@ -1399,7 +1399,8 @@ RasterImage::DrawInternal(DrawableSurface&& aSurface,
// 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);

View File

@ -1029,7 +1029,8 @@ VectorImage::Show(gfxDrawable* aDrawable, const SVGDrawingParameters& aParams)
// 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);