mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 989691 - add nsContentUtils::LogMessageToConsole. r=jst
This commit is contained in:
parent
fafd994b88
commit
467c44c862
@ -827,6 +827,8 @@ public:
|
||||
uint32_t aLineNumber = 0,
|
||||
uint32_t aColumnNumber = 0);
|
||||
|
||||
static void LogMessageToConsole(const char* aMsg, ...);
|
||||
|
||||
/**
|
||||
* Get the localized string named |aKey| in properties file |aFile|.
|
||||
*/
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
|
||||
#include "prprf.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "DecoderTraits.h"
|
||||
#include "harfbuzz/hb.h"
|
||||
@ -3149,6 +3150,28 @@ nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText,
|
||||
return sConsoleService->LogMessage(errorObject);
|
||||
}
|
||||
|
||||
void
|
||||
nsContentUtils::LogMessageToConsole(const char* aMsg, ...)
|
||||
{
|
||||
if (!sConsoleService) { // only need to bother null-checking here
|
||||
CallGetService(NS_CONSOLESERVICE_CONTRACTID, &sConsoleService);
|
||||
if (!sConsoleService) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
va_list args;
|
||||
va_start(args, aMsg);
|
||||
char* formatted = PR_vsmprintf(aMsg, args);
|
||||
va_end(args);
|
||||
if (!formatted) {
|
||||
return;
|
||||
}
|
||||
|
||||
sConsoleService->LogStringMessage(NS_ConvertUTF8toUTF16(formatted).get());
|
||||
PR_smprintf_free(formatted);
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsChromeDoc(nsIDocument *aDocument)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user