Bug 1125865: Only log Windows sandbox violations to console when nsContentUtils is initialized. r=bbondy
authorBob Owen <bobowencode@gmail.com>
Wed, 28 Jan 2015 11:21:24 +0000
changeset 239612 be47e171801894260d9096113a8739decdf96fac
parent 239611 a80438019d254db615f819349aa6a17ab9b12029
child 239613 c4df6e6c0321ad8622ac4a68a3e9efca6d93d77d
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewersbbondy
bugs1125865
milestone38.0a1
Bug 1125865: Only log Windows sandbox violations to console when nsContentUtils is initialized. r=bbondy
security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
--- a/security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
+++ b/security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
@@ -98,17 +98,19 @@ Log(const char* aMessageType,
 
   std::string msg = msgStream.str();
 #if defined(DEBUG)
   // Use NS_DebugBreak directly as we want child process prefix, but not source
   // file or line number.
   NS_DebugBreak(NS_DEBUG_WARNING, nullptr, msg.c_str(), nullptr, -1);
 #endif
 
-  nsContentUtils::LogMessageToConsole(msg.c_str());
+  if (nsContentUtils::IsInitialized()) {
+    nsContentUtils::LogMessageToConsole(msg.c_str());
+  }
 }
 
 // Initialize sandbox logging if required.
 static void
 InitLoggingIfRequired()
 {
   if (!sProvideLogFunctionCb) {
     return;