Bug 1267526 part.0 IMMHandler and TSFTextStore should use LazyLogModule instead of PR_NewLogModule for consistency with related logs in dom/events r?m_kato
MozReview-Commit-ID: IDmV291bKsz
--- a/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -163,17 +163,17 @@ public:
virtual ~GetReconvertStringLog() {}
};
namespace mozilla {
namespace widget {
static IMMHandler* gIMMHandler = nullptr;
-PRLogModuleInfo* gIMMLog = nullptr;
+LazyLogModule gIMMLog("nsIMM32HandlerWidgets");
/******************************************************************************
* IMEContext
******************************************************************************/
IMEContext::IMEContext(HWND aWnd)
: mWnd(aWnd)
, mIMC(::ImmGetContext(aWnd))
@@ -233,19 +233,16 @@ IMMHandler::EnsureHandlerInstance()
gIMMHandler = new IMMHandler();
}
}
// static
void
IMMHandler::Initialize()
{
- if (!gIMMLog) {
- gIMMLog = PR_NewLogModule("nsIMM32HandlerWidgets");
- }
if (!sWM_MSIME_MOUSE) {
sWM_MSIME_MOUSE = ::RegisterWindowMessage(RWM_MOUSE);
}
sAssumeVerticalWritingModeNotSupported =
Preferences::GetBool(
"intl.imm.vertical_writing.always_assume_not_supported", false);
InitKeyboardLayout(nullptr, ::GetKeyboardLayout(0));
}
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -41,17 +41,17 @@ static const char* kPrefNameForceEnableT
* after that, start with:
* "TSF: 0x%p TSFFoo::Bar("
* In an internal method, start with following text:
* "TSF: 0x%p TSFFoo::Bar("
* When a static method is called, start with following text:
* "TSF: TSFFoo::Bar("
*/
-PRLogModuleInfo* sTextStoreLog = nullptr;
+LazyLogModule sTextStoreLog("nsTextStoreWidgets");
static const char*
GetBoolName(bool aBool)
{
return aBool ? "true" : "false";
}
static void
@@ -5368,20 +5368,16 @@ TSFTextStore::MarkContextAsEmpty(ITfCont
"to mark empty context 0x%p...", aContext));
comp->SetValue(sClientId, &variant_int4_value1);
}
// static
void
TSFTextStore::Initialize()
{
- if (!sTextStoreLog) {
- sTextStoreLog = PR_NewLogModule("nsTextStoreWidgets");
- }
-
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("TSF: TSFTextStore::Initialize() is called..."));
if (sThreadMgr) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: TSFTextStore::Initialize() FAILED due to already initialized"));
return;
}