1125 lines
54 KiB
Diff
1125 lines
54 KiB
Diff
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 <stdio.h>
|
|
#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 <string>
|
|
#include <time.h>
|
|
|
|
+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<nsIRunnable> 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<CoolKeyNode*>::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<nsCOMPtr<rhIKeyNotify> >::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 <gdk/gdkx.h>
|
|
#include <stdlib.h>
|
|
+#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 <list>
|
|
#include "nsCOMPtr.h"
|
|
#include "nsIBaseWindow.h"
|
|
-#include "nsIWidget.h"
|
|
+//#include "nsIWidget.h"
|
|
#include <time.h>
|
|
|
|
extern "C" {
|