mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1162751 - Part 1: Remove instances of #ifdef PR_LOGGING in image. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
parent
3452e7aea1
commit
330f80fa92
@ -11,7 +11,6 @@
|
||||
#include "prinrval.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
// Declared in imgRequest.cpp.
|
||||
extern PRLogModuleInfo* GetImgLog();
|
||||
|
||||
@ -157,18 +156,6 @@ public:
|
||||
|
||||
#define LOG_MSG(l, s, m) LogMessage(l, this, s, m)
|
||||
|
||||
#else
|
||||
|
||||
#define LOG_SCOPE(l, s)
|
||||
#define LOG_SCOPE_WITH_PARAM(l, s, pn, pv)
|
||||
#define LOG_FUNC(l, s)
|
||||
#define LOG_FUNC_WITH_PARAM(l, s, pn, pv)
|
||||
#define LOG_STATIC_FUNC(l, s)
|
||||
#define LOG_STATIC_FUNC_WITH_PARAM(l, s, pn, pv)
|
||||
#define LOG_MSG(l, s, m)
|
||||
|
||||
#endif // if defined(PR_LOGGING)
|
||||
|
||||
#define LOG_MSG_WITH_PARAM LOG_FUNC_WITH_PARAM
|
||||
|
||||
#endif // mozilla_image_ImageLogging_h
|
||||
|
@ -22,7 +22,6 @@
|
||||
namespace mozilla {
|
||||
namespace image {
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo*
|
||||
GetBMPLog()
|
||||
{
|
||||
@ -32,7 +31,6 @@ GetBMPLog()
|
||||
}
|
||||
return sBMPLog;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Convert from row (1..height) to absolute line (0..height-1)
|
||||
#define LINE(row) ((mBIH.height < 0) ? (-mBIH.height - (row)) : ((row) - 1))
|
||||
|
@ -36,7 +36,6 @@ static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
|
||||
namespace mozilla {
|
||||
namespace image {
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
static PRLogModuleInfo*
|
||||
GetJPEGLog()
|
||||
{
|
||||
@ -56,10 +55,6 @@ GetJPEGDecoderAccountingLog()
|
||||
}
|
||||
return sJPEGDecoderAccountingLog;
|
||||
}
|
||||
#else
|
||||
#define GetJPEGLog()
|
||||
#define GetJPEGDecoderAccountingLog()
|
||||
#endif
|
||||
|
||||
static qcms_profile*
|
||||
GetICCProfile(struct jpeg_decompress_struct& info)
|
||||
|
@ -22,7 +22,6 @@
|
||||
namespace mozilla {
|
||||
namespace image {
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo*
|
||||
GetPNGLog()
|
||||
{
|
||||
@ -42,7 +41,6 @@ GetPNGDecoderAccountingLog()
|
||||
}
|
||||
return sPNGDecoderAccountingLog;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Limit image dimensions (bug #251381, #591822, and #967656)
|
||||
#ifndef MOZ_PNG_MAX_DIMENSION
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo*
|
||||
GetPNGEncoderLog()
|
||||
{
|
||||
@ -22,7 +21,6 @@ GetPNGEncoderLog()
|
||||
}
|
||||
return sPNGEncoderLog;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsPNGEncoder, imgIEncoder, nsIInputStream,
|
||||
nsIAsyncInputStream)
|
||||
|
@ -164,7 +164,6 @@ ProgressTracker::Notify(IProgressObserver* aObserver)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsRefPtr<Image> image = GetImage();
|
||||
if (image && image->GetURI()) {
|
||||
nsRefPtr<ImageURL> uri(image->GetURI());
|
||||
@ -176,7 +175,6 @@ ProgressTracker::Notify(IProgressObserver* aObserver)
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(),
|
||||
"ProgressTracker::Notify async", "uri", "<unknown>");
|
||||
}
|
||||
#endif
|
||||
|
||||
aObserver->SetNotificationsDeferred(true);
|
||||
|
||||
@ -233,7 +231,6 @@ ProgressTracker::NotifyCurrentState(IProgressObserver* aObserver)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsRefPtr<Image> image = GetImage();
|
||||
nsAutoCString spec;
|
||||
if (image && image->GetURI()) {
|
||||
@ -241,7 +238,6 @@ ProgressTracker::NotifyCurrentState(IProgressObserver* aObserver)
|
||||
}
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(),
|
||||
"ProgressTracker::NotifyCurrentState", "uri", spec.get());
|
||||
#endif
|
||||
|
||||
aObserver->SetNotificationsDeferred(true);
|
||||
|
||||
@ -365,14 +361,12 @@ ProgressTracker::SyncNotify(IProgressObserver* aObserver)
|
||||
|
||||
nsRefPtr<Image> image = GetImage();
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoCString spec;
|
||||
if (image && image->GetURI()) {
|
||||
image->GetURI()->GetSpec(spec);
|
||||
}
|
||||
LOG_SCOPE_WITH_PARAM(GetImgLog(),
|
||||
"ProgressTracker::SyncNotify", "uri", spec.get());
|
||||
#endif
|
||||
|
||||
nsIntRect rect;
|
||||
if (image) {
|
||||
|
@ -893,7 +893,6 @@ imgCacheEntry::UpdateCache(int32_t diff /* = 0 */)
|
||||
void
|
||||
imgCacheEntry::SetHasNoProxies(bool hasNoProxies)
|
||||
{
|
||||
#if defined(PR_LOGGING)
|
||||
nsRefPtr<ImageURL> uri;
|
||||
mRequest->GetURI(getter_AddRefs(uri));
|
||||
nsAutoCString spec;
|
||||
@ -907,7 +906,6 @@ imgCacheEntry::SetHasNoProxies(bool hasNoProxies)
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(), "imgCacheEntry::SetHasNoProxies false",
|
||||
"uri", spec.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
mHasNoProxies = hasNoProxies;
|
||||
}
|
||||
@ -1077,7 +1075,6 @@ imgCacheExpirationTracker::NotifyExpired(imgCacheEntry* entry)
|
||||
// mechanism doesn't.
|
||||
nsRefPtr<imgCacheEntry> kungFuDeathGrip(entry);
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
nsRefPtr<imgRequest> req(entry->GetRequest());
|
||||
if (req) {
|
||||
nsRefPtr<ImageURL> uri;
|
||||
@ -1088,7 +1085,6 @@ imgCacheExpirationTracker::NotifyExpired(imgCacheEntry* entry)
|
||||
"imgCacheExpirationTracker::NotifyExpired",
|
||||
"entry", spec.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
// We can be called multiple times on the same entry. Don't do work multiple
|
||||
// times.
|
||||
@ -1513,7 +1509,6 @@ imgLoader::PutIntoCache(const ImageCacheKey& aKey, imgCacheEntry* entry)
|
||||
bool
|
||||
imgLoader::SetHasNoProxies(imgRequest* aRequest, imgCacheEntry* aEntry)
|
||||
{
|
||||
#if defined(PR_LOGGING)
|
||||
nsRefPtr<ImageURL> uri;
|
||||
aRequest->GetURI(getter_AddRefs(uri));
|
||||
nsAutoCString spec;
|
||||
@ -1521,7 +1516,6 @@ imgLoader::SetHasNoProxies(imgRequest* aRequest, imgCacheEntry* aEntry)
|
||||
|
||||
LOG_STATIC_FUNC_WITH_PARAM(GetImgLog(),
|
||||
"imgLoader::SetHasNoProxies", "uri", spec.get());
|
||||
#endif
|
||||
|
||||
aEntry->SetHasNoProxies(true);
|
||||
|
||||
@ -1605,7 +1599,6 @@ imgLoader::CheckCacheLimits(imgCacheTable& cache, imgCacheQueue& queue)
|
||||
|
||||
NS_ASSERTION(entry, "imgLoader::CheckCacheLimits -- NULL entry pointer");
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
nsRefPtr<imgRequest> req(entry->GetRequest());
|
||||
if (req) {
|
||||
nsRefPtr<ImageURL> uri;
|
||||
@ -1616,7 +1609,6 @@ imgLoader::CheckCacheLimits(imgCacheTable& cache, imgCacheQueue& queue)
|
||||
"imgLoader::CheckCacheLimits",
|
||||
"entry", spec.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (entry) {
|
||||
RemoveFromCache(entry);
|
||||
@ -1845,7 +1837,6 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry,
|
||||
PR_LOG(GetImgLog(), PR_LOG_DEBUG,
|
||||
("imgLoader::ValidateEntry validating cache entry. "
|
||||
"validateRequest = %d", validateRequest));
|
||||
#if defined(PR_LOGGING)
|
||||
} else if (!key) {
|
||||
nsAutoCString spec;
|
||||
aURI->GetSpec(spec);
|
||||
@ -1853,7 +1844,6 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry,
|
||||
PR_LOG(GetImgLog(), PR_LOG_DEBUG,
|
||||
("imgLoader::ValidateEntry BYPASSING cache validation for %s "
|
||||
"because of NULL LoadID", spec.get()));
|
||||
#endif
|
||||
}
|
||||
|
||||
// We can't use a cached request if it comes from a different
|
||||
@ -2118,11 +2108,9 @@ imgLoader::LoadImage(nsIURI* aURI,
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoCString spec;
|
||||
aURI->GetSpec(spec);
|
||||
LOG_SCOPE_WITH_PARAM(GetImgLog(), "imgLoader::LoadImage", "aURI", spec.get());
|
||||
#endif
|
||||
|
||||
*_retval = nullptr;
|
||||
|
||||
@ -2876,13 +2864,11 @@ imgCacheValidator::OnStartRequest(nsIRequest* aRequest, nsISupports* ctxt)
|
||||
uri = imageURL->ToIURI();
|
||||
}
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
nsAutoCString spec;
|
||||
uri->GetSpec(spec);
|
||||
LOG_MSG_WITH_PARAM(GetImgLog(),
|
||||
"imgCacheValidator::OnStartRequest creating new request",
|
||||
"uri", spec.get());
|
||||
#endif
|
||||
|
||||
int32_t corsmode = mRequest->GetCORSMode();
|
||||
ReferrerPolicy refpol = mRequest->GetReferrerPolicy();
|
||||
|
@ -42,7 +42,6 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::image;
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
PRLogModuleInfo*
|
||||
GetImgLog()
|
||||
{
|
||||
@ -53,9 +52,6 @@ GetImgLog()
|
||||
return sImgLog;
|
||||
}
|
||||
#define LOG_TEST(level) (GetImgLog() && PR_LOG_TEST(GetImgLog(), (level)))
|
||||
#else
|
||||
#define LOG_TEST(level) false
|
||||
#endif
|
||||
|
||||
NS_IMPL_ISUPPORTS(imgRequest,
|
||||
nsIStreamListener, nsIRequestObserver,
|
||||
@ -263,7 +259,6 @@ imgRequest::RemoveProxy(imgRequestProxy* proxy, nsresult aStatus)
|
||||
mLoader->SetHasNoProxies(this, mCacheEntry);
|
||||
}
|
||||
}
|
||||
#if defined(PR_LOGGING)
|
||||
else {
|
||||
nsAutoCString spec;
|
||||
mURI->GetSpec(spec);
|
||||
@ -271,7 +266,6 @@ imgRequest::RemoveProxy(imgRequestProxy* proxy, nsresult aStatus)
|
||||
"imgRequest::RemoveProxy no cache entry",
|
||||
"uri", spec.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If |aStatus| is a failure code, then cancel the load if it is still in
|
||||
progress. Otherwise, let the load continue, keeping 'this' in the cache
|
||||
|
@ -861,12 +861,10 @@ imgRequestProxy::Notify(int32_t aType, const mozilla::gfx::IntRect* aRect)
|
||||
void
|
||||
imgRequestProxy::OnLoadComplete(bool aLastPart)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoCString name;
|
||||
GetName(name);
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::OnLoadComplete",
|
||||
"name", name.get());
|
||||
#endif
|
||||
// There's all sorts of stuff here that could kill us (the OnStopRequest call
|
||||
// on the listener, the removal from the loadgroup, the release of the
|
||||
// listener, etc). Don't let them do it.
|
||||
@ -906,12 +904,10 @@ imgRequestProxy::OnLoadComplete(bool aLastPart)
|
||||
void
|
||||
imgRequestProxy::BlockOnload()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoCString name;
|
||||
GetName(name);
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::BlockOnload",
|
||||
"name", name.get());
|
||||
#endif
|
||||
|
||||
nsCOMPtr<imgIOnloadBlocker> blocker = do_QueryInterface(mListener);
|
||||
if (blocker) {
|
||||
@ -922,12 +918,10 @@ imgRequestProxy::BlockOnload()
|
||||
void
|
||||
imgRequestProxy::UnblockOnload()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoCString name;
|
||||
GetName(name);
|
||||
LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::UnblockOnload",
|
||||
"name", name.get());
|
||||
#endif
|
||||
|
||||
nsCOMPtr<imgIOnloadBlocker> blocker = do_QueryInterface(mListener);
|
||||
if (blocker) {
|
||||
|
Loading…
Reference in New Issue
Block a user