Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj

PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
Eric Rahm 2015-05-07 09:43:38 -07:00
parent 40ae233ad5
commit c451c2932b
29 changed files with 2 additions and 148 deletions

View File

@ -63,9 +63,7 @@
using namespace mozilla;
#ifdef PR_LOGGING
PRLogModuleInfo *gWidgetLog = nullptr;
#endif
nsIGeolocationUpdate *gLocationCallback = nullptr;
nsAutoPtr<mozilla::AndroidGeckoEvent> gLastSizeChange;
@ -177,10 +175,8 @@ static const char* kObservedPrefs[] = {
nsresult
nsAppShell::Init()
{
#ifdef PR_LOGGING
if (!gWidgetLog)
gWidgetLog = PR_NewLogModule("Widget");
#endif
nsresult rv = nsBaseAppShell::Init();
nsCOMPtr<nsIObserverService> obsServ =

View File

@ -13,9 +13,7 @@
namespace mozilla {
namespace widget {
#ifdef PR_LOGGING
PRLogModuleInfo* gNativeKeyBindingsLog = nullptr;
#endif
NativeKeyBindings* NativeKeyBindings::sInstanceForSingleLineEditor = nullptr;
NativeKeyBindings* NativeKeyBindings::sInstanceForMultiLineEditor = nullptr;
@ -65,11 +63,9 @@ NativeKeyBindings::NativeKeyBindings()
void
NativeKeyBindings::Init(NativeKeyBindingsType aType)
{
#ifdef PR_LOGGING
if (!gNativeKeyBindingsLog) {
gNativeKeyBindingsLog = PR_NewLogModule("NativeKeyBindings");
}
#endif
PR_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS,
("%p NativeKeyBindings::Init", this));
@ -237,7 +233,6 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent,
for (uint32_t i = 0; i < bindingCommands.Length(); i++) {
SEL selector = bindingCommands[i].selector;
#ifdef PR_LOGGING
if (PR_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) {
NSString* selectorString = NSStringFromSelector(selector);
nsAutoString nsSelectorString;
@ -247,7 +242,6 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent,
("%p NativeKeyBindings::KeyPress, selector=%s",
this, ToNewCString(nsSelectorString)));
}
#endif
// Try to find a simple mapping in the hashtable
Command geckoCommand = static_cast<Command>(mSelectorToCommand.Get(

View File

@ -28,8 +28,6 @@
using namespace mozilla;
using namespace mozilla::widget;
#ifdef PR_LOGGING
PRLogModuleInfo* gLog = nullptr;
static const char*
@ -305,8 +303,6 @@ GetWindowLevelName(NSInteger aWindowLevel)
}
}
#endif // #ifdef PR_LOGGING
static bool
IsControlChar(uint32_t aCharCode)
{
@ -319,14 +315,12 @@ static TISInputSourceWrapper gCurrentInputSource;
static void
InitLogModule()
{
#ifdef PR_LOGGING
// Clear() is always called when TISInputSourceWrappper is created.
if (!gLog) {
gLog = PR_NewLogModule("TextInputHandlerWidgets");
TextInputHandler::DebugPrintAllKeyboardLayouts();
IMEInputHandler::DebugPrintAllIMEModes();
}
#endif
}
static void
@ -1047,7 +1041,6 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS,
"aKeyEvent must be NS_KEY_PRESS event");
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
nsAutoString chars;
nsCocoaUtils::GetStringForNSString([aNativeKeyEvent characters], chars);
@ -1062,7 +1055,6 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
utf8ExpectedChar.get(), GetGeckoKeyEventType(aKeyEvent), aKbType,
TrueOrFalse(IsOpenedIMEMode())));
}
#endif // #ifdef PR_LOGGING
aKeyEvent.isChar = true; // this is not a special key XXX not used in XP
aKeyEvent.charCode = aInsertChar;
@ -1451,7 +1443,6 @@ TextInputHandler::CreateAllKeyboardLayoutList()
void
TextInputHandler::DebugPrintAllKeyboardLayouts()
{
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
CFArrayRef list = CreateAllKeyboardLayoutList();
PR_LOG(gLog, PR_LOG_ALWAYS, ("Keyboard layout configuration:"));
@ -1474,7 +1465,6 @@ TextInputHandler::DebugPrintAllKeyboardLayouts()
}
::CFRelease(list);
}
#endif // #ifdef PR_LOGGING
}
@ -2270,7 +2260,6 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter,
tis.GetInputSourceID(sLatestIMEOpenedModeInputSourceID);
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
static CFStringRef sLastTIS = nullptr;
CFStringRef newTIS;
@ -2317,7 +2306,6 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter,
}
sLastTIS = newTIS;
}
#endif // #ifdef PR_LOGGING
/**
* When the direction is changed, all the children are notified.
@ -2360,7 +2348,6 @@ IMEInputHandler::CreateAllIMEModeList()
void
IMEInputHandler::DebugPrintAllIMEModes()
{
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
CFArrayRef list = CreateAllIMEModeList();
PR_LOG(gLog, PR_LOG_ALWAYS, ("IME mode configuration:"));
@ -2382,7 +2369,6 @@ IMEInputHandler::DebugPrintAllIMEModes()
}
::CFRelease(list);
}
#endif // #ifdef PR_LOGGING
}
//static
@ -3695,7 +3681,6 @@ IMEInputHandler::OpenSystemPreferredLanguageIME()
TISInputSourceWrapper tis;
tis.InitByLanguage(lang);
if (tis.IsOpenedIMEMode()) {
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
CFStringRef foundTIS;
tis.GetInputSourceID(foundTIS);
@ -3704,7 +3689,6 @@ IMEInputHandler::OpenSystemPreferredLanguageIME()
"foundTIS=%s, lang=%s",
this, GetCharacters(foundTIS), GetCharacters(lang)));
}
#endif // #ifdef PR_LOGGING
tis.Select();
changed = true;
}

View File

@ -107,9 +107,7 @@ using mozilla::gfx::Matrix4x4;
// out to the bounding-box if there are more
#define MAX_RECTS_IN_REGION 100
#ifdef PR_LOGGING
PRLogModuleInfo* sCocoaLog = nullptr;
#endif
extern "C" {
CG_EXTERN void CGContextResetCTM(CGContextRef);
@ -275,11 +273,9 @@ FlipCocoaScreenCoordinate(NSPoint &inPoint)
void EnsureLogInitialized()
{
#ifdef PR_LOGGING
if (!sCocoaLog) {
sCocoaLog = PR_NewLogModule("nsCocoaWidgets");
}
#endif // PR_LOGGING
}
namespace {

View File

@ -31,9 +31,7 @@ using mozilla::RefPtr;
// Screenshots use the (undocumented) png pasteboard type.
#define IMAGE_PASTEBOARD_TYPES NSTIFFPboardType, @"Apple PNG pasteboard type", nil
#ifdef PR_LOGGING
extern PRLogModuleInfo* sCocoaLog;
#endif
extern void EnsureLogInitialized();

View File

@ -32,9 +32,7 @@
using namespace mozilla;
using namespace mozilla::gfx;
#ifdef PR_LOGGING
extern PRLogModuleInfo* sCocoaLog;
#endif
extern void EnsureLogInitialized();

View File

@ -26,12 +26,10 @@ using mozilla::unused;
#define NOTIFY_TOKEN 0xFA
#ifdef PR_LOGGING
PRLogModuleInfo *gWidgetLog = nullptr;
PRLogModuleInfo *gWidgetFocusLog = nullptr;
PRLogModuleInfo *gWidgetDragLog = nullptr;
PRLogModuleInfo *gWidgetDrawLog = nullptr;
#endif
static GPollFunc sPollFunc;
@ -75,7 +73,6 @@ nsAppShell::~nsAppShell()
nsresult
nsAppShell::Init()
{
#ifdef PR_LOGGING
if (!gWidgetLog)
gWidgetLog = PR_NewLogModule("Widget");
if (!gWidgetFocusLog)
@ -84,7 +81,6 @@ nsAppShell::Init()
gWidgetDragLog = PR_NewLogModule("WidgetDrag");
if (!gWidgetDrawLog)
gWidgetDrawLog = PR_NewLogModule("WidgetDraw");
#endif
#ifdef MOZ_ENABLE_DBUS
nsCOMPtr<nsIPowerManagerService> powerManagerService =

View File

@ -33,7 +33,6 @@
using namespace mozilla;
#ifdef PR_LOGGING
static PRLogModuleInfo *
GetDeviceContextSpecGTKLog()
{
@ -42,7 +41,6 @@ GetDeviceContextSpecGTKLog()
sLog = PR_NewLogModule("DeviceContextSpecGTK");
return sLog;
}
#endif /* PR_LOGGING */
/* Macro to make lines shorter */
#define DO_PR_DEBUG_LOG(x) PR_LOG(GetDeviceContextSpecGTKLog(), PR_LOG_DEBUG, x)

View File

@ -18,7 +18,6 @@
using namespace mozilla;
using namespace mozilla::widget;
#ifdef PR_LOGGING
PRLogModuleInfo* gGtkIMLog = nullptr;
static const char*
@ -75,7 +74,6 @@ GetEventType(GdkEventKey* aKeyEvent)
return "Unknown";
}
}
#endif
const static bool kUseSimpleContextDefault = MOZ_WIDGET_GTK == 2;
@ -96,11 +94,9 @@ nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow)
, mIsIMFocused(false)
, mIsDeletingSurrounding(false)
{
#ifdef PR_LOGGING
if (!gGtkIMLog) {
gGtkIMLog = PR_NewLogModule("nsGtkIMModuleWidgets");
}
#endif
static bool sFirstInstance = true;
if (sFirstInstance) {
sFirstInstance = false;

View File

@ -163,7 +163,6 @@ protected:
*/
bool IsValidContext(GtkIMContext* aContext) const;
#ifdef PR_LOGGING
const char* GetCompositionStateName()
{
switch (mCompositionState) {
@ -177,7 +176,6 @@ protected:
return "InvaildState";
}
}
#endif // PR_LOGGING
// mIsIMFocused is set to TRUE when we call gtk_im_context_focus_in(). And

View File

@ -22,9 +22,7 @@
#include "nsIBidiKeyboard.h"
#include "nsServiceManagerUtils.h"
#ifdef PR_LOGGING
PRLogModuleInfo* gKeymapWrapperLog = nullptr;
#endif // PR_LOGGING
#include "mozilla/ArrayUtils.h"
#include "mozilla/MouseEvents.h"
@ -44,8 +42,6 @@ KeymapWrapper::RepeatState KeymapWrapper::sRepeatState =
KeymapWrapper::NOT_PRESSED;
nsIBidiKeyboard* sBidiKeyboard = nullptr;
#ifdef PR_LOGGING
static const char* GetBoolName(bool aBool)
{
return aBool ? "TRUE" : "FALSE";
@ -71,8 +67,6 @@ KeymapWrapper::GetModifierName(Modifier aModifier)
}
}
#endif // PR_LOGGING
/* static */ KeymapWrapper::Modifier
KeymapWrapper::GetModifierForGDKKeyval(guint aGdkKeyval)
{
@ -159,14 +153,12 @@ KeymapWrapper::KeymapWrapper() :
mInitialized(false), mGdkKeymap(gdk_keymap_get_default()),
mXKBBaseEventCode(0)
{
#ifdef PR_LOGGING
if (!gKeymapWrapperLog) {
gKeymapWrapperLog = PR_NewLogModule("KeymapWrapperWidgets");
}
PR_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS,
("KeymapWrapper(%p): Constructor, mGdkKeymap=%p",
this, mGdkKeymap));
#endif // PR_LOGGING
g_signal_connect(mGdkKeymap, "keys-changed",
(GCallback)OnKeysChanged, this);

View File

@ -198,9 +198,7 @@ protected:
*/
static Modifier GetModifierForGDKKeyval(guint aGdkKeyval);
#ifdef PR_LOGGING
static const char* GetModifierName(Modifier aModifier);
#endif // PR_LOGGING
/**
* mGdkKeymap is a wrapped instance by this class.

View File

@ -13,9 +13,7 @@
#include "prlink.h"
#include "prlog.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* sIdleLog = nullptr;
#endif
typedef bool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
int* error_base);
@ -41,9 +39,7 @@ static void Initialize()
PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1");
if (!xsslib) // ouch.
{
#ifdef PR_LOGGING
PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to find libXss.so!\n"));
#endif
return;
}
@ -53,14 +49,13 @@ static void Initialize()
PR_FindFunctionSymbol(xsslib, "XScreenSaverAllocInfo");
_XSSQueryInfo = (_XScreenSaverQueryInfo_fn)
PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryInfo");
#ifdef PR_LOGGING
if (!_XSSQueryExtension)
PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryExtension!\n"));
if (!_XSSAllocInfo)
PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSAllocInfo!\n"));
if (!_XSSQueryInfo)
PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryInfo!\n"));
#endif
sInitialized = true;
}
@ -68,10 +63,8 @@ static void Initialize()
nsIdleServiceGTK::nsIdleServiceGTK()
: mXssInfo(nullptr)
{
#ifdef PR_LOGGING
if (!sIdleLog)
sIdleLog = PR_NewLogModule("nsIIdleService");
#endif
Initialize();
}
@ -106,9 +99,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime)
// We might not have a display (cf. in xpcshell)
Display *dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
if (!dplay) {
#ifdef PR_LOGGING
PR_LOG(sIdleLog, PR_LOG_WARNING, ("No display found!\n"));
#endif
return false;
}
@ -128,9 +119,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime)
return true;
}
// If we get here, we couldn't get to XScreenSaver:
#ifdef PR_LOGGING
PR_LOG(sIdleLog, PR_LOG_WARNING, ("XSSQueryExtension returned false!\n"));
#endif
return false;
}

View File

@ -46,9 +46,7 @@ using namespace mozilla;
// Number of seconds in a day.
#define SECONDS_PER_DAY 86400
#ifdef PR_LOGGING
static PRLogModuleInfo *sLog = nullptr;
#endif
#define LOG_TAG "GeckoIdleService"
#define LOG_LEVEL ANDROID_LOG_DEBUG
@ -396,10 +394,8 @@ nsIdleService::nsIdleService() : mCurrentlySetToTimeoutAt(TimeStamp()),
mDeltaToNextIdleSwitchInS(UINT32_MAX),
mLastUserInteraction(TimeStamp::Now())
{
#ifdef PR_LOGGING
if (sLog == nullptr)
sLog = PR_NewLogModule("idleService");
#endif
MOZ_ASSERT(!gIdleService);
gIdleService = this;
if (XRE_GetProcessType() == GeckoProcessType_Default) {
@ -792,9 +788,7 @@ nsIdleService::IdleTimerCallback(void)
void
nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
{
#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID)
TimeDuration nextTimeoutDuration = aNextTimeout - TimeStamp::Now();
#endif
PR_LOG(sLog, PR_LOG_DEBUG,
("idleService: SetTimerExpiryIfBefore: next timeout %0.f msec from now",
@ -874,9 +868,7 @@ nsIdleService::ReconfigureTimer(void)
TimeStamp nextTimeoutAt = mLastUserInteraction +
TimeDuration::FromSeconds(mDeltaToNextIdleSwitchInS);
#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID)
TimeDuration nextTimeoutDuration = nextTimeoutAt - curTime;
#endif
PR_LOG(sLog, PR_LOG_DEBUG,
("idleService: next timeout %0.f msec from now",

View File

@ -21,12 +21,10 @@
#include "prlog.h"
#endif
#ifdef PR_LOGGING
PRLogModuleInfo *gWidgetLog = nullptr;
PRLogModuleInfo *gWidgetFocusLog = nullptr;
PRLogModuleInfo *gWidgetIMLog = nullptr;
PRLogModuleInfo *gWidgetDrawLog = nullptr;
#endif
static int sPokeEvent;
@ -38,7 +36,6 @@ nsAppShell::~nsAppShell()
nsresult
nsAppShell::Init()
{
#ifdef PR_LOGGING
if (!gWidgetLog)
gWidgetLog = PR_NewLogModule("Widget");
if (!gWidgetFocusLog)
@ -47,7 +44,7 @@ nsAppShell::Init()
gWidgetIMLog = PR_NewLogModule("WidgetIM");
if (!gWidgetDrawLog)
gWidgetDrawLog = PR_NewLogModule("WidgetDraw");
#endif
sPokeEvent = QEvent::registerEventType();
nsQAppInstance::AddRef();

View File

@ -32,10 +32,8 @@
#include "gfxPDFSurface.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* DeviceContextSpecQtLM =
PR_NewLogModule("DeviceContextSpecQt");
#endif /* PR_LOGGING */
/* Macro to make lines shorter */
#define DO_PR_DEBUG_LOG(x) PR_LOG(DeviceContextSpecQtLM, PR_LOG_DEBUG, x)

View File

@ -50,7 +50,6 @@
namespace mozilla {
namespace widget {
#ifdef PR_LOGGING
static const char* kVirtualKeyName[] = {
"NULL", "VK_LBUTTON", "VK_RBUTTON", "VK_CANCEL",
"VK_MBUTTON", "VK_XBUTTON1", "VK_XBUTTON2", "0x07",
@ -140,8 +139,6 @@ static const char* kVirtualKeyName[] = {
static_assert(sizeof(kVirtualKeyName) / sizeof(const char*) == 0x100,
"The virtual key name must be defined just 256 keys");
#endif // #ifdef PR_LOGGING
// Unique id counter associated with a keydown / keypress events. Used in
// identifing keypress events for removal from async event dispatch queue
// in metrofx after preventDefault is called on keydown events.
@ -2245,20 +2242,16 @@ NativeKey::DispatchKeyPressEventForFollowingCharMessage(
KeyboardLayout* KeyboardLayout::sInstance = nullptr;
nsIIdleServiceInternal* KeyboardLayout::sIdleService = nullptr;
#ifdef PR_LOGGING
PRLogModuleInfo* sKeyboardLayoutLogger = nullptr;
#endif // #ifdef PR_LOGGING
// static
KeyboardLayout*
KeyboardLayout::GetInstance()
{
if (!sInstance) {
#ifdef PR_LOGGING
if (!sKeyboardLayoutLogger) {
sKeyboardLayoutLogger = PR_NewLogModule("KeyboardLayoutWidgets");
}
#endif // #ifdef PR_LOGGING
sInstance = new KeyboardLayout();
nsCOMPtr<nsIIdleServiceInternal> idleService =
do_GetService("@mozilla.org/widget/idleservice;1");
@ -2547,7 +2540,6 @@ KeyboardLayout::LoadLayout(HKL aLayout)
::SetKeyboardState(originalKbdState);
#ifdef PR_LOGGING
if (PR_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) {
static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 };
static const UINT kMapType =
@ -2570,7 +2562,6 @@ KeyboardLayout::LoadLayout(HKL aLayout)
}
}
}
#endif // #ifdef PR_LOGGING
}
inline int32_t

View File

@ -27,7 +27,6 @@
namespace mozilla {
namespace widget {
#ifdef PR_LOGGING
PRLogModuleInfo* gMouseScrollLog = nullptr;
static const char* GetBoolName(bool aBool)
@ -60,9 +59,6 @@ static void LogKeyStateImpl()
}
#define LOG_KEYSTATE() LogKeyStateImpl()
#else // PR_LOGGING
#define LOG_KEYSTATE()
#endif
MouseScrollHandler* MouseScrollHandler::sInstance = nullptr;
@ -103,11 +99,9 @@ MouseScrollHandler::GetCurrentMessagePos()
void
MouseScrollHandler::Initialize()
{
#ifdef PR_LOGGING
if (!gMouseScrollLog) {
gMouseScrollLog = PR_NewLogModule("MouseScrollHandlerWidgets");
}
#endif
Device::Init();
}
@ -648,13 +642,11 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget,
return;
}
}
#ifdef PR_LOGGING
else {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not "
"dispatched"));
}
#endif
}
void
@ -1229,12 +1221,10 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget,
InitEvent(aWidget, commandEvent);
aWidget->DispatchWindowEvent(&commandEvent);
}
#ifdef PR_LOGGING
else {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::Device::Elantech::HandleKeyMessage(): Consumed"));
}
#endif
return true; // consume the message (doesn't need to dispatch key events)
}

View File

@ -383,7 +383,6 @@ private:
};
Status mStatus;
#ifdef PR_LOGGING
const char* GetStatusName()
{
switch (mStatus) {
@ -399,7 +398,6 @@ private:
return "Unknown";
}
}
#endif
void Finish();
}; // SynthesizingEvent

View File

@ -46,9 +46,7 @@
#include "nsTextStore.h"
#endif // #ifdef NS_ENABLE_TSF
#ifdef PR_LOGGING
PRLogModuleInfo* gWindowsLog = nullptr;
#endif
using namespace mozilla::gfx;
@ -432,11 +430,9 @@ WinUtils::DwmFlushProc WinUtils::dwmFlushProcPtr = nullptr;
void
WinUtils::Initialize()
{
#ifdef PR_LOGGING
if (!gWindowsLog) {
gWindowsLog = PR_NewLogModule("Widget");
}
#endif
if (!sDwmDll && IsVistaOrLater()) {
sDwmDll = ::LoadLibraryW(kDwmLibraryName);
@ -485,11 +481,9 @@ WinUtils::LogW(const wchar_t *fmt, ...)
nullptr) > 0) {
// desktop console
printf("%s\n", utf8);
#ifdef PR_LOGGING
NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget "
"log module doesn't exist!");
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (utf8));
#endif
}
delete[] utf8;
}
@ -521,11 +515,9 @@ WinUtils::Log(const char *fmt, ...)
// desktop console
printf("%s\n", buffer);
#ifdef PR_LOGGING
NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget "
"log module doesn't exist!");
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (buffer));
#endif
delete[] buffer;
}

View File

@ -34,9 +34,7 @@
#include "nsEscape.h"
#include "nsIObserverService.h"
#ifdef PR_LOGGING
PRLogModuleInfo* gWin32ClipboardLog = nullptr;
#endif
// oddly, this isn't in the MSVC headers anywhere.
UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format");
@ -49,11 +47,9 @@ UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format");
//-------------------------------------------------------------------------
nsClipboard::nsClipboard() : nsBaseClipboard()
{
#ifdef PR_LOGGING
if (!gWin32ClipboardLog) {
gWin32ClipboardLog = PR_NewLogModule("nsClipboard");
}
#endif
mIgnoreEmptyNotification = false;
mWindow = nullptr;

View File

@ -42,12 +42,8 @@
#define NS_ERROR_GFX_PRINTER_BUNDLE_URL "chrome://global/locale/printing.properties"
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo * kWidgetPrintingLogMod = PR_NewLogModule("printing-widget");
#define PR_PL(_p1) PR_LOG(kWidgetPrintingLogMod, PR_LOG_DEBUG, _p1)
#else
#define PR_PL(_p1)
#endif
using namespace mozilla;

View File

@ -21,9 +21,7 @@ using namespace mozilla::widget;
static nsIMM32Handler* gIMM32Handler = nullptr;
#ifdef PR_LOGGING
PRLogModuleInfo* gIMM32Log = nullptr;
#endif
static UINT sWM_MSIME_MOUSE = 0; // mouse message for MSIME 98/2000
@ -57,10 +55,8 @@ nsIMM32Handler::EnsureHandlerInstance()
/* static */ void
nsIMM32Handler::Initialize()
{
#ifdef PR_LOGGING
if (!gIMM32Log)
gIMM32Log = PR_NewLogModule("nsIMM32HandlerWidgets");
#endif
if (!sWM_MSIME_MOUSE) {
sWM_MSIME_MOUSE = ::RegisterWindowMessage(RWM_MOUSE);
@ -533,7 +529,6 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow,
LPARAM lParam,
MSGResult& aResult)
{
#ifdef PR_LOGGING
switch (wParam) {
case IMN_CHANGECANDIDATE:
PR_LOG(gIMM32Log, PR_LOG_ALWAYS,
@ -606,7 +601,6 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow,
aWindow->GetWindowHandle()));
break;
}
#endif // PR_LOGGING
// not implement yet
aResult.mConsumed = false;
@ -1544,7 +1538,6 @@ PlatformToNSAttr(uint8_t aAttr)
}
}
#ifdef PR_LOGGING
static const char*
GetRangeTypeName(uint32_t aRangeType)
{
@ -1563,7 +1556,6 @@ GetRangeTypeName(uint32_t aRangeType)
return "UNKNOWN SELECTION TYPE!!";
}
}
#endif
void
nsIMM32Handler::DispatchCompositionChangeEvent(nsWindow* aWindow,

View File

@ -42,9 +42,7 @@ using mozilla::IsVistaOrLater;
using namespace mozilla;
using namespace mozilla::widget;
#ifdef PR_LOGGING
extern PRLogModuleInfo* gWindowsLog;
#endif
NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeWin, nsNativeTheme, nsITheme)

View File

@ -27,9 +27,7 @@
#include "nsNativeCharsetUtils.h"
#include "nsThreadUtils.h"
#ifdef PR_LOGGING
PRLogModuleInfo* gWin32SoundLog = nullptr;
#endif
class nsSoundPlayer: public nsRunnable {
public:
@ -108,11 +106,9 @@ NS_IMPL_ISUPPORTS(nsSound, nsISound, nsIStreamLoaderObserver)
nsSound::nsSound()
{
#ifdef PR_LOGGING
if (!gWin32SoundLog) {
gWin32SoundLog = PR_NewLogModule("nsSound");
}
#endif
mLastSound = nullptr;
}

View File

@ -27,7 +27,6 @@ using namespace mozilla::widget;
static const char* kPrefNameEnableTSF = "intl.tsf.enable";
static const char* kPrefNameForceEnableTSF = "intl.tsf.force_enable";
#ifdef PR_LOGGING
/**
* TSF related code should log its behavior even on release build especially
* in the interface methods.
@ -658,8 +657,6 @@ GetModifiersName(Modifiers aModifiers)
return names;
}
#endif // #ifdef PR_LOGGING
/******************************************************************/
/* InputScopeImpl */
/******************************************************************/
@ -2008,7 +2005,6 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty,
HRESULT hr;
#ifdef PR_LOGGING
if (PR_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) {
LONG start = 0, length = 0;
hr = GetRangeExtent(aRange, &start, &length);
@ -2019,7 +2015,6 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty,
start - mComposition.mStart + length,
GetCommonReturnValueName(hr)));
}
#endif
VARIANT propValue;
::VariantInit(&propValue);
@ -3976,7 +3971,6 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition,
return hr;
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) {
Selection& currentSel = CurrentSelection();
if (currentSel.IsDirty()) {
@ -3994,7 +3988,6 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition,
currentSel.StartOffset(), currentSel.EndOffset(),
GetActiveSelEndName(currentSel.ActiveSelEnd())));
}
#endif // #ifdef PR_LOGGING
return S_OK;
}
@ -4731,11 +4724,9 @@ nsTextStore::MarkContextAsEmpty(ITfContext* aContext)
void
nsTextStore::Initialize()
{
#ifdef PR_LOGGING
if (!sTextStoreLog) {
sTextStoreLog = PR_NewLogModule("nsTextStoreWidgets");
}
#endif
PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
("TSF: nsTextStore::Initialize() is called..."));

View File

@ -20,9 +20,7 @@
using namespace mozilla;
using namespace mozilla::widget;
#ifdef PR_LOGGING
extern PRLogModuleInfo* gWindowsLog;
#endif
const wchar_t nsWinGesture::kGestureLibraryName[] = L"user32.dll";
HMODULE nsWinGesture::sLibraryHandle = nullptr;

View File

@ -265,9 +265,7 @@ TimeStamp nsWindow::sFirstEventTimeStamp = TimeStamp();
static const char *sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1";
#ifdef PR_LOGGING
extern PRLogModuleInfo* gWindowsLog;
#endif
// Global used in Show window enumerations.
static bool gWindowsVisible = false;

View File

@ -12,9 +12,7 @@
using namespace mozilla::widget;
#ifdef PR_LOGGING
extern PRLogModuleInfo* gWindowsLog;
#endif
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT)
MSGFEventMsgInfo gMSGFEvents[] = {