import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1165515 - Part 1: Convert PR_LOG to MOZ_LOG. r=froydnj (034b6056f)
- Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj (38739377e)
- Bug 1165515 - Part 5: Convert instances of PR_LOG_ALWAYS. r=froydnj (867725f77)
- Bug 1165515 - Part 7: Convert PR_LOG_DEBUG + 1 to PR_LOG_VERBOSE. rs=froydnj (afe55d0b8)
- Bug 1165515 - Part 8: Convert log level 6 to PR_LOG_VERBOSE. r=jesup (d01127f2c)
- Bug 1165515 - Part 9: Remove instances of using numeric log levels 15. rs=froydnj (2ff8b0056)
- Bug 1165515 - Part 10: Convert mtransport/logging.h to use PR_LOG levels. r=ekr (a0334c607)
- Bug 1165515 - Part 11: Align CSFLogLevel with PR_LOG levels. r=jesup (ca57ae88a)
- Bug 1165515 - Part 12: Convert nsPluginLogging to use PR_LOG levels. r=bsmedberg (1f3226ca8)
- Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj (96db7f2e9)
- Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj (81d9dc8e5)
- fix some bustage after Bug 1165515 - Part 14, stuff missed in part 13 (80c83c78d)
- Bug 1165515 - Part 15: Reduce log level of WebRTC during testing. r=jesup (dda33e173)
pull/6/head
roytam1 1 year ago
parent eb7ab47f85
commit 3ea1cc0dd0
  1. 2
      build/automation.py.in
  2. 2
      build/automationutils.py
  3. 30
      docshell/base/nsDocShell.cpp
  4. 6
      docshell/shistory/src/nsSHistory.cpp
  5. 2
      dom/base/ThirdPartyUtil.cpp
  6. 4
      dom/base/nsContentPolicy.cpp
  7. 2
      dom/base/nsDOMDataChannel.cpp
  8. 26
      dom/base/nsDocument.cpp
  9. 20
      dom/base/nsFocusManager.cpp
  10. 14
      dom/base/nsGlobalWindow.cpp
  11. 6
      dom/base/nsNodeInfoManager.cpp
  12. 4
      dom/base/nsObjectLoadingContent.cpp
  13. 4
      dom/camera/CameraCommon.h
  14. 126
      dom/events/IMEStateManager.cpp
  15. 64
      dom/html/HTMLMediaElement.cpp
  16. 10
      dom/html/HTMLTrackElement.cpp
  17. 4
      dom/indexedDB/ActorsParent.cpp
  18. 6
      dom/indexedDB/ProfilerHelpers.h
  19. 4
      dom/ipc/ProcessPriorityManager.cpp
  20. 4
      dom/media/AudioSink.cpp
  21. 26
      dom/media/AudioStream.cpp
  22. 58
      dom/media/GraphDriver.cpp
  23. 6
      dom/media/Latency.cpp
  24. 60
      dom/media/MediaCache.cpp
  25. 2
      dom/media/MediaDecoder.cpp
  26. 2
      dom/media/MediaDecoderReader.cpp
  27. 8
      dom/media/MediaDecoderStateMachine.cpp
  28. 4
      dom/media/MediaFormatReader.cpp
  29. 2
      dom/media/MediaManager.cpp
  30. 2
      dom/media/MediaManager.h
  31. 2
      dom/media/MediaPromise.h
  32. 46
      dom/media/MediaRecorder.cpp
  33. 2
      dom/media/MediaResource.cpp
  34. 6
      dom/media/MediaShutdownManager.cpp
  35. 60
      dom/media/MediaStreamGraph.cpp
  36. 2
      dom/media/MediaTimer.h
  37. 2
      dom/media/RtspMediaResource.cpp
  38. 2
      dom/media/StateMirroring.h
  39. 2
      dom/media/StateWatching.h
  40. 8
      dom/media/StreamBuffer.cpp
  41. 6
      dom/media/TrackUnionStream.cpp
  42. 2
      dom/media/WebVTTListener.cpp
  43. 6
      dom/media/apple/AppleMP3Reader.cpp
  44. 2
      dom/media/directshow/AudioSinkFilter.cpp
  45. 2
      dom/media/directshow/AudioSinkInputPin.cpp
  46. 2
      dom/media/directshow/DirectShowReader.cpp
  47. 6
      dom/media/directshow/SampleSink.cpp
  48. 2
      dom/media/directshow/SourceFilter.cpp
  49. 42
      dom/media/encoder/MediaEncoder.cpp
  50. 6
      dom/media/encoder/TrackEncoder.cpp
  51. 2
      dom/media/encoder/VP8TrackEncoder.cpp
  52. 2
      dom/media/encoder/VorbisTrackEncoder.cpp
  53. 4
      dom/media/fmp4/MP4Reader.cpp
  54. 4
      dom/media/gmp/GMPAudioDecoderParent.cpp
  55. 4
      dom/media/gmp/GMPChild.cpp
  56. 4
      dom/media/gmp/GMPContentParent.cpp
  57. 4
      dom/media/gmp/GMPParent.cpp
  58. 4
      dom/media/gmp/GMPService.cpp
  59. 4
      dom/media/gmp/GMPServiceChild.cpp
  60. 4
      dom/media/gmp/GMPServiceParent.cpp
  61. 4
      dom/media/gmp/GMPStorageParent.cpp
  62. 4
      dom/media/gmp/GMPTimerParent.cpp
  63. 8
      dom/media/gmp/GMPVideoDecoderParent.cpp
  64. 6
      dom/media/gmp/GMPVideoEncoderParent.cpp
  65. 2
      dom/media/imagecapture/ImageCapture.h
  66. 4
      dom/media/mediasource/ContainerParser.cpp
  67. 4
      dom/media/mediasource/MediaSource.cpp
  68. 4
      dom/media/mediasource/MediaSourceDecoder.cpp
  69. 4
      dom/media/mediasource/MediaSourceReader.cpp
  70. 2
      dom/media/mediasource/MediaSourceResource.h
  71. 4
      dom/media/mediasource/ResourceQueue.cpp
  72. 6
      dom/media/mediasource/SourceBuffer.cpp
  73. 2
      dom/media/mediasource/SourceBufferDecoder.cpp
  74. 4
      dom/media/mediasource/SourceBufferList.cpp
  75. 4
      dom/media/mediasource/SourceBufferResource.cpp
  76. 2
      dom/media/mediasource/TrackBuffer.cpp
  77. 4
      dom/media/mediasource/TrackBuffersManager.cpp
  78. 22
      dom/media/ogg/OggCodecState.cpp
  79. 48
      dom/media/ogg/OggReader.cpp
  80. 42
      dom/media/ogg/OpusParser.cpp
  81. 44
      dom/media/omx/AudioOffloadPlayer.cpp
  82. 22
      dom/media/omx/AudioOutput.cpp
  83. 2
      dom/media/omx/I420ColorConverterHelper.cpp
  84. 12
      dom/media/omx/MediaOmxCommonDecoder.cpp
  85. 6
      dom/media/omx/MediaOmxCommonReader.cpp
  86. 2
      dom/media/omx/MediaOmxReader.cpp
  87. 18
      dom/media/omx/OmxDecoder.cpp
  88. 2
      dom/media/platforms/apple/AppleATDecoder.cpp
  89. 2
      dom/media/platforms/apple/AppleCMLinker.cpp
  90. 2
      dom/media/platforms/apple/AppleVDADecoder.cpp
  91. 2
      dom/media/platforms/apple/AppleVDALinker.cpp
  92. 2
      dom/media/platforms/apple/AppleVTDecoder.cpp
  93. 2
      dom/media/platforms/apple/AppleVTLinker.cpp
  94. 2
      dom/media/platforms/ffmpeg/FFmpegLog.h
  95. 2
      dom/media/platforms/gonk/GonkAudioDecoderManager.cpp
  96. 2
      dom/media/platforms/gonk/GonkMediaDataDecoder.cpp
  97. 2
      dom/media/platforms/gonk/GonkVideoDecoderManager.cpp
  98. 2
      dom/media/platforms/wmf/MFTDecoder.cpp
  99. 2
      dom/media/platforms/wmf/WMFAudioMFTManager.cpp
  100. 2
      dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

@ -498,7 +498,7 @@ class Automation(object):
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
env.setdefault('NSPR_LOG_MODULES', 'signaling:3,mtransport:4,datachannel:4,jsep:4,MediaPipelineFactory:4')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')

@ -334,7 +334,7 @@ def environment(xrePath, env=None, debugger=False, dmdPath=None, lsanPath=None):
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
env.setdefault('NSPR_LOG_MODULES', 'signaling:3,mtransport:4,datachannel:4,jsep:4,MediaPipelineFactory:4')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')

@ -925,7 +925,7 @@ nsDocShell::nsDocShell()
gDocShellLeakLog = PR_NewLogModule("nsDocShellLeak");
}
if (gDocShellLeakLog) {
PR_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p created\n", this));
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
}
#ifdef DEBUG
@ -960,7 +960,7 @@ nsDocShell::~nsDocShell()
}
if (gDocShellLeakLog) {
PR_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p destroyed\n", this));
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p destroyed\n", this));
}
#ifdef DEBUG
@ -1099,7 +1099,7 @@ nsDocShell::GetInterface(const nsIID& aIID, void** aSink)
}
#if defined(DEBUG)
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: returning app cache container %p",
this, domDoc.get()));
#endif
@ -1431,10 +1431,10 @@ nsDocShell::LoadURI(nsIURI* aURI,
}
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString uristr;
aURI->GetAsciiSpec(uristr);
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: loading %s with flags 0x%08x",
this, uristr.get(), aLoadFlags));
}
@ -1553,7 +1553,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
if (shEntry) {
#ifdef DEBUG
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]: loading from session history", this));
#endif
@ -2005,7 +2005,7 @@ bool
nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
bool aFireOnLocationChange, uint32_t aLocationFlags)
{
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
nsAutoCString spec;
if (aURI) {
aURI->GetSpec(spec);
@ -5300,7 +5300,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
nsIChannel* aFailedChannel)
{
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -5311,7 +5311,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
chanName.AssignLiteral("<no channel>");
}
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::LoadErrorPage(\"%s\", \"%s\", {...}, [%s])\n", this,
spec.get(), NS_ConvertUTF16toUTF8(aURL).get(), chanName.get()));
}
@ -9677,7 +9677,7 @@ nsDocShell::InternalLoad2(nsIURI* aURI,
nsresult rv = NS_OK;
mOriginalUriString.Truncate();
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
nsAutoCString spec;
if (aURI) {
aURI->GetSpec(spec);
@ -11288,7 +11288,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -11299,7 +11299,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
chanName.AssignLiteral("<no channel>");
}
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::OnNewURI(\"%s\", [%s], 0x%x)\n", this, spec.get(),
chanName.get(), aLoadType));
}
@ -11364,7 +11364,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
// XXX This log message is almost useless because |updateSHistory|
// and |updateGHistory| are not correct at this point.
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
(" shAvailable=%i updateSHistory=%i updateGHistory=%i"
" equalURI=%i\n",
shAvailable, updateSHistory, updateGHistory, equalUri));
@ -11928,7 +11928,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
#if defined(DEBUG)
if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
@ -11939,7 +11939,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
chanName.AssignLiteral("<no channel>");
}
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
MOZ_LOG(gDocShellLog, LogLevel::Debug,
("nsDocShell[%p]::AddToSessionHistory(\"%s\", [%s])\n",
this, spec.get(), chanName.get()));
}

@ -68,7 +68,7 @@ GetSHistoryLog()
}
return sLog;
}
#define LOG(format) PR_LOG(GetSHistoryLog(), PR_LOG_DEBUG, format)
#define LOG(format) MOZ_LOG(GetSHistoryLog(), LogLevel::Debug, format)
// This macro makes it easier to print a log message which includes a URI's
// spec. Example use:
@ -78,7 +78,7 @@ GetSHistoryLog()
//
#define LOG_SPEC(format, uri) \
PR_BEGIN_MACRO \
if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\
if (uri) { \
uri->GetSpec(_specStr); \
@ -96,7 +96,7 @@ GetSHistoryLog()
//
#define LOG_SHENTRY_SPEC(format, shentry) \
PR_BEGIN_MACRO \
if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsCOMPtr<nsIURI> uri; \
shentry->GetURI(getter_AddRefs(uri)); \
LOG_SPEC(format, uri); \

@ -24,7 +24,7 @@ NS_IMPL_ISUPPORTS(ThirdPartyUtil, mozIThirdPartyUtil)
//
static PRLogModuleInfo *gThirdPartyLog;
#undef LOG
#define LOG(args) PR_LOG(gThirdPartyLog, PR_LOG_DEBUG, args)
#define LOG(args) MOZ_LOG(gThirdPartyLog, mozilla::LogLevel::Debug, args)
nsresult
ThirdPartyUtil::Init()

@ -205,7 +205,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
#define LOG_CHECK(logType) \
PR_BEGIN_MACRO \
/* skip all this nonsense if the call failed or logging is disabled */ \
if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) { \
if (NS_SUCCEEDED(rv) && MOZ_LOG_TEST(gConPolLog, LogLevel::Debug)) { \
const char *resultName; \
if (decision) { \
resultName = NS_CP_ResponseName(*decision); \
@ -220,7 +220,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
if (requestingLocation) { \
requestingLocation->GetSpec(refSpec); \
} \
PR_LOG(gConPolLog, PR_LOG_DEBUG, \
MOZ_LOG(gConPolLog, LogLevel::Debug, \
("Content Policy: " logType ": <%s> <Ref:%s> result=%s", \
spec.get(), refSpec.get(), resultName) \
); \

@ -11,7 +11,7 @@
extern PRLogModuleInfo* GetDataChannelLog();
#undef LOG
#define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)
#define LOG(args) MOZ_LOG(GetDataChannelLog(), mozilla::LogLevel::Debug, args)
#include "nsDOMDataChannelDeclarations.h"

@ -1570,7 +1570,7 @@ nsDocument::nsDocument(const char* aContentType)
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
if (gDocumentLeakPRLog)
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug,
("DOCUMENT %p created", this));
if (!gCspPRLog)
@ -1614,7 +1614,7 @@ nsIDocument::~nsIDocument()
nsDocument::~nsDocument()
{
if (gDocumentLeakPRLog)
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug,
("DOCUMENT %p destroyed", this));
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
@ -2269,7 +2269,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
{
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) {
nsAutoCString spec;
aURI->GetSpec(spec);
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
@ -2602,7 +2602,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsIStreamListener **aDocListener,
bool aReset, nsIContentSink* aSink)
{
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
nsAutoCString spec;
@ -2737,7 +2737,7 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
rv = csp->AppendPolicy(policy, aReportOnly);
NS_ENSURE_SUCCESS(rv, rv);
{
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP refined with policy: \"%s\"",
NS_ConvertUTF16toUTF8(policy).get()));
}
@ -2777,7 +2777,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
{
nsCOMPtr<nsIContentSecurityPolicy> csp;
if (!CSPService::sCSPEnabled) {
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP is disabled, skipping CSP init for document %p", this));
return NS_OK;
}
@ -2840,12 +2840,12 @@ nsDocument::InitCSP(nsIChannel* aChannel)
!applyLoopCSP &&
cspHeaderValue.IsEmpty() &&
cspROHeaderValue.IsEmpty()) {
if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) {
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
@ -2854,7 +2854,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
return NS_OK;
}
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Document is an app or CSP header specified %p", this));
nsresult rv;
@ -2873,7 +2873,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("%s %s %s",
"This document is sharing principal with another document.",
"Since the document is an app, CSP was already set.",
"Skipping attempt to set CSP."));
@ -2884,7 +2884,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
if (NS_FAILED(rv)) {
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Failed to create CSP object: %x", rv));
return rv;
}
@ -2937,7 +2937,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = csp->PermitsAncestry(docShell, &safeAncestry);
if (NS_FAILED(rv) || !safeAncestry) {
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("CSP doesn't like frame's ancestry, not loading."));
// stop! ERROR page!
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
@ -2962,7 +2962,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = principal->SetCsp(csp);
NS_ENSURE_SUCCESS(rv, rv);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
MOZ_LOG(gCspPRLog, LogLevel::Debug,
("Inserted CSP into principal %p", principal));
return NS_OK;

@ -80,16 +80,16 @@ using namespace mozilla::widget;
PRLogModuleInfo* gFocusLog;
PRLogModuleInfo* gFocusNavigationLog;
#define LOGFOCUS(args) PR_LOG(gFocusLog, PR_LOG_DEBUG, args)
#define LOGFOCUSNAVIGATION(args) PR_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args)
#define LOGFOCUS(args) MOZ_LOG(gFocusLog, mozilla::LogLevel::Debug, args)
#define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, mozilla::LogLevel::Debug, args)
#define LOGTAG(log, format, content) \
if (PR_LOG_TEST(log, PR_LOG_DEBUG)) { \
if (MOZ_LOG_TEST(log, LogLevel::Debug)) { \
nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \
if (content) { \
content->NodeInfo()->NameAtom()->ToUTF8String(tag); \
} \
PR_LOG(log, PR_LOG_DEBUG, (format, tag.get())); \
MOZ_LOG(log, LogLevel::Debug, (format, tag.get())); \
}
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
@ -485,7 +485,7 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug) && mFocusedWindow) {
nsIDocument* doc = mFocusedWindow->GetExtantDoc();
if (doc && doc->GetDocumentURI()) {
nsAutoCString spec;
@ -645,7 +645,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -741,7 +741,7 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -859,7 +859,7 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
window = window->GetOuterWindow();
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -914,7 +914,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
window = window->GetOuterWindow();
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
nsIDocument* doc = window->GetExtantDoc();
@ -1785,7 +1785,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
LOGCONTENT("Element %s has been focused", aContent);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
nsIDocument* docm = aWindow->GetExtantDoc();
if (docm) {
LOGCONTENT(" from %s", docm->GetRootElement());

@ -1213,7 +1213,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
#endif
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug,
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
@ -1303,7 +1303,7 @@ nsGlobalWindow::~nsGlobalWindow()
#endif
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug,
("DOMWINDOW %p destroyed", this));
if (IsOuterWindow()) {
@ -2830,7 +2830,7 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
MOZ_ASSERT(aDocument);
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (gDOMLeakPRLog && MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
nsIURI *uri = aDocument->GetDocumentURI();
nsAutoCString spec;
if (uri)
@ -10719,7 +10719,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
if (mSessionStorage) {
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
}
bool canAccess = mSessionStorage->CanAccess(principal);
@ -10770,7 +10770,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
mSessionStorage = static_cast<DOMStorage*>(storage.get());
MOZ_ASSERT(mSessionStorage);
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
}
@ -10780,7 +10780,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
}
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
}
@ -11698,7 +11698,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) {
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
this, mSessionStorage.get(), changingStorage.get());
}

@ -119,7 +119,7 @@ nsNodeInfoManager::nsNodeInfoManager()
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p created", this));
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
@ -139,7 +139,7 @@ nsNodeInfoManager::~nsNodeInfoManager()
mBindingManager = nullptr;
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p destroyed", this));
nsLayoutStatics::Release();
@ -196,7 +196,7 @@ nsNodeInfoManager::Init(nsIDocument *aDocument)
mDocument = aDocument;
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
return NS_OK;

@ -117,8 +117,8 @@ GetObjectLog()
return sLog;
}
#define LOG(args) PR_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
#define LOG(args) MOZ_LOG(GetObjectLog(), mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(GetObjectLog(), mozilla::LogLevel::Debug)
static bool
IsJavaMIME(const nsACString & aMIMEType)

@ -18,9 +18,9 @@
#include "mozilla/Logging.h"
extern PRLogModuleInfo* GetCameraLog();
#define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
#define DOM_CAMERA_LOG( type, ... ) MOZ_LOG(GetCameraLog(), (mozilla::LogLevel)type, ( __VA_ARGS__ ))
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( mozilla::LogLevel::Error, __VA_ARGS__ )
/**
* From the least to the most output.

@ -44,16 +44,16 @@ using namespace widget;
/**
* When a method is called, log its arguments and/or related static variables
* with PR_LOG_ALWAYS. However, if it puts too many logs like
* with LogLevel::Info. However, if it puts too many logs like
* OnDestroyPresContext(), should long only when the method actually does
* something. In this case, the log should start with "ISM: <method name>".
*
* When a method quits due to unexpected situation, log the reason with
* PR_LOG_ERROR. In this case, the log should start with
* LogLevel::Error. In this case, the log should start with
* "ISM: <method name>(), FAILED". The indent makes the log look easier.
*
* When a method does something only in some situations and it may be important
* for debug, log the information with PR_LOG_DEBUG. In this case, the log
* for debug, log the information with LogLevel::Debug. In this case, the log
* should start with "ISM: <method name>(),".
*/
PRLogModuleInfo* sISMLog = nullptr;
@ -205,7 +205,7 @@ IMEStateManager::Init()
void
IMEStateManager::Shutdown()
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::Shutdown(), "
"sTextCompositions=0x%p, sTextCompositions->Length()=%u",
sTextCompositions, sTextCompositions ? sTextCompositions->Length() : 0));
@ -226,7 +226,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
TextCompositionArray::index_type i =
sTextCompositions->IndexOf(aPresContext);
if (i != TextCompositionArray::NoIndex) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnDestroyPresContext(), "
"removing TextComposition instance from the array (index=%u)", i));
// there should be only one composition per presContext object.
@ -234,7 +234,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
sTextCompositions->RemoveElementAt(i);
if (sTextCompositions->IndexOf(aPresContext) !=
TextCompositionArray::NoIndex) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::OnDestroyPresContext(), FAILED to remove "
"TextComposition instance from the array"));
MOZ_CRASH("Failed to remove TextComposition instance from the array");
@ -246,7 +246,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
return NS_OK;
}
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnDestroyPresContext(aPresContext=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
aPresContext, sPresContext, sContent, sTextCompositions));
@ -278,7 +278,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
sTextCompositions->GetCompositionInContent(aPresContext, aContent);
if (compositionInContent) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnRemoveContent(), "
"composition is in the content"));
@ -301,7 +301,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
return NS_OK;
}
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnRemoveContent(aPresContext=0x%p, "
"aContent=0x%p), sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
aPresContext, aContent, sPresContext, sContent, sTextCompositions));
@ -329,7 +329,7 @@ IMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
nsIContent* aContent,
InputContextAction::Cause aCause)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnChangeFocus(aPresContext=0x%p, "
"aContent=0x%p, aCause=%s)",
aPresContext, aContent, GetActionCauseName(aCause)));
@ -344,7 +344,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
nsIContent* aContent,
InputContextAction aAction)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnChangeFocusInternal(aPresContext=0x%p, "
"aContent=0x%p, aAction={ mCause=%s, mFocusChange=%s }), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p",
@ -372,7 +372,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
}
if (!aPresContext) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"no nsPresContext is being activated"));
return NS_OK;
@ -382,7 +382,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
(sPresContext == aPresContext) ? oldWidget.get() :
aPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::OnChangeFocusInternal(), FAILED due to "
"no widget to manage its IME state"));
return NS_OK;
@ -400,7 +400,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
// on focus to the main process... but this cannot cause bugs like missed keypresses.
// (It just means a lot of needless IPC.)
if ((newState.mEnabled == IMEState::DISABLED) && TabParent::GetIMETabParent()) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"Parent process cancels to set DISABLED state because the content process "
"has IME focus and has already sets IME state"));
@ -415,7 +415,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
// we should do it.
InputContext context = widget->GetInputContext();
if (context.mIMEState.mEnabled == newState.mEnabled) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"neither focus nor IME state is changing"));
return NS_OK;
@ -454,7 +454,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
void
IMEStateManager::OnInstalledMenuKeyboardListener(bool aInstalling)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnInstalledMenuKeyboardListener(aInstalling=%s), "
"sInstalledMenuKeyboardListener=%s",
GetBoolName(aInstalling), GetBoolName(sInstalledMenuKeyboardListener)));
@ -473,27 +473,27 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIDOMMouseEvent* aMouseEvent)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(aPresContext=0x%p, "
"aContent=0x%p, aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
aPresContext, aContent, aMouseEvent, sPresContext, sContent));
if (sPresContext != aPresContext || sContent != aContent) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the mouse event isn't fired on the editor managed by ISM"));
return false;
}
if (!sActiveIMEContentObserver) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"there is no active IMEContentObserver"));
return false;
}
if (!sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the active IMEContentObserver isn't managing the editor"));
return false;
@ -502,7 +502,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
WidgetMouseEvent* internalEvent =
aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
if (NS_WARN_IF(!internalEvent)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"the internal event of aMouseEvent isn't WidgetMouseEvent"));
return false;
@ -511,10 +511,10 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
bool consumed =
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
if (MOZ_LOG_TEST(sISMLog, LogLevel::Info)) {
nsAutoString eventType;
aMouseEvent->GetType(eventType);
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
@ -530,13 +530,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIDOMMouseEvent* aMouseEvent)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnClickInEditor(aPresContext=0x%p, aContent=0x%p, "
"aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
aPresContext, aContent, aMouseEvent, sPresContext, sContent));
if (sPresContext != aPresContext || sContent != aContent) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't fired on the editor managed by ISM"));
return;
@ -549,7 +549,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted);
NS_ENSURE_SUCCESS_VOID(rv);
if (!isTrusted) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a trusted event"));
return; // ignore untrusted event.
@ -559,7 +559,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
rv = aMouseEvent->GetButton(&button);
NS_ENSURE_SUCCESS_VOID(rv);
if (button != 0) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a left mouse button event"));
return; // not a left click event.
@ -569,7 +569,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
rv = aMouseEvent->GetDetail(&clickCount);
NS_ENSURE_SUCCESS_VOID(rv);
if (clickCount != 1) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnClickInEditor(), "
"the mouse event isn't a single click event"));
return; // should notify only first click event.
@ -587,7 +587,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
nsIContent* aContent,
nsIEditor* aEditor)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnFocusInEditor(aPresContext=0x%p, aContent=0x%p, "
"aEditor=0x%p), sPresContext=0x%p, sContent=0x%p, "
"sActiveIMEContentObserver=0x%p",
@ -595,7 +595,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
sActiveIMEContentObserver));
if (sPresContext != aPresContext || sContent != aContent) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnFocusInEditor(), "
"an editor not managed by ISM gets focus"));
return;
@ -605,7 +605,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
// we need to recreate the instance.
if (sActiveIMEContentObserver) {
if (sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::OnFocusInEditor(), "
"the editor is already being managed by sActiveIMEContentObserver"));
return;
@ -622,7 +622,7 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
nsIContent* aContent,
nsIEditor* aEditor)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::UpdateIMEState(aNewIMEState={ mEnabled=%s, "
"mOpen=%s }, aContent=0x%p, aEditor=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
@ -633,21 +633,21 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
GetBoolName(sIsGettingNewIMEState)));
if (sIsGettingNewIMEState) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::UpdateIMEState(), "
"does nothing because of called while getting new IME state"));
return;
}
if (NS_WARN_IF(!sPresContext)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
"no managing nsPresContext"));
return;
}
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
"no widget for the managing nsPresContext"));
return;
@ -657,12 +657,12 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
// editor with current editable root content due to reframed. In such case,
// We should try to reinitialize the IMEContentObserver.
if (sActiveIMEContentObserver && IsIMEObserverNeeded(aNewIMEState)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::UpdateIMEState(), try to reinitialize the "
"active IMEContentObserver"));
if (!sActiveIMEContentObserver->MaybeReinitialize(widget, sPresContext,
aContent, aEditor)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::UpdateIMEState(), failed to reinitialize the "
"active IMEContentObserver"));
}
@ -702,7 +702,7 @@ IMEState
IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
nsIContent* aContent)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::GetNewIMEState(aPresContext=0x%p, aContent=0x%p), "
"sInstalledMenuKeyboardListener=%s",
aPresContext, aContent, GetBoolName(sInstalledMenuKeyboardListener)));
@ -710,14 +710,14 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
// On Printing or Print Preview, we don't need IME.
if (aPresContext->Type() == nsPresContext::eContext_PrintPreview ||
aPresContext->Type() == nsPresContext::eContext_Print) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"the nsPresContext is for print or print preview"));
return IMEState(IMEState::DISABLED);
}
if (sInstalledMenuKeyboardListener) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"menu keyboard listener was installed"));
return IMEState(IMEState::DISABLED);
@ -728,12 +728,12 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
// editable, such case is design mode.
nsIDocument* doc = aPresContext->Document();
if (doc && doc->HasFlag(NODE_IS_EDITABLE)) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns ENABLED because "
"design mode editor has focus"));
return IMEState(IMEState::ENABLED);
}
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
"no content has focus"));
return IMEState(IMEState::DISABLED);
@ -747,7 +747,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
GettingNewIMEStateBlocker blocker;
IMEState newIMEState = aContent->GetDesiredIMEState();
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns { mEnabled=%s, "
"mOpen=%s }",
GetIMEStateEnabledName(newIMEState.mEnabled),
@ -768,7 +768,7 @@ public:
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (observerService) {
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEEnabledStateChangedEvent::Run(), notifies observers of "
"\"ime-enabled-state-changed\""));
nsAutoString state;
@ -809,7 +809,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
nsIWidget* aWidget,
InputContextAction aAction)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::SetIMEState(aState={ mEnabled=%s, mOpen=%s }, "
"aContent=0x%p, aWidget=0x%p, aAction={ mCause=%s, mFocusChange=%s })",
GetIMEStateEnabledName(aState.mEnabled),
@ -897,7 +897,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
}
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::SetIMEState(), "
"calling nsIWidget::SetInputContext(context={ mIMEState={ mEnabled=%s, "
"mOpen=%s }, mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", "
@ -939,7 +939,7 @@ IMEStateManager::DispatchCompositionEvent(
EventDispatchingCallback* aCallBack,
bool aIsSynthesized)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::DispatchCompositionEvent(aNode=0x%p, "
"aPresContext=0x%p, aCompositionEvent={ message=%s, "
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
@ -968,7 +968,7 @@ IMEStateManager::DispatchCompositionEvent(
if (NS_WARN_IF(aIsSynthesized)) {
return;
}
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"adding new TextComposition to the array"));
MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START);
@ -1004,7 +1004,7 @@ IMEStateManager::DispatchCompositionEvent(
TextCompositionArray::index_type i =
sTextCompositions->IndexOf(aCompositionEvent->widget);
if (i != TextCompositionArray::NoIndex) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"removing TextComposition from the array since NS_COMPOSTION_END "
"was dispatched"));
@ -1022,7 +1022,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// Note that this method is never called for synthesized events for emulating
// commit or cancel composition.
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
"message=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->message),
@ -1045,7 +1045,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// a TextComposition instance for the composition was already removed from
// the array and destroyed in OnDestroyPresContext(). Therefore, we may
// fail to retrieve a TextComposition instance here.
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(), "
"TextComposition instance for the widget has already gone"));
return;
@ -1066,14 +1066,14 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
bool isSynthesizedForTests =
composition && composition->IsSynthesizedForTests();
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::NotifyIME(aMessage=%s, aWidget=0x%p), "
"composition=0x%p, composition->IsSynthesizedForTests()=%s",
GetNotifyIMEMessageName(aMessage), aWidget, composition.get(),
GetBoolName(isSynthesizedForTests)));
if (NS_WARN_IF(!aWidget)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget"));
return NS_ERROR_INVALID_ARG;
}
@ -1101,7 +1101,7 @@ nsresult
IMEStateManager::NotifyIME(IMEMessage aMessage,
nsPresContext* aPresContext)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::NotifyIME(aMessage=%s, aPresContext=0x%p)",
GetNotifyIMEMessageName(aMessage), aPresContext));
@ -1109,7 +1109,7 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
nsIWidget* widget = aPresContext->GetRootWidget();
if (NS_WARN_IF(!widget)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget for the "
"nsPresContext"));
return NS_ERROR_NOT_AVAILABLE;
@ -1176,18 +1176,18 @@ IMEStateManager::IsIMEObserverNeeded(const IMEState& aState)
void
IMEStateManager::DestroyIMEContentObserver()
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::DestroyIMEContentObserver(), "
"sActiveIMEContentObserver=0x%p",
sActiveIMEContentObserver));
if (!sActiveIMEContentObserver) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DestroyIMEContentObserver() does nothing"));
return;
}
PR_LOG(sISMLog, PR_LOG_DEBUG,
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DestroyIMEContentObserver(), destroying "
"the active IMEContentObserver..."));
nsRefPtr<IMEContentObserver> tsm;
@ -1199,7 +1199,7 @@ IMEStateManager::DestroyIMEContentObserver()
void
IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
{
PR_LOG(sISMLog, PR_LOG_ALWAYS,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::CreateIMEContentObserver(aEditor=0x%p), "
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
"sActiveIMEContentObserver->IsManaging(sPresContext, sContent)=%s",
@ -1208,7 +1208,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
sActiveIMEContentObserver->IsManaging(sPresContext, sContent) : false)));
if (NS_WARN_IF(sActiveIMEContentObserver)) {
PR_LOG(sISMLog, PR_LOG_ERROR,
MOZ_LOG(sISMLog, LogLevel::Error,
("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to "
"there is already an active IMEContentObserver"));
MOZ_ASSERT(sActiveIMEContentObserver->IsManaging(