diff --git a/esc-1.1.0-fix20.patch b/esc-1.1.0-fix20.patch new file mode 100644 index 0000000..11b670e --- /dev/null +++ b/esc-1.1.0-fix20.patch @@ -0,0 +1,396 @@ +diff -up ./esc/src/app/xpcom/Makefile.sdk.fix20 ./esc/src/app/xpcom/Makefile.sdk +--- ./esc/src/app/xpcom/Makefile.sdk.fix20 2015-04-07 17:29:25.406955513 -0700 ++++ ./esc/src/app/xpcom/Makefile.sdk 2015-04-07 18:32:07.330144841 -0700 +@@ -195,13 +195,13 @@ all:: export libs + + libs:: + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp -o rhIKeyNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir /tmp -o rhIKeyNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhIKeyNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir /tmp -o rhIKeyNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp -o rhICoolKey.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir /tmp -o rhICoolKey.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhICoolKey.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir /tmp -o rhICoolKey.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl + + ifeq ($(OS_ARCH),Darwin) + $(CXX) $(CPPFLAGS) -c -o $(OBJECT) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES) +@@ -257,7 +257,7 @@ $(DEPLOY_OBJDIR): + mkdir $(DEPLOY_OBJDIR) + + cd $(CORE_DEPTH)/$(DEPLOY_OFFSET)/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip +- $(XUL_FRAMEWORK_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc $(DEPLOY_OBJDIR) ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/install_app.py $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc $(DEPLOY_OBJDIR)/esc --appName esc + + ifeq ($(OS_ARCH), Darwin) + mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE) +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix20 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix20 2015-04-07 17:31:15.166792191 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2015-04-07 18:24:16.454130223 -0700 +@@ -106,21 +106,23 @@ class CoolKeyShutdownObserver : public n + NS_DECL_ISUPPORTS + NS_DECL_NSIOBSERVER + +- ~CoolKeyShutdownObserver(); ++ private: ++ ~CoolKeyShutdownObserver(); + }; + +- NS_IMPL_ISUPPORTS1(CoolKeyShutdownObserver, nsIObserver) ++ NS_IMPL_ISUPPORTS(CoolKeyShutdownObserver, nsIObserver) + + CoolKeyShutdownObserver::~CoolKeyShutdownObserver() + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n",GetTStamp(tBuff,56))); + } +- ++ ++ + NS_IMETHODIMP + CoolKeyShutdownObserver::Observe(nsISupports *aSubject, + const char *aTopic, +- const PRUnichar *someData) ++ const char16_t *someData) + { + char tBuff[56]; + if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) +@@ -1793,5 +1795,5 @@ static const mozilla::Module kCoolKeyMod + NSMODULE_DEFN(rhCoolKeyModule) = &kCoolKeyModule; + // + +-NS_IMPL_ISUPPORTS1(rhCoolKey,rhICoolKey) ++NS_IMPL_ISUPPORTS(rhCoolKey,rhICoolKey) + +diff -up ./esc/src/app/xpcom/rhCoolKey.h.fix20 ./esc/src/app/xpcom/rhCoolKey.h +--- ./esc/src/app/xpcom/rhCoolKey.h.fix20 2015-04-07 18:03:46.544134629 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.h 2015-04-07 18:25:33.828309642 -0700 +@@ -93,6 +93,7 @@ public: + rhCoolKey(); + + void ShutDownInstance(); ++private: + ~rhCoolKey(); + private: + static HRESULT Dispatch( rhICoolKey *listener, +diff -up ./esc/src/app/xpcom/tray/Makefile.sdk.fix20 ./esc/src/app/xpcom/tray/Makefile.sdk +--- ./esc/src/app/xpcom/tray/Makefile.sdk.fix20 2015-04-02 15:09:32.327346359 -0700 ++++ ./esc/src/app/xpcom/tray/Makefile.sdk 2015-04-02 15:12:17.987617741 -0700 +@@ -230,13 +230,13 @@ all:: export libs + libs:: + echo "PPC_BUILD $(PPC_BUILD)" + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITray.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir=/tmp -o rhITray.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITray.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir=/tmp -o rhITray.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITrayWindNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)//header.py --cachedir=/tmp -o rhITrayWindNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl + +- $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITrayWindNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl ++ $(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir=/tmp -o rhITrayWindNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl + + ifeq ($(OS_ARCH),Darwin) + $(CXX) $(CPPFLAGS) -c -o $(OBJECT) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES) +diff -up ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix20 ./esc/src/app/xpcom/tray/rhLinuxTray.cpp +--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix20 2015-04-07 16:15:16.840118695 -0700 ++++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2015-04-07 16:15:39.047883270 -0700 +@@ -898,5 +898,5 @@ static const mozilla::Module kCoolKeyTra + // shared library. + NSMODULE_DEFN(rhCoolKeyTrayModule) = &kCoolKeyTrayModule; + +-NS_IMPL_ISUPPORTS1(rhTray,rhITray) ++NS_IMPL_ISUPPORTS(rhTray,rhITray) + +diff -up ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix20 ./esc/src/app/xul/esc/chrome/content/esc/ESC.js +--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix20 2015-04-09 17:58:37.203518142 -0700 ++++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2015-04-09 18:00:19.302492123 -0700 +@@ -57,6 +57,7 @@ const ESC_SECURITY_URL="esc.security.ur + const ESC_SECURE_URL="esc.secure.url"; + const ESC_GLOBAL_PHONE_HOME_URL= "esc.global.phone.home.url"; + const ESC_HIDE_FORMAT="esc.hide.format"; ++const ESC_ALLOW_NOTIFICATIONS="esc.allow.notifications"; + + const CLEAN_TOKEN = "cleanToken"; + const UNINITIALIZED = 1; +@@ -76,6 +77,7 @@ const ENROLL_WINDOW = "esc.xul"; + const ADMIN_WINDOW = "settings.xul"; + const HIDDEN_WINDOW = "hiddenWindow.xul"; + const SECURITY_WINDOW = "security.xul"; ++const PHONE_WINDOW = "config.xul"; + + + //Log level constants +@@ -230,10 +232,14 @@ var Status_Messages = new Array( + function DoPhoneHome(keyType,keyID) + { + CoolKeyLogMsg(PR_LOG_ALWAYS,"Attempting to phone home for Key " + keyID); ++ var allowNotify = null; + var callback = function (aResult) { + + recordMessage("In DoPhoneHome callback"); + ++ var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS); ++ ++ + var issuer = ""; + if(aResult == true) + { +@@ -241,7 +247,10 @@ function DoPhoneHome(keyType,keyID) + if(!issuer) + issuer = getBundleString("unknownIssuer"); + recordMessage("In DoPhoneHome callback success issuer " + issuer); +- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ ++ if(allowNotify == "yes") { ++ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ } + LogKeyInfo(keyType,keyID,"Key Inserted ..."); + UpdateRowWithPhoneHomeData(keyType,keyID); + recordMessage("cached issuer " + issuer); +@@ -262,7 +271,9 @@ function DoPhoneHome(keyType,keyID) + if(!issuer) + issuer = getBundleString("unknownIssuer"); + recordMessage("Phone home callback failed , issuer " + issuer); +- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ if (allowNotify == "yes") { ++ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ } + LogKeyInfo(keyType,keyID,"Key Inserted ..."); + } + } +@@ -271,6 +282,7 @@ function DoPhoneHome(keyType,keyID) + + var home = DoCoolKeyGetIssuerUrl(keyType,keyID); + ++ //home = null; + recordMessage("Returned IssuerURL " + home); + + if(IsPhoneHomeCached(keyID) && home) +@@ -279,7 +291,12 @@ function DoPhoneHome(keyType,keyID) + + recordMessage("Phone home info cached..."); + issuer = GetCoolKeyIssuer(keyType,keyID); +- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ ++ allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS); ++ if (allowNotify == "yes") { ++ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ } ++ + LogKeyInfo(keyType,keyID,"Key Inserted ..."); + + var launchBrowserURL = GetCachedEnrolledTokenBrowserURL(keyID); +@@ -534,7 +551,11 @@ function GetAuthDataFromPopUp(aKeyType,a + keyUITable[aKeyID] = aUiData; + keyTypeTable[aKeyID] = aKeyType; + +- var child = window.open("chrome://esc/content/GenericAuth.xul", aKeyID, "chrome,centerscreen,width=400,height=250"); ++ var child = window.open("chrome://esc/content/GenericAuth.xul", aKeyID, "chrome,centerscreen,width=400,height=250,dialog"); ++ ++ if (child) { ++ child.setTimeout("focus()", 1000); ++ } + + curChildWindow = child; + } +@@ -1275,7 +1296,7 @@ function UpdateEnrollmentArea(keyType,ke + + var numUnenrolledKeys = DoGetNumUnenrolledCoolKeys(); + +- //alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys); ++ // alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys); + + + var ui_id = document.getElementById("esc-ui"); +@@ -1290,7 +1311,7 @@ function UpdateEnrollmentArea(keyType,ke + { + if(!numUnenrolledKeys) + { +- ui_id.setAttribute("src",null); ++ ui_id.setAttribute("src",""); + } + else + { +@@ -1427,14 +1448,19 @@ function UpdateEnrollmentArea(keyType,ke + HideItem(no_key_area); + } + ++ + if(!alreadyEnrolled && inserted && showExternalUI) + { + UpdateESCSize(); ++ gEnrollmentPage.setTimeout("focus();",3500); + return; + } + + if(!showExternalUI) + UpdateESCSize(); ++ ++ gEnrollmentPage.setTimeout("focus();",3500); ++ + } + + //Evaulate Password Quality +@@ -2006,7 +2032,7 @@ function SelectESCPage(keyType,keyID,pho + break; + } + +- //alert("SelectESCPage initialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage); ++ //alert("SelectESCPage uninitialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage + " phoneHomeFailed " + phoneHomeFailed + " no_launch_external_ui " + no_launch_external_ui); + + //Get the primary page windows if present + +@@ -2022,14 +2048,7 @@ function SelectESCPage(keyType,keyID,pho + + if(keyUninitialized == UNINITIALIZED && !phoneHomeFailed && !no_launch_external_ui ) //formatted uninitialized card + { +- if(enrollWnd) //Enrollment window is already up +- { +- enrollWnd.focus(); +- } +- else +- { +- launchESC(); +- } ++ launchESC(); + } + else + { +@@ -2975,8 +2994,9 @@ function OnCoolKeyInserted(keyType, keyI + + var uninitialized = 0; + +- recordMessage("Key inserted!" + "Window " + IdentifyWindow()); ++ var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS); + ++ recordMessage("Key inserted!" + "Window " + IdentifyWindow()); + if(gHiddenPage) + { + TrayShowNotificationIcon(); +@@ -2993,6 +3013,7 @@ function OnCoolKeyInserted(keyType, keyI + + gCurrentSelectedRow = row; + UpdateEnrollmentArea(keyType,keyID,1); ++ + } + + if(gAdminPage) +@@ -3017,7 +3038,9 @@ function OnCoolKeyInserted(keyType, keyI + if(!issuer ) + issuer = getBundleString("unknownIssuer"); + +- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ if( allowNotify) { ++ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID)); ++ } + + } + +@@ -3037,6 +3060,8 @@ function OnCoolKeyRemoved(keyType, keyID + + var row = GetRowForKey(keyType, keyID); + ++ var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS); ++ + if(gHiddenPage) + { + if(curChildWindow) +@@ -3047,7 +3072,9 @@ function OnCoolKeyRemoved(keyType, keyID + var issuer = GetCoolKeyIssuer(keyType,keyID); + if(!issuer) + issuer = getBundleString("unknownIssuer"); +- TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" + issuer + "\"" + " " + getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID)); ++ if (allowNotify == "yes") { ++ TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" + issuer + "\"" + " " + getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID)); ++ } + LogKeyInfo(keyType,keyID, "Key Removed ..."); + + } +@@ -3345,6 +3372,7 @@ uiListener = + + if(url != esc_enroll_uri) + { ++ + MyAlert(getBundleString("errorEnrollmentUI")); + + if(uiListener) +@@ -3978,17 +4006,24 @@ function launchCONFIG(keyType,keyID) + platform = "mac"; + } + +- var wind = null; ++ var wind = IsPageWindowPresent(PHONE_WINDOW); + +- if(platform == "mac") +- { +- wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=no"); +- } +- else +- { +- wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=yes"); ++ if (!wind) { ++ if(platform == "mac") ++ { ++ wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=no"); ++ } ++ else ++ { ++ wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable"); ++ ++ } ++ } + ++ if(wind) { ++ wind.setTimeout("focus();",1500); + } ++ + } + + //Launch cert viewer if key has certs +@@ -4021,7 +4056,7 @@ function launchCertViewerIfCerts() + //Launch page to view card's certificates + function launchCertViewer() + { +- var wind = window.openDialog("chrome://esc/content/certManager.xul", "","chrome,centerscreen,modal=yes"); ++ var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes"); + } + + //Launch ESC admin page window +@@ -4046,12 +4081,12 @@ function launchESC() + + if(!enrollWnd) + { +- var wind = window.open("chrome://esc/content/esc.xul","","chrome,resizable,centerscreen,dialog"); ++ enrollWnd = window.open("chrome://esc/content/esc.xul","","chrome,resizable,centerscreen,dialog"); + + } +- else +- { +- enrollWnd.focus(); ++ ++ if(enrollWnd) { ++ enrollWnd.setTimeout("focus();",1500); + } + + } +diff -up ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js.fix20 ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js +--- ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js.fix20 2015-04-09 18:01:00.074082399 -0700 ++++ ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js 2015-04-09 18:03:45.160423403 -0700 +@@ -29,6 +29,10 @@ pref("esc.tps.message.timeout","90"); + + pref("esc.windows.do.capi","yes"); + ++#Do we allow card notifications? Default no. ++ ++pref("esc.allow.notifications", "yes"); ++ + + #Sample Security Officer Enrollment UI + diff --git a/esc-1.1.0-fix21.patch b/esc-1.1.0-fix21.patch new file mode 100644 index 0000000..2be5f75 --- /dev/null +++ b/esc-1.1.0-fix21.patch @@ -0,0 +1,21 @@ +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix21 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix21 2016-02-08 14:21:39.963531067 -0800 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2016-02-08 14:22:04.811322599 -0800 +@@ -1237,7 +1237,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertN + char **array = NULL; + int num = nicknames.size(); + +- array = (char **) nsMemory::Alloc((sizeof(char *) *num)); ++ array = (char **) NS_Alloc((sizeof(char *) *num)); + + if(!array) + { +@@ -1291,7 +1291,7 @@ NS_IMETHODIMP rhCoolKey::GetAvailableCoo + return NS_OK; + } + +- array = (char **) nsMemory::Alloc((sizeof(char *) * numKeys)); ++ array = (char **) NS_Alloc((sizeof(char *) * numKeys)); + + if(!array) + { diff --git a/esc-1.1.0-fix22.patch b/esc-1.1.0-fix22.patch new file mode 100644 index 0000000..c27a924 --- /dev/null +++ b/esc-1.1.0-fix22.patch @@ -0,0 +1,1124 @@ +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix22 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix22 2016-02-08 15:47:47.267977290 -0800 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2016-02-08 16:23:44.573047791 -0800 +@@ -15,7 +15,7 @@ + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +-#define FORCE_PR_LOG 1 ++#define FORCE_MOZ_LOG 1 + #define nsnull NULL + #include + #include "rhCoolKey.h" +@@ -23,6 +23,7 @@ + #include "nsMemory.h" + + #include "nsXPCOM.h" ++#include "mozilla/Logging.h" + #include "nsIComponentManager.h" + #include "nsIComponentRegistrar.h" + #ifdef XP_MACOSX +@@ -45,6 +46,7 @@ + #include + #include + ++using namespace mozilla; + + #define STRINGIFY(x) #x + #define GETSTRING(x) STRINGIFY(x) +@@ -115,7 +117,7 @@ class CoolKeyShutdownObserver : public n + CoolKeyShutdownObserver::~CoolKeyShutdownObserver() + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n",GetTStamp(tBuff,56))); + } + + +@@ -127,7 +129,7 @@ class CoolKeyShutdownObserver : public n + char tBuff[56]; + if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) + { +- PR_LOG(coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyShutdownObserver::Observe shutting down",GetTStamp(tBuff,56))); ++ MOZ_LOG(coolKeyLog, LogLevel::Debug, ("%s CoolKeyShutdownObserver::Observe shutting down",GetTStamp(tBuff,56))); + if(single) + { + single->ShutDownInstance(); +@@ -171,7 +173,7 @@ public: + ~CoolKeyResultTask() { + + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s ~CoolKeyResultTask thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s ~CoolKeyResultTask thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if (mKeyID) { + free(mKeyID); +@@ -204,7 +206,7 @@ public: + + char tBuff[56]; + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::CoolKeyResultTask thread: %p keyID %s \n",GetTStamp(tBuff,56),PR_GetCurrentThread(),mKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s CoolKeyResultTask::CoolKeyResultTask thread: %p keyID %s \n",GetTStamp(tBuff,56),PR_GetCurrentThread(),mKeyID)); + + } + +@@ -213,7 +215,7 @@ public: + MOZ_ASSERT(NS_IsMainThread()); + + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::Run thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s CoolKeyResultTask::Run thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if (mListener != NULL) { + mListener->RhNotifyKeyStateChange(mKeyType, mKeyID, mKeyState, +@@ -244,7 +246,7 @@ rhCoolKey::rhCoolKey() + :mJsNotify(nsnull),mProxy(nsnull) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::rhCoolKey: %p \n",GetTStamp(tBuff,56),this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::rhCoolKey: %p \n",GetTStamp(tBuff,56),this)); + + if(!single) + { +@@ -263,14 +265,14 @@ rhCoolKey::rhCoolKey() + certCBLock = PR_NewLock(); + + if(!certCBLock) { +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Failed to create lock exiting! \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Failed to create lock exiting! \n",GetTStamp(tBuff,56))); + exit(1); + } + + eventLock = PR_NewLock(); + + if(!eventLock) { +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Failed to create event lock exiting! \n", GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Error, ("%s Failed to create event lock exiting! \n", GetTStamp(tBuff,56))); + exit(1); + } + +@@ -279,7 +281,7 @@ rhCoolKey::rhCoolKey() + + if(res == PR_FALSE) + { +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s ESC InitInstance failed,exiting. CoolKey instance %p\n",GetTStamp(tBuff,56),coolKey_instance)); ++ MOZ_LOG( coolKeyLog, LogLevel::Error, ("%s ESC InitInstance failed,exiting. CoolKey instance %p\n",GetTStamp(tBuff,56),coolKey_instance)); + exit(1); + } + +@@ -291,7 +293,7 @@ rhCoolKey::~rhCoolKey() + /* destructor code */ + + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::~rhCoolKey: %p \n",GetTStamp(tBuff,56),this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::~rhCoolKey: %p \n",GetTStamp(tBuff,56),this)); + + if(certCBLock) { + PR_DestroyLock(certCBLock); +@@ -305,11 +307,11 @@ rhCoolKey::~rhCoolKey() + void rhCoolKey::ShutDownInstance() + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ShutDownInstance. %p \n",GetTStamp(tBuff,56),this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ShutDownInstance. %p \n",GetTStamp(tBuff,56),this)); + + if (mProxy) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",GetTStamp(tBuff,56),mProxy)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",GetTStamp(tBuff,56),mProxy)); + + CoolKeyUnregisterListener(mProxy); + +@@ -338,7 +340,7 @@ HRESULT rhCoolKey::Dispatch( rhICoolKey + char tBuff[56]; + + PR_Lock(eventLock); +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::Dispatch: thead: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::Dispatch: thead: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + nsCOMPtr result = new CoolKeyResultTask(keyType, keyID,keyState, data, strData, listener); + + NS_DispatchToMainThread(result); +@@ -448,7 +450,7 @@ SECStatus rhCoolKey::badCertHandler(void + return secStatus; + } + +- PR_LOG(coolKeyLog, PR_LOG_DEBUG, ++ MOZ_LOG(coolKeyLog, LogLevel::Debug, + ("%s rhCoolKey::badCertHandler enter: error: %d url: %s port: %d \n", + GetTStamp(tBuff,56),err,host,port) + ); +@@ -474,7 +476,7 @@ SECStatus rhCoolKey::badCertHandler(void + &isTemporaryOverride,&overrideResult + ); + if(nsrv == NS_OK) { +- PR_LOG(coolKeyLog, PR_LOG_DEBUG, ++ MOZ_LOG(coolKeyLog, LogLevel::Debug, + ("%s rhCoolKey::badCertHandler res %d print %s len %d bits %u temp %d alg: %s \n", + GetTStamp(tBuff,56),overrideResult,fingerPrint.get(), + fingerPrint.Length(),overrideBits, isTemporaryOverride,hashAlg.get()) +@@ -530,7 +532,7 @@ SECStatus rhCoolKey::badCertHandler(void + if(!PL_strcmp(formattedPrint, inputPrint)) + certMatches = PR_TRUE; + } +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s certMatches: %d \n", ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s certMatches: %d \n", + GetTStamp(tBuff,56),certMatches) + ); + +@@ -539,7 +541,7 @@ SECStatus rhCoolKey::badCertHandler(void + formattedPrint = NULL; + } + } else { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s override test failed. \n", ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s override test failed. \n", + GetTStamp(tBuff,56)) + ); + } +@@ -622,7 +624,7 @@ PRBool rhCoolKey::InitInstance() + char tBuff[56]; + PRBool ret = PR_TRUE; + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::InitInstance %p \n",GetTStamp(tBuff,56),this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::InitInstance %p \n",GetTStamp(tBuff,56),this)); + + nssComponent + = do_GetService(PSM_COMPONENT_CONTRACTID); +@@ -637,7 +639,7 @@ PRBool rhCoolKey::InitInstance() + } + else + { +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Can't create Proxy Object for ESC. \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Can't create Proxy Object for ESC. \n",GetTStamp(tBuff,56))); + } + + #ifdef XP_WIN32 +@@ -691,7 +693,7 @@ PRBool rhCoolKey::InitInstance() + + observerService->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE); + } else { +- PR_LOG(coolKeyLog,PR_LOG_ERROR,("%s Could not get an observer service. We will leak on shutdown.",GetTStamp(tBuff,56))); ++ MOZ_LOG(coolKeyLog,LogLevel::Error,("%s Could not get an observer service. We will leak on shutdown.",GetTStamp(tBuff,56))); + } + + return ret; +@@ -707,12 +709,12 @@ rhICoolKey* rhCoolKey::CreateProxyObject + CoolKeyNode* rhCoolKey::GetCoolKeyInfo(unsigned long aKeyType, const char * aKeyID) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",GetTStamp(tBuff,56),&gASCAvailableKeys,aKeyID,aKeyType)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",GetTStamp(tBuff,56),&gASCAvailableKeys,aKeyID,aKeyType)); + + std::list::const_iterator it; + for(it=gASCAvailableKeys.begin(); it!=gASCAvailableKeys.end(); ++it) { + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",GetTStamp(tBuff,56),(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",GetTStamp(tBuff,56),(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType)); + + if ((*it)->mKeyType == aKeyType && !strcmp((*it)->mKeyID.get(), aKeyID)) + return *it; +@@ -726,7 +728,7 @@ CoolKeyNode* rhCoolKey::GetCoolKeyInfo(u + PRBool rhCoolKey::ASCCoolKeyIsAvailable(unsigned long aKeyType, char * aKeyID) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID)); + return GetCoolKeyInfo(aKeyType, aKeyID) ? PR_TRUE : PR_FALSE; + } + +@@ -735,7 +737,7 @@ HRESULT rhCoolKey::ASCGetAvailableCoolK + nsEmbedCString *aKeyID) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",GetTStamp(tBuff,56),aIndex,aKeyType,aKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",GetTStamp(tBuff,56),aIndex,aKeyType,aKeyID)); + if (!aKeyType || !aKeyID) + return E_FAIL; + +@@ -762,7 +764,7 @@ int rhCoolKey::ASCGetNumAvailableCoolK + { + char tBuff[56]; + int size = (int) gASCAvailableKeys.size(); +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",GetTStamp(tBuff,56),size)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",GetTStamp(tBuff,56),size)); + return size; + + } +@@ -776,21 +778,21 @@ int rhCoolKey::GetNotifyKeyListenerListS + rhIKeyNotify* rhCoolKey::GetNotifyKeyListener(rhIKeyNotify *listener){ + + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetNotifyKeyListener: %p size %d \n",GetTStamp(tBuff,56),listener,gNotifyListeners.size() )); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetNotifyKeyListener: %p size %d \n",GetTStamp(tBuff,56),listener,gNotifyListeners.size() )); + + std::list >::const_iterator it; + for(it=gNotifyListeners.begin(); it!=gNotifyListeners.end(); ++it) { + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",GetTStamp(tBuff,56),(*it).get(),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",GetTStamp(tBuff,56),(*it).get(),listener)); + + if((*it) == listener) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",GetTStamp(tBuff,56),listener,(*it).get())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",GetTStamp(tBuff,56),listener,(*it).get())); + return (*it); + } + } + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",GetTStamp(tBuff,56),listener)); + + return nsnull; + } +@@ -798,11 +800,11 @@ rhIKeyNotify* rhCoolKey::GetNotifyKeyLis + void rhCoolKey::AddNotifyKeyListener(rhIKeyNotify *listener) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::AddNotifyKeyListener: %p \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::AddNotifyKeyListener: %p \n",GetTStamp(tBuff,56),listener)); + + if(GetNotifyKeyListener(listener )) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::AddNotifyKeyListener: %p listener already in list. \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::AddNotifyKeyListener: %p listener already in list. \n",GetTStamp(tBuff,56),listener)); + + return ; + } +@@ -813,11 +815,11 @@ void rhCoolKey::AddNotifyKeyListener(rhI + void rhCoolKey::RemoveNotifyKeyListener(rhIKeyNotify *listener) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RemoveNotifyKeyListener: %p \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RemoveNotifyKeyListener: %p \n",GetTStamp(tBuff,56),listener)); + + if(!GetNotifyKeyListener(listener )) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RemoveNotifyKeyListener: %p trying to remove listener not in list \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RemoveNotifyKeyListener: %p trying to remove listener not in list \n",GetTStamp(tBuff,56),listener)); + + return ; + } +@@ -830,7 +832,7 @@ void rhCoolKey::RemoveNotifyKeyListener( + void rhCoolKey::ClearNotifyKeyList() + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ClearNotifyKeyList: \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ClearNotifyKeyList: \n",GetTStamp(tBuff,56))); + + while (gNotifyListeners.size() > 0) { + rhIKeyNotify * node = (gNotifyListeners.front()).get(); +@@ -845,10 +847,10 @@ void rhCoolKey::ClearNotifyKeyList() + void rhCoolKey::InsertKeyIntoAvailableList(unsigned long aKeyType, const char * aKeyID,CoolKeyStatus aStatus) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::InsertKeyIntoAvailableList: \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::InsertKeyIntoAvailableList: \n",GetTStamp(tBuff,56))); + if (ASCCoolKeyIsAvailable(aKeyType, (char *)aKeyID)) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::InsertKeyIntoAvailableList: Key Not Available \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::InsertKeyIntoAvailableList: Key Not Available \n",GetTStamp(tBuff,56))); + + return; + } +@@ -857,7 +859,7 @@ void rhCoolKey::InsertKeyIntoAvailableLi + + if (!node) + { +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Can't create new CoolKey Data Structure. \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Error, ("%s Can't create new CoolKey Data Structure. \n",GetTStamp(tBuff,56))); + return; + } + +@@ -868,7 +870,7 @@ void rhCoolKey::InsertKeyIntoAvailableLi + void rhCoolKey::RemoveKeyFromAvailableList(unsigned long aKeyType, const char * aKeyID) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID)); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if (!node) +@@ -881,7 +883,7 @@ void rhCoolKey::RemoveKeyFromAvailableLi + void rhCoolKey::ClearAvailableList() + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ClearAvailableList \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ClearAvailableList \n",GetTStamp(tBuff,56))); + while (gASCAvailableKeys.size() > 0) { + CoolKeyNode *node = gASCAvailableKeys.front(); + delete node; +@@ -892,7 +894,7 @@ void rhCoolKey::ClearAvailableList() + HRESULT rhCoolKey::ASCSetCoolKeyPin(unsigned long aKeyType, const char * aKeyID, const char * aPin) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID,aPin)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",GetTStamp(tBuff,56),aKeyType,aKeyID,aPin)); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + if (!node) + return E_FAIL; +@@ -906,7 +908,7 @@ HRESULT rhCoolKey::ASCSetCoolKeyPin(unsi + NS_IMETHODIMP rhCoolKey::RhNotifyKeyStateChange(PRUint32 aKeyType,const char *aKeyID, PRUint32 aKeyState, PRUint32 aData,const char* strData) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",GetTStamp(tBuff,56),aKeyID,aKeyType, aKeyState,aData)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",GetTStamp(tBuff,56),aKeyID,aKeyType, aKeyState,aData)); + + CoolKeyNode tempKey(aKeyType, aKeyID,(CoolKeyStatus) aKeyState); + CoolKeyNode *node = NULL; +@@ -924,12 +926,12 @@ NS_IMETHODIMP rhCoolKey::RhNotifyKeyStat + if (CoolKeyIsEnrolled(&key)) + keyStatus = eAKS_Available; else if (CoolKeyHasApplet(&key)) keyStatus = eAKS_Uninitialized; + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s Key Inserted. ID %s \n",GetTStamp(tBuff,56),aKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Key Inserted. ID %s \n",GetTStamp(tBuff,56),aKeyID)); + InsertKeyIntoAvailableList(tempKey.mKeyType,aKeyID ,(CoolKeyStatus) keyStatus); + break; + } + case eCKState_KeyRemoved: +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s Key Removed. ID %s \n",GetTStamp(tBuff,56),aKeyID)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Key Removed. ID %s \n",GetTStamp(tBuff,56),aKeyID)); + RemoveKeyFromAvailableList(tempKey.mKeyType, aKeyID); + break; + case eCKState_EnrollmentComplete: +@@ -968,7 +970,7 @@ NS_IMETHODIMP rhCoolKey::RhNotifyKeyStat + + ((rhIKeyNotify *) (*it))->RhNotifyKeyStateChange(aKeyType,aKeyID,aKeyState,aData,strData); + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhNotifyKeyStateChange after call to RhNotifyKeyStateChange listener: %p",GetTStamp(tBuff,56),(*it).get())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhNotifyKeyStateChange after call to RhNotifyKeyStateChange listener: %p",GetTStamp(tBuff,56),(*it).get())); + + } + +@@ -978,15 +980,15 @@ NS_IMETHODIMP rhCoolKey::RhNotifyKeyStat + NS_IMETHODIMP rhCoolKey::RhCoolKeyUnSetNotifyCallback(rhIKeyNotify *jsNotify) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",GetTStamp(tBuff,56),jsNotify,this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",GetTStamp(tBuff,56),jsNotify,this)); + + RemoveNotifyKeyListener(jsNotify); + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetTStamp(tBuff,56),GetNotifyKeyListenerListSize())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetTStamp(tBuff,56),GetNotifyKeyListenerListSize())); + + if(GetNotifyKeyListenerListSize() == 0) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",GetTStamp(tBuff,56),jsNotify,this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",GetTStamp(tBuff,56),jsNotify,this)); + } + + return NS_OK; +@@ -995,7 +997,7 @@ NS_IMETHODIMP rhCoolKey::RhCoolKeyUnSetN + NS_IMETHODIMP rhCoolKey::RhCoolKeySetNotifyCallback(rhIKeyNotify *jsNotify) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",GetTStamp(tBuff,56),jsNotify,this)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",GetTStamp(tBuff,56),jsNotify,this)); + + AddNotifyKeyListener(jsNotify); + +@@ -1012,14 +1014,14 @@ NS_IMETHODIMP rhCoolKey::CoolKeyInitiali + } + + /* void CoolKeyLogMsg (in unsigned long aLogLevel, in string aMessage); */ +-NS_IMETHODIMP rhCoolKey::CoolKeyLogMsg(PRUint32 aLogLevel, const char *aMessage) ++NS_IMETHODIMP rhCoolKey::CoolKeyLogMsg(unsigned int aLogLevel, const char *aMessage) + { + char tBuff[56]; + +- if(aMessage && ((PRLogModuleLevel) aLogLevel >= PR_LOG_NONE && aLogLevel <= PR_LOG_MAX)) ++ if(aMessage ) + { +- ::CoolKeyLogMsg((PRLogModuleLevel) aLogLevel, "%s %s \n",GetTStamp(tBuff,56),aMessage); +- PR_LOG( coolKeyLog, (PRLogModuleLevel) aLogLevel, ("%s %s",GetTStamp(tBuff,56),aMessage)); ++ ///::CoolKeyLogMsg(Level, "%s %s \n",GetTStamp(tBuff,56),aMessage); ++ MOZ_LOG( coolKeyLog, LogLevel::Error, ("%s %s",GetTStamp(tBuff,56),aMessage)); + } + + return NS_OK; +@@ -1028,13 +1030,13 @@ NS_IMETHODIMP rhCoolKey::CoolKeyLogMsg(P + NS_IMETHODIMP rhCoolKey::BlinkCoolKey(PRUint32 aKeyType, const char *aKeyID, PRUint32 aRate, PRUint32 aDuration) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhBlinkCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhBlinkCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if (!node) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n",GetTStamp(tBuff,56))); + return NS_ERROR_FAILURE; + } + +@@ -1062,7 +1064,7 @@ NS_IMETHODIMP rhCoolKey::EnrollCoolKey(P + { + + char tBuff[56]; +- ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Enroll Key ,ID: %s \n",GetTStamp(tBuff,56),aKeyID); ++ ::CoolKeyLogMsg(1, "%s Attempting to Enroll Key ,ID: %s \n",GetTStamp(tBuff,56),aKeyID); + + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + +@@ -1094,12 +1096,12 @@ NS_IMETHODIMP rhCoolKey::EnrollCoolKey(P + NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN(PRUint32 aKeyType, const char *aKeyID, const char *aScreenName, const char *aPIN, const char *aScreenNamePwd) + { + char tBuff[56]; +- ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Reset Key Password, ID: %s \n",GetTStamp(tBuff,56),aKeyID); ++ ::CoolKeyLogMsg( 1, "%s Attempting to Reset Key Password, ID: %s \n",GetTStamp(tBuff,56),aKeyID); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if (!node) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhResetCoolKeyPIN no node: thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhResetCoolKeyPIN no node: thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + return NS_ERROR_FAILURE; + } + +@@ -1114,7 +1116,7 @@ NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN + + if (node->mStatus != eAKS_Available) + { +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhResetCoolKeyPIN thread: token unavailable %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhResetCoolKeyPIN thread: token unavailable %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + return NS_ERROR_FAILURE; + } + +@@ -1136,7 +1138,7 @@ NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN + NS_IMETHODIMP rhCoolKey::RenewCoolKey(PRUint32 aKeyType, const char *aKeyID) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Error, ("%s rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + return NS_ERROR_NOT_IMPLEMENTED; + } + +@@ -1145,7 +1147,7 @@ NS_IMETHODIMP rhCoolKey::RenewCoolKey(PR + NS_IMETHODIMP rhCoolKey::FormatCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPIN, const char *aScreenNamePWord, const char *aTokenCode) + { + char tBuff[56]; +- ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Format Key, ID: %s. ",GetTStamp(tBuff,56),aKeyID); ++ ::CoolKeyLogMsg( 1, "%s Attempting to Format Key, ID: %s. ",GetTStamp(tBuff,56),aKeyID); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if (!node) +@@ -1193,7 +1195,7 @@ NS_IMETHODIMP rhCoolKey::CancelCoolKeyOp + if (!node) + return NS_ERROR_FAILURE; + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCancelCoolKeyOperation type %d id %s status %d: \n",GetTStamp(tBuff,56),aKeyType,aKeyID,node->mStatus)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCancelCoolKeyOperation type %d id %s status %d: \n",GetTStamp(tBuff,56),aKeyType,aKeyID,node->mStatus)); + + // If the key isn't busy, then there's nothing to do. + +@@ -1250,7 +1252,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertN + { + char *tName = (char *) (*i).c_str(); + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyCertNicknames name %s \n",GetTStamp(tBuff,56),tName)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyCertNicknames name %s \n",GetTStamp(tBuff,56),tName)); + + array[j] = NULL; + if(tName) +@@ -1273,7 +1275,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertN + NS_IMETHODIMP rhCoolKey::GetAvailableCoolKeys(PRUint32 *count, char ***str) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetAvailableCoolKeys thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetAvailableCoolKeys thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if(!count || !str) + { +@@ -1284,7 +1286,7 @@ NS_IMETHODIMP rhCoolKey::GetAvailableCoo + + long numKeys = ASCGetNumAvailableCoolKeys(); + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s Attempting to get number of keys. Value: %d \n",GetTStamp(tBuff,56),numKeys)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Attempting to get number of keys. Value: %d \n",GetTStamp(tBuff,56),numKeys)); + + if(numKeys == 0) + { +@@ -1334,7 +1336,7 @@ NS_IMETHODIMP rhCoolKey::GetAvailableCoo + NS_IMETHODIMP rhCoolKey::GetCoolKeyStatus(PRUint32 aKeyType, const char *aKeyID, PRUint32 *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyStatus thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetCoolKeyStatus thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if(node) +@@ -1346,7 +1348,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyStatu + *_retval = eAKS_Unavailable; + } + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyStatus retval: %d \n",GetTStamp(tBuff,56),*_retval)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetCoolKeyStatus retval: %d \n",GetTStamp(tBuff,56),*_retval)); + + return NS_OK; + } +@@ -1358,13 +1360,13 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyStatu + NS_IMETHODIMP rhCoolKey::GetCoolKeyIsReallyCoolKey(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if (aKeyType && aKeyID && ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) { + if (aKeyID) { + AutoCoolKey key(aKeyType, aKeyID); + PRBool isCool = CoolKeyIsReallyCoolKey(&key); +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey isCool: %d \n",GetTStamp(tBuff,56),(int) isCool)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey isCool: %d \n",GetTStamp(tBuff,56),(int) isCool)); + *_retval= isCool; + return NS_OK; + } +@@ -1377,7 +1379,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIsRea + NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAppletVer(PRUint32 aKeyType, const char *aKeyID, bool aIsMajor, PRInt32 *_retval) + { + char tBuff[56]; +- PR_LOG(coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyAppletVer thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG(coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyAppletVer thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + AutoCoolKey key(aKeyType, aKeyID); + +@@ -1393,7 +1395,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAp + NS_IMETHODIMP rhCoolKey::GetCoolKeyIsEnrolled(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyIsEnrolled thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeyIsEnrolled thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + if (ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) { + + if (aKeyID) { +@@ -1416,7 +1418,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertI + string certInfo = ""; + *aCertInfo = NULL; + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyCertInfo thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyCertInfo thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + AutoCoolKey key(aKeyType, aKeyID); + +@@ -1441,7 +1443,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertI + AutoCoolKey key(aKeyType, aKeyID); + char atr[128]; + HRESULT res = CoolKeyGetATR(&key, (char *)&atr,sizeof(atr)); +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s Attempting to get the key's ATR: Key: %s, ATR %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) atr)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s Attempting to get the key's ATR: Key: %s, ATR %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) atr)); + if(res == S_OK) + { + char *temp = (char *) nsMemory::Clone(atr,sizeof(char) * strlen((char *)atr) + 1); +@@ -1466,7 +1468,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertI + + tokenName = (char *) CoolKeyGetTokenName(&key); + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyTokenName %s \n",GetTStamp(tBuff,56),tokenName)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyTokenName %s \n",GetTStamp(tBuff,56),tokenName)); + if(tokenName) + { + char *temp = (char *) nsMemory::Clone(tokenName,sizeof(char) * strlen((char *)tokenName) + 1); +@@ -1489,7 +1491,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertI + + HRESULT res = CoolKeyGetIssuerInfo(&key, (char *)&issuerInfo,256); + +- ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) issuerInfo); ++ ::CoolKeyLogMsg( 1, "%s Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) issuerInfo); + + if(res == S_OK) + { +@@ -1505,7 +1507,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyCertI + NS_IMETHODIMP rhCoolKey::GetCoolKeyPolicy(PRUint32 aKeyType, const char *aKeyID, char **policy) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyPolicy thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetCoolKeyPolicy thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if (!aKeyID) { + return NS_ERROR_FAILURE; +@@ -1517,14 +1519,14 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyPolic + AutoCoolKey key(aKeyType, aKeyID); + HRESULT hres = CoolKeyGetPolicy(&key, policyChar, MAX_STR_LEN); + +- PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyPolicy hres: %d \n",GetTStamp(tBuff,56),hres)); ++ MOZ_LOG(coolKeyLog,LogLevel::Debug,("%s rhCoolKey::RhGetCoolKeyPolicy hres: %d \n",GetTStamp(tBuff,56),hres)); + if (hres == E_FAIL) + { + return NS_ERROR_FAILURE; + + } + +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyPolicy policy: %s \n",GetTStamp(tBuff,56),policyChar)); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetCoolKeyPolicy policy: %s \n",GetTStamp(tBuff,56),policyChar)); + + char *temp = (char *) nsMemory::Clone(policyChar,sizeof(char) * strlen(policyChar) + 1); + +@@ -1554,7 +1556,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyUID(P + return NS_OK; + } + +- PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetUID %s \n",GetTStamp(tBuff,56),(char *) buff)); ++ MOZ_LOG(coolKeyLog,LogLevel::Debug,("%s rhCoolKey::RhGetCoolKeyGetUID %s \n",GetTStamp(tBuff,56),(char *) buff)); + + char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1); + +@@ -1588,7 +1590,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssue + return NS_OK; + } + +- PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetIssuedTo %s \n",GetTStamp(tBuff,56),(char *) buff)); ++ MOZ_LOG(coolKeyLog,LogLevel::Debug,("%s rhCoolKey::RhGetCoolKeyGetIssuedTo %s \n",GetTStamp(tBuff,56),(char *) buff)); + + char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1); + +@@ -1621,7 +1623,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssue + return NS_OK; + } + +- PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetIssuer %s \n",GetTStamp(tBuff,56),(char *) buff)); ++ MOZ_LOG(coolKeyLog,LogLevel::Debug,("%s rhCoolKey::RhGetCoolKeyGetIssuer %s \n",GetTStamp(tBuff,56),(char *) buff)); + + char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1); + +@@ -1635,7 +1637,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssue + NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::SetCoolKeyConfigValue thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("rhCoolKey::SetCoolKeyConfigValue thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + if(!aName || !aValue) + { + *_retval = 0; +@@ -1651,7 +1653,7 @@ NS_IMETHODIMP rhCoolKey::SetCoolKeyConfi + NS_IMETHODIMP rhCoolKey::GetCoolKeyConfigValue(const char *aName, char **_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyConfigValue thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyConfigValue thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + + if(!aName) + { +@@ -1669,7 +1671,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyConfi + NS_IMETHODIMP rhCoolKey::GetCoolKeyRequiresAuthentication(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyRequiresAuthentication thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhCoolKeyRequiresAuthentication thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + PRBool requiresAuth = PR_FALSE; + + *_retval = PR_TRUE; +@@ -1689,7 +1691,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyRequi + NS_IMETHODIMP rhCoolKey::GetCoolKeyIsAuthenticated(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyIsAuthenticated thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhGetCoolKeyIsAuthenticated thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + PRBool isAuthed = PR_FALSE; + + *_retval = PR_TRUE; +@@ -1709,7 +1711,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIsAut + NS_IMETHODIMP rhCoolKey::AuthenticateCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aPIN, bool *_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhAuthenticateCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::RhAuthenticateCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); + *_retval = PR_FALSE; + + if(!aKeyID || !aPIN) +@@ -1734,7 +1736,7 @@ NS_IMETHODIMP rhCoolKey::AuthenticateCoo + NS_IMETHODIMP rhCoolKey::SetCoolKeyDataValue(PRUint32 aKeyType, const char *aKeyID, const char *name, const char *value) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::SetCoolKeyDataValue \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::SetCoolKeyDataValue \n",GetTStamp(tBuff,56))); + CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); + + if (!node) +@@ -1751,7 +1753,7 @@ NS_IMETHODIMP rhCoolKey::SetCoolKeyDataV + NS_IMETHODIMP rhCoolKey::GetCoolKeyVersion(char **_retval) + { + char tBuff[56]; +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyVersion \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( coolKeyLog, LogLevel::Debug, ("%s rhCoolKey::GetCoolKeyVersion \n",GetTStamp(tBuff,56))); + + char *version = (char *) GETSTRING(ESC_VERSION); + +diff -up ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix22 ./esc/src/app/xpcom/tray/rhLinuxTray.cpp +--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix22 2016-02-08 15:39:12.496938735 -0800 ++++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2016-02-08 16:31:09.875529737 -0800 +@@ -24,11 +24,13 @@ + #include "nsIStringBundle.h" + #include + #include ++#include "mozilla/Logging.h" + + #define RH_COOLKEY_TRAY_CONTRACTID "@redhat.com/rhTray;1" + + static const nsCID kCoolKeyTrayCID = RH_TRAY_CID; + ++using namespace mozilla; + + GtkWidget* rhTray::mWnd = NULL; + GtkWidget* rhTray::mIconMenu = NULL; +@@ -84,7 +86,7 @@ static void popup_position(GtkMenu *menu + &px, + &py); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s popup_position width %d height %d px %d py %d *x %d *y %d screen_w %d screen_h %d \n",GetTStamp(tBuff,56),width,height,px,py,*x,*y,screen_width, screen_height)); ++ //MOZ_LOG( trayLog, LogLevel::Debug, ("%s popup_position width %d height %d px %d py %d *x %d *y %d screen_w %d screen_h %d \n",GetTStamp(tBuff,56),width,height,px,py,*x,*y,screen_width, screen_height)); + + // Are we close to the bottom of the screen? + +@@ -115,7 +117,7 @@ rhTray::~rhTray() + { + + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::~rhTray\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::~rhTray\n",GetTStamp(tBuff,56))); + + + Cleanup(); +@@ -126,7 +128,7 @@ NS_IMETHODIMP rhTray::Setwindnotifycallb + { + + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Setwindnotifycallback\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Setwindnotifycallback\n",GetTStamp(tBuff,56))); + + if(jsNotify) + AddTrayWindNotifyListener(jsNotify); +@@ -140,7 +142,7 @@ NS_IMETHODIMP rhTray::Unsetwindnotifycal + { + char tBuff[56]; + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Unsetwindnotifycallback\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Unsetwindnotifycallback\n",GetTStamp(tBuff,56))); + + if(jsNotify) + RemoveTrayWindNotifyListener(jsNotify); +@@ -157,10 +159,10 @@ NS_IMETHODIMP rhTray::Add(nsIBaseWindow + return NS_ERROR_FAILURE; + } + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Add %p \n",GetTStamp(tBuff,56),aWindow)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Add %p \n",GetTStamp(tBuff,56),aWindow)); + HRESULT res = Initialize(); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Add Initialize res %d \n",GetTStamp(tBuff,56),res)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Add Initialize res %d \n",GetTStamp(tBuff,56),res)); + + if(res != S_OK) + { +@@ -179,7 +181,7 @@ NS_IMETHODIMP rhTray::Add(nsIBaseWindow + NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Remove window %p \n",GetTStamp(tBuff,56),aWindow)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Remove window %p \n",GetTStamp(tBuff,56),aWindow)); + + if(!aWindow) + return NS_OK; +@@ -284,14 +286,14 @@ NS_IMETHODIMP rhTray::Showicon(void) + HRESULT rhTray::Initialize() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Initialize entering... mInitialized: %d \n",GetTStamp(tBuff,56),mInitialized)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Initialize entering... mInitialized: %d \n",GetTStamp(tBuff,56),mInitialized)); + + if(mInitialized) + { + return S_OK; + } + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Initialize \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Initialize \n",GetTStamp(tBuff,56))); + g_set_print_handler(rhTray::TrayPrintHandler); + notify_icon_create_with_image_file((char *)COOLKEY_ICON); + +@@ -312,7 +314,7 @@ HRESULT rhTray::Initialize() + + res = CreateEventWindow(); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Initialize result of CreateIconMenu %d \n",GetTStamp(tBuff,56),res)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Initialize result of CreateIconMenu %d \n",GetTStamp(tBuff,56),res)); + + if(res != S_OK) + { +@@ -332,7 +334,7 @@ HRESULT rhTray::RemoveIcon() + HRESULT rhTray::Cleanup() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Cleanup.\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Cleanup.\n",GetTStamp(tBuff,56))); + + RemoveAllListeners(); + DestroyEventWindow(); +@@ -344,7 +346,7 @@ HRESULT rhTray::Cleanup() + void rhTray::ShowAllListeners() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::ShowAllListeners.\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::ShowAllListeners.\n",GetTStamp(tBuff,56))); + map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i; + + rhTrayWindowListener *cur = NULL; +@@ -363,7 +365,7 @@ void rhTray::ShowAllListeners() + void rhTray::HideAllListeners() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::HideAllListeners.\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::HideAllListeners.\n",GetTStamp(tBuff,56))); + + map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i; + +@@ -383,7 +385,7 @@ void rhTray::HideAllListeners() + HRESULT rhTray::DestroyEventWindow() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::DestroyEventWindow \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::DestroyEventWindow \n",GetTStamp(tBuff,56))); + + rhTray::mWnd = 0; + return S_OK; +@@ -392,7 +394,7 @@ HRESULT rhTray::DestroyEventWindow() + void rhTray::IconMenuCBProc(GtkWidget *widget, gpointer data) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::IconMenuCBProc data %s \n",GetTStamp(tBuff,56),data)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::IconMenuCBProc data %s \n",GetTStamp(tBuff,56),data)); + + if(!strcmp((char *)data,"icon.min")) + { +@@ -414,7 +416,7 @@ void rhTray::IconMenuCBProc(GtkWidget *w + HRESULT rhTray::CreateIconMenu() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::CreateIconMenu \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::CreateIconMenu \n",GetTStamp(tBuff,56))); + + if(mIconMenu) + return E_FAIL; +@@ -462,7 +464,7 @@ HRESULT rhTray::CreateIconMenu() + void rhTray::IconCBProc(GtkWidget *button, GdkEventButton *event, void *data) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::IconCBProc \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::IconCBProc \n",GetTStamp(tBuff,56))); + + if(event->type != GDK_BUTTON_PRESS) + { +@@ -471,7 +473,7 @@ void rhTray::IconCBProc(GtkWidget *butto + + if(event->button == 1) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::IconCBProc Clicked!\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::IconCBProc Clicked!\n",GetTStamp(tBuff,56))); + + NotifyTrayWindListeners(MENU_EVT,MENU_SHOW); + rhTray::ShowAllListeners(); +@@ -500,7 +502,7 @@ void rhTray::IconCBProc(GtkWidget *butto + HRESULT rhTray::CreateEventWindow() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::CreateEventWindow \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::CreateEventWindow \n",GetTStamp(tBuff,56))); + + HRESULT res = CreateIconMenu(); + return res; +@@ -511,7 +513,7 @@ HRESULT rhTray::AddListener(nsIBaseWindo + char tBuff[56]; + nsresult rv; + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddListener %p \n",GetTStamp(tBuff,56),aWindow)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddListener %p \n",GetTStamp(tBuff,56),aWindow)); + //NS_ENSURE_ARG(aWindow); + + nativeWindow aNativeWindow; +@@ -527,7 +529,7 @@ HRESULT rhTray::AddListener(nsIBaseWindo + + gdk_window_get_user_data (gWnd,(void **)&hWnd); + +- PR_LOG(trayLog,PR_LOG_DEBUG, ("%s rhTray::AddListener is widget %p .\n",GetTStamp(tBuff,56),hWnd)); ++ MOZ_LOG(trayLog,LogLevel::Debug, ("%s rhTray::AddListener is widget %p .\n",GetTStamp(tBuff,56),hWnd)); + if(!hWnd) + { + return E_FAIL; +@@ -540,20 +542,20 @@ HRESULT rhTray::AddListener(nsIBaseWindo + + if(already) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddWindowListener Window already registered %p \n",GetTStamp(tBuff,56),aWindow)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddWindowListener Window already registered %p \n",GetTStamp(tBuff,56),aWindow)); + return S_OK; + + } + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddWindowListener current level widget %p \n",GetTStamp(tBuff,56),hWnd)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddWindowListener current level widget %p \n",GetTStamp(tBuff,56),hWnd)); + + hWnd = gtk_widget_get_toplevel( hWnd); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddWindowListener top level widget %p \n",GetTStamp(tBuff,56),hWnd)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddWindowListener top level widget %p \n",GetTStamp(tBuff,56),hWnd)); + + if (GTK_WIDGET_TOPLEVEL (hWnd)) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddWindowListener is really a top level widget %p \n",GetTStamp(tBuff,56),hWnd)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddWindowListener is really a top level widget %p \n",GetTStamp(tBuff,56),hWnd)); + } + rhTrayWindowListener *create = new rhTrayWindowListener(hWnd); + +@@ -582,7 +584,7 @@ HRESULT rhTray::ShowPopupMenu () + HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::RemoveWindowListener %p \n",GetTStamp(tBuff,56),aBaseWindow)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::RemoveWindowListener %p \n",GetTStamp(tBuff,56),aBaseWindow)); + + if(!aBaseWindow) + return S_OK; +@@ -610,7 +612,7 @@ HRESULT rhTray::RemoveListener(nsIBaseWi + HRESULT rhTray::RemoveAllListeners() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::RemoveAllListenesr\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::RemoveAllListenesr\n",GetTStamp(tBuff,56))); + map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i; + + rhTrayWindowListener *cur = NULL; +@@ -635,7 +637,7 @@ HRESULT rhTray::RemoveAllListeners() + NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Setmenuitemtext: index: %d text %s. \n",GetTStamp(tBuff,56),aIndex,aText)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Setmenuitemtext: index: %d text %s. \n",GetTStamp(tBuff,56),aIndex,aText)); + + if(!aText) + return NS_OK; +@@ -653,10 +655,10 @@ NS_IMETHODIMP rhTray::Setmenuitemtext(PR + unsigned int i = 0; + for (iterate = children; iterate; iterate=iterate->next) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Setmenuitemtext: index: %d \n",GetTStamp(tBuff,56),i)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Setmenuitemtext: index: %d \n",GetTStamp(tBuff,56),i)); + if(aIndex == i) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::Setmenuitemtext: About to reset text of item %p. \n",GetTStamp(tBuff,56),(void *) iterate->data)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::Setmenuitemtext: About to reset text of item %p. \n",GetTStamp(tBuff,56),(void *) iterate->data)); + if(iterate->data) + { + GtkWidget *label = gtk_bin_get_child(GTK_BIN(iterate->data)); +@@ -691,7 +693,7 @@ rhITrayWindNotify* rhTray::GetTrayWindNo + } + } + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",GetTStamp(tBuff,56),listener)); + + return NULL; + } +@@ -704,12 +706,12 @@ int rhTray::GetTrayWindNotifyListSize() + void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddTrayWindNotifyListener: %p \n", GetTStamp(tBuff,56), ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddTrayWindNotifyListener: %p \n", GetTStamp(tBuff,56), + listener)); + + if(GetTrayWindNotifyListener(listener )) + { +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",GetTStamp(tBuff,56),listener)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",GetTStamp(tBuff,56),listener)); + return ; + + } +@@ -745,7 +747,7 @@ void rhTray::NotifyTrayWindListeners(PRU + { + + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray::NotifyTrayWindListeners \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray::NotifyTrayWindListeners \n",GetTStamp(tBuff,56))); + + //Now notify all the listeners of the event + +@@ -754,7 +756,7 @@ void rhTray::NotifyTrayWindListeners(PRU + + bool claimed = 0; + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s NotifyTrayWindListeners about to notify \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s NotifyTrayWindListeners about to notify \n",GetTStamp(tBuff,56))); + ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed); + + } +@@ -765,7 +767,7 @@ void rhTray::NotifyTrayWindListeners(PRU + void rhTray::TrayPrintHandler(const gchar *string) + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTray:TrayPrintHandler. : %s \n",GetTStamp(tBuff,56),(char *) string)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTray:TrayPrintHandler. : %s \n",GetTStamp(tBuff,56),(char *) string)); + } + //rhTrayWindowListener Methods + +@@ -777,13 +779,13 @@ rhTrayWindowListener::rhTrayWindowListen + rhTrayWindowListener::~rhTrayWindowListener() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener::rhTrayWindowListener.\n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener::rhTrayWindowListener.\n",GetTStamp(tBuff,56))); + } + + HRESULT rhTrayWindowListener::Initialize() + { + char tBuff[56]; +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener::Initialize \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener::Initialize \n",GetTStamp(tBuff,56))); + + if(mWnd) + { +@@ -821,7 +823,7 @@ void rhTrayWindowListener::ShowWindow() + } + } + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener:: ShowWindow \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener:: ShowWindow \n",GetTStamp(tBuff,56))); + } + } + +@@ -831,7 +833,7 @@ void rhTrayWindowListener::HideWindow() + if(mWnd) + { + gtk_widget_hide(mWnd); +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener:: Hide Window %p\n",GetTStamp(tBuff,56),mWnd)); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener:: Hide Window %p\n",GetTStamp(tBuff,56),mWnd)); + } + } + +@@ -841,7 +843,7 @@ void rhTrayWindowListener::WndDestroyCBP + char tBuff[56]; + g_print("WndDestroyCBProc \n"); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener::WndDestroyCBProc \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener::WndDestroyCBProc \n",GetTStamp(tBuff,56))); + + } + +@@ -852,7 +854,7 @@ gboolean rhTrayWindowListener::WndDelete + char tBuff[56]; + g_print("WndDeleteCBProc\n"); + +- PR_LOG( trayLog, PR_LOG_DEBUG, ("%s rhTrayWindowListener::WndDeleteCBProc \n",GetTStamp(tBuff,56))); ++ MOZ_LOG( trayLog, LogLevel::Debug, ("%s rhTrayWindowListener::WndDeleteCBProc \n",GetTStamp(tBuff,56))); + + rhTrayWindowListener *me = (rhTrayWindowListener *) data; + +diff -up ./esc/src/app/xpcom/tray/rhTray.h.fix22 ./esc/src/app/xpcom/tray/rhTray.h +--- ./esc/src/app/xpcom/tray/rhTray.h.fix22 2016-02-08 15:31:00.552718187 -0800 ++++ ./esc/src/app/xpcom/tray/rhTray.h 2016-02-08 15:35:54.810459583 -0800 +@@ -25,7 +25,7 @@ + #include + #include "nsCOMPtr.h" + #include "nsIBaseWindow.h" +-#include "nsIWidget.h" ++//#include "nsIWidget.h" + #include + + extern "C" { diff --git a/esc.spec b/esc.spec index 77305cb..ad2f3b8 100644 --- a/esc.spec +++ b/esc.spec @@ -1,6 +1,6 @@ Name: esc Version: 1.1.0 -Release: 27%{?dist} +Release: 28%{?dist} Summary: Enterprise Security Client Smart Card Client License: GPL+ URL: http://directory.fedora.redhat.com/wiki/CoolKey @@ -35,11 +35,14 @@ Patch16: esc-1.1.0-fix16.patch Patch17: esc-1.1.0-fix17.patch Patch18: esc-1.1.0-fix18.patch Patch19: esc-1.1.0-fix19.patch +Patch20: esc-1.1.0-fix20.patch +Patch21: esc-1.1.0-fix21.patch +Patch22: esc-1.1.0-fix22.patch BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1 BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel BuildRequires: pango-devel libpng-devel pkgconfig zlib-devel -BuildRequires: nspr-devel nss-devel +BuildRequires: nspr-devel nss-devel nss-static BuildRequires: autoconf213 libX11-devel libXt-devel BuildRequires: xulrunner xulrunner-devel @@ -71,7 +74,6 @@ AutoReqProv: 0 %define escxuldir src/app/xul/esc %define escxulchromeicons %{escxuldir}/chrome/icons/default %define escdaemon escd -%define geckoversion 30.0 Source0: http://pki.fedoraproject.org/pki/sources/%name/%{escname}.tar.bz2 Source1: http://pki.fedoraproject.org/pki/sources/%name/esc @@ -108,12 +110,18 @@ cryptographic smartcards. %patch17 -p1 -b .fix17 %patch18 -p1 -b .fix18 %patch19 -p1 -b .fix19 +%patch20 -p1 -b .fix20 +%patch21 -p1 -b .fix21 +%patch22 -p1 -b .fix22 r=$(uname -r | sed -e 's/\(^[^.]*\.[^.]*\).*/\1/') [ -f esc/coreconf/Linux$r.mk ] || ln -s Linux3.5.mk esc/coreconf/Linux$r.mk %build +%define geckoversion `rpm -qi xulrunner | grep Version | sed 's/[\t ]//g;/^$/d' | sed 's/Version://'` + + GECKO_SDK_PATH=%{_libdir}/xulrunner-devel-%{geckoversion}/sdk GECKO_BIN_PATH=%{_libdir}/xulrunner GECKO_INCLUDE_PATH=%{_includedir}/xulrunner-%{geckoversion} @@ -180,6 +188,7 @@ cd %{_builddir} cp %{escname}/esc/LICENSE $RPM_BUILD_ROOT/%{docdir} rm -f $RPM_BUILD_ROOT/%{escdir}/esc +rm -rf $RPM_BUILD_ROOT/%{escdir}/xulrunner echo "xulrunner ./application.ini \$* &" > $RPM_BUILD_ROOT/%{escdir}/esc @@ -236,9 +245,11 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then fi %changelog -* Wed Jun 17 2015 Fedora Release Engineering - 1.1.0-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Mon Feb 12 2016 Jack Magne =1.1.0-28 +- Apease latest xullrunner api changes. +* Thu Apr 09 2015 Jack Magne =1.1.0-27 +- More xulrunner adjustments. * Sat Aug 16 2014 Fedora Release Engineering - 1.1.0-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild