Bug 1281387 KeyboardLayout.cpp should use LazyLogModule instead of PR_NewLogModule() for making aware of MOZ_LOG* r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 22 Jun 2016 15:39:58 +0900
changeset 380535 8c0ad2c80b809c430360020b1edfd60cf62356e6
parent 380518 b2cc9f9019956a8b20a3192eafc69a5361dfafa8
child 523748 0bc6afcfe3b317433265270f0d9d9e399d11cffb
push id21245
push usermasayuki@d-toybox.com
push dateWed, 22 Jun 2016 09:47:07 +0000
reviewersm_kato
bugs1281387
milestone50.0a1
Bug 1281387 KeyboardLayout.cpp should use LazyLogModule instead of PR_NewLogModule() for making aware of MOZ_LOG* r?m_kato MozReview-Commit-ID: LADKYU7uPcq
widget/windows/KeyboardLayout.cpp
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -2444,26 +2444,23 @@ NativeKey::DispatchKeyPressEventForFollo
 
 /*****************************************************************************
  * mozilla::widget::KeyboardLayout
  *****************************************************************************/
 
 KeyboardLayout* KeyboardLayout::sInstance = nullptr;
 nsIIdleServiceInternal* KeyboardLayout::sIdleService = nullptr;
 
-PRLogModuleInfo* sKeyboardLayoutLogger = nullptr;
+LazyLogModule sKeyboardLayoutLogger("KeyboardLayoutWidgets");
 
 // static
 KeyboardLayout*
 KeyboardLayout::GetInstance()
 {
   if (!sInstance) {
-    if (!sKeyboardLayoutLogger) {
-      sKeyboardLayoutLogger = PR_NewLogModule("KeyboardLayoutWidgets");
-    }
     sInstance = new KeyboardLayout();
     nsCOMPtr<nsIIdleServiceInternal> idleService =
       do_GetService("@mozilla.org/widget/idleservice;1");
     // The refcount will be decreased at shut down.
     sIdleService = idleService.forget().take();
   }
   return sInstance;
 }