diff --git a/extensions/p3p/src/nsP3PPreferences.cpp b/extensions/p3p/src/nsP3PPreferences.cpp index 10b964400f5c..56d6810326c5 100644 --- a/extensions/p3p/src/nsP3PPreferences.cpp +++ b/extensions/p3p/src/nsP3PPreferences.cpp @@ -343,7 +343,7 @@ nsP3PPreferences::GetBoolPref( nsCString aCategory, PRBool bRecipient; #ifdef DEBUG_P3P - printf("P3P: P3PPreferences: GetBoolPref(%s, %s, %s)\n", (char *) aCategory, (char *) aPurpose, (char *) aRecipient); + printf("P3P: P3PPreferences: GetBoolPref(%s, %s, %s)\n", (const char *) aCategory, (const char *) aPurpose, (const char *) aRecipient); #endif pPrefName = P3P_PREF; @@ -356,7 +356,7 @@ nsP3PPreferences::GetBoolPref( nsCString aCategory, if (NS_SUCCEEDED( rv )) { #ifdef DEBUG_P3P printf("P3P: P3PPreferences: Setting for %s is %s.\n", - (char *) pPrefName, (*aResult) ? "true" : "false"); + (const char *) pPrefName, (*aResult) ? "true" : "false"); #endif if (aRecipient.Equals("ours")) { bRecipient = PR_TRUE; @@ -369,7 +369,7 @@ nsP3PPreferences::GetBoolPref( nsCString aCategory, #ifdef DEBUG_P3P if (NS_SUCCEEDED( rv )) { printf("P3P: P3PPreferences: Setting for %s is %s.\n", - (char *) pPrefName, (*aResult) ? "true" : "false"); + (const char *) pPrefName, (*aResult) ? "true" : "false"); } #endif } @@ -380,7 +380,7 @@ nsP3PPreferences::GetBoolPref( nsCString aCategory, } if (NS_FAILED(rv)) { - PR_LOG( gP3PLogModule, PR_LOG_NOTICE, ("P3PPreferenceService: GetBoolPref(%s, %s, %s) failed with return value %X.\n", (char *) aCategory, (char *) aPurpose, (char *) aRecipient, rv) ); + PR_LOG( gP3PLogModule, PR_LOG_NOTICE, ("P3PPreferenceService: GetBoolPref(%s, %s, %s) failed with return value %X.\n", (const char *) aCategory, (const char *) aPurpose, (const char *) aRecipient, rv) ); #ifdef DEBUG_P3P printf("P3P: P3PPreferences: GetBoolPref() failed with return value %x.\n", rv); #endif @@ -388,7 +388,7 @@ nsP3PPreferences::GetBoolPref( nsCString aCategory, #ifdef DEBUG_P3P else { printf("P3P: P3PPreferences: Setting for %s, %s, %s is %s.\n", - (char *) aCategory, (char *) aPurpose, (char *) aRecipient, (*aResult) ? "true" : "false"); + (const char *) aCategory, (const char *) aPurpose, (const char *) aRecipient, (*aResult) ? "true" : "false"); } #endif diff --git a/extensions/p3p/src/nsP3PService.cpp b/extensions/p3p/src/nsP3PService.cpp index a821fb1933d3..da2cdc74c5c3 100644 --- a/extensions/p3p/src/nsP3PService.cpp +++ b/extensions/p3p/src/nsP3PService.cpp @@ -75,10 +75,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT( nsP3PService, Init ); // Function: Regsiter the P3P Service to start on the first HTTP request. // NS_METHOD -nsP3PService::CategoryRegister( nsIComponentManager *aComponentManager, - nsIFile *aPath, - const char *aRegistryLocation, - const char *aComponentType ) { +nsP3PService::CategoryRegister( nsIComponentManager *aComponentManager, + nsIFile *aPath, + const char *aRegistryLocation, + const char *aComponentType, + const nsModuleComponentInfo *aInfo ) { nsresult rv; @@ -118,9 +119,10 @@ nsP3PService::CategoryRegister( nsIComponentManager *aComponentManager, // Function: Unregsiter the P3P Service to start on the first HTTP request. // NS_METHOD -nsP3PService::CategoryUnregister( nsIComponentManager *aComponentManager, - nsIFile *aPath, - const char *aRegistryLocation ) { +nsP3PService::CategoryUnregister( nsIComponentManager *aComponentManager, + nsIFile *aPath, + const char *aRegistryLocation, + const nsModuleComponentInfo *aInfo ) { nsresult rv; @@ -1803,21 +1805,8 @@ nsP3PService::GetURIComponents( nsIURI *aURI, rv = aURI->GetPort(&iPort ); if (NS_SUCCEEDED( rv ) && (iPort >= 0) && (iPort != 80)) { - char *csPortBuffer = nsnull; - - csPortBuffer = PR_smprintf( ":%d", iPort ); - - if (csPortBuffer) { - aURIHostPort.AppendWithConversion( csPortBuffer ); - PR_smprintf_free( csPortBuffer ); - } - else { - PR_LOG( gP3PLogModule, - PR_LOG_ERROR, - ("P3PService: GetURIComponents, PR_smprintf failed.\n") ); - - rv = NS_ERROR_OUT_OF_MEMORY; - } + aURIHostPort.AppendWithConversion( ":" ); + aURIHostPort.AppendInt( iPort ); } else if (NS_FAILED( rv )) { PR_LOG( gP3PLogModule, @@ -2860,7 +2849,7 @@ nsP3PService::DeleteCookie( nsIURI *aURI, rv = mCookieService->SetCookieString( aURI, nsnull, - sWork ); + csCookie ); return rv; } diff --git a/extensions/p3p/src/nsP3PService.h b/extensions/p3p/src/nsP3PService.h index f653ea0e16eb..c0b83bf51d23 100644 --- a/extensions/p3p/src/nsP3PService.h +++ b/extensions/p3p/src/nsP3PService.h @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -83,14 +84,16 @@ public: NS_METHOD Init( ); static - NS_METHOD CategoryRegister( nsIComponentManager *aComponentManager, - nsIFile *aPath, - const char *aRegistryLocation, - const char *aComponentType ); + NS_METHOD CategoryRegister( nsIComponentManager *aComponentManager, + nsIFile *aPath, + const char *aRegistryLocation, + const char *aComponentType, + const nsModuleComponentInfo *aInfo ); static - NS_METHOD CategoryUnregister( nsIComponentManager *aComponentManager, - nsIFile *aPath, - const char *aRegistryLocation ); + NS_METHOD CategoryUnregister( nsIComponentManager *aComponentManager, + nsIFile *aPath, + const char *aRegistryLocation, + const nsModuleComponentInfo *aInfo ); protected: NS_METHOD GetDocShellTreeItemMain( nsIDocShellTreeItem *aDocShellTreeItem,