mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1368776 - Part 0. Move RasterImage's NotifyDrawingObservers to ImageResource. r=tnikkel
This commit is contained in:
parent
e3b5379696
commit
37395798ee
@ -169,5 +169,31 @@ ImageResource::SendOnUnlockedDraw(uint32_t aFlags)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
ImageResource::NotifyDrawingObservers()
|
||||
{
|
||||
if (!mURI || !NS_IsMainThread()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool match = false;
|
||||
if ((NS_FAILED(mURI->SchemeIs("resource", &match)) || !match) &&
|
||||
(NS_FAILED(mURI->SchemeIs("chrome", &match)) || !match)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Record the image drawing for startup performance testing.
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
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
|
||||
|
||||
} // namespace image
|
||||
} // namespace mozilla
|
||||
|
@ -318,6 +318,11 @@ protected:
|
||||
|
||||
void SendOnUnlockedDraw(uint32_t aFlags);
|
||||
|
||||
#ifdef DEBUG
|
||||
// Records the image drawing for startup performance testing.
|
||||
void NotifyDrawingObservers();
|
||||
#endif
|
||||
|
||||
// Member data shared by all implementations of this abstract class
|
||||
RefPtr<ProgressTracker> mProgressTracker;
|
||||
RefPtr<ImageURL> mURI;
|
||||
|
@ -1691,32 +1691,6 @@ RasterImage::GetFramesNotified(uint32_t* aFramesNotified)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
RasterImage::NotifyDrawingObservers()
|
||||
{
|
||||
if (!mURI || !NS_IsMainThread()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool match = false;
|
||||
if ((NS_FAILED(mURI->SchemeIs("resource", &match)) || !match) &&
|
||||
(NS_FAILED(mURI->SchemeIs("chrome", &match)) || !match)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Record the image drawing for startup performance testing.
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
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
|
||||
|
||||
void
|
||||
RasterImage::NotifyProgress(Progress aProgress,
|
||||
const IntRect& aInvalidRect /* = IntRect() */,
|
||||
|
@ -317,11 +317,6 @@ private:
|
||||
|
||||
void UpdateImageContainer();
|
||||
|
||||
#ifdef DEBUG
|
||||
// Records the image drawing for startup performance testing.
|
||||
void NotifyDrawingObservers();
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Decoding.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user