bug-1256430 start AEC log independently of webrtc TRACE; r?pkerr draft
author[:ng] <na-g@nostrum.com>
Thu, 17 Mar 2016 13:25:50 -0700
changeset 342212 faec5b6a30e3f3951e54baa642fcebb036857dcb
parent 342211 f5292b77b4efdecdba734710e12bfbb2b91fd640
child 342213 fc5e73e7d04b3f35842125e1dd7da765167912d5
push id13362
push userna-g@nostrum.com
push dateFri, 18 Mar 2016 16:26:54 +0000
reviewerspkerr
bugs1256430
milestone48.0a1
bug-1256430 start AEC log independently of webrtc TRACE; r?pkerr MozReview-Commit-ID: EWcstGD5FVb
media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
--- a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
+++ b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
@@ -18,17 +18,16 @@
 #endif
 
 #include "nsIFile.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 
 using mozilla::LogLevel;
 
-//@@NG TODO This is not thread safe. I am not sure if it is necessary at all though. gWebRtcTraceLoggingOn is _never_ set a non-false value.
 static int gWebRtcTraceLoggingOn = 0;
 
 
 #if defined(ANDROID)
 static const char *default_tmp_dir = "/dev/null";
 static const char *default_log_name = "nspr";
 #else // Assume a POSIX environment
 NS_NAMED_LITERAL_CSTRING(default_log_name, "WebRTC.log");
@@ -101,33 +100,24 @@ void CheckOverrides(uint32_t *aTraceMask
 
   const char *file_name = PR_GetEnv("WEBRTC_TRACE_FILE");
   if (file_name) {
     aLogFile->Assign(file_name);
   }
 }
 
 void ConfigAecLog(nsCString &aAECLogDir) {
-  printf("@@NG ConfigAecLog entered.\n");
   if (webrtc::Trace::aec_debug()) {
     return;
   }
-  printf("@@NG ConfigAecLog past guard.\n");
 #if defined(ANDROID)
   // For AEC, do not use a default value: force the user to specify a directory.
   if (aAECLogDir.IsEmpty()) {
     aAECLogDir.Assign(default_tmp_dir);
   }
-  /*#elif defined(XP_MACOSX)
-  printf("@@NG assigning default /tmp/ AEC log dir.\n");
-  if( aAECLogDir.IsEmpty()) {
-    aAECLogDir.Assign("/tmp/");
-  } else {
-    printf("@@NG aECLogDir is not empty: \"%s\"",aAECLogDir.get());
-  }*/
 #else
   if (aAECLogDir.IsEmpty()) {
     nsCOMPtr<nsIFile> tempDir;
     nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir));
     if (NS_SUCCEEDED(rv)) {
       if (aAECLogDir.IsEmpty()) {
         tempDir->GetNativePath(aAECLogDir);
       }
@@ -135,17 +125,16 @@ void ConfigAecLog(nsCString &aAECLogDir)
   }
 #endif
   webrtc::Trace::set_aec_debug_filename(aAECLogDir.get());
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
   if (XRE_IsParentProcess()) {
     // Capture the final choices for the trace settings.
     mozilla::Preferences::SetCString("media.webrtc.debug.aec_log_dir", aAECLogDir);
   }
-  printf("@@NG ConfigAecLog aAECLogDir is %s.\n",aAECLogDir.get());
 #endif
 }
 
 void ConfigWebRtcLog(uint32_t trace_mask, nsCString &aLogFile, nsCString &aAECLogDir, bool multi_log)
 {
   if (gWebRtcTraceLoggingOn) {
     return;
   }
--- a/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
+++ b/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
@@ -676,39 +676,32 @@ int32_t
 WebrtcGlobalInformation::DebugLevel(const GlobalObject& aGlobal)
 {
   return sLastSetLevel;
 }
 
 void
 WebrtcGlobalInformation::SetAecDebug(const GlobalObject& aGlobal, bool aEnable)
 {
-  printf("@@NG WebrtcGlobalInformation::SetAecDebug aEnable=%d XRE_isParentProcess()=%d\n",aEnable,XRE_IsParentProcess());
-  //StartWebRtcLog(sLastSetLevel); // to make it read the aec path
   if( aEnable ) {
-    printf("@@NG WebrtcGlobalInformation::SetAecDebug->StartAecLog()\n");
     StartAecLog();
   } else {
-    printf("@@NG WebrtcGlobalInformation::SetAecDebug->StoptAecLog()\n");
     StopAecLog();
   }
 
-  //webrtc::Trace::set_aec_debug(aEnable);
   sLastAECDebug = aEnable;
 
   for (auto& cp : WebrtcContentParents::GetAll()){
-    printf("@@NG WebrtcGlobalInformation->SendSetAecLogging aEnable=%d\n",aEnable);
     Unused << cp->SendSetAecLogging(aEnable);
   }
 }
 
 bool
 WebrtcGlobalInformation::AecDebug(const GlobalObject& aGlobal)
 {
-  printf("@@NG WebrtcGlobalInformation::AecDebug == %d \n",sLastAECDebug);
   return sLastAECDebug;
 }
 
 bool
 WebrtcGlobalParent::RecvGetStatsResult(const int& aRequestId,
                                        nsTArray<RTCStatsReportInternal>&& Stats)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -886,23 +879,20 @@ WebrtcGlobalChild::RecvClearLogRequest()
 
   RunLogClear();
   return true;
 }
 
 bool
 WebrtcGlobalChild::RecvSetAecLogging(const bool& aEnable)
 {
-  printf("@@NG RecvSetAecLogging\n");
   if (!mShutdown) {
     if( aEnable ) {
-      printf("@@NG WebrtcGlobalChild::RecvSetAecLogging->StartAecLog\n");
       StartAecLog();
     } else {
-      printf("@@NG WebrtcGlobalChild::RecvSetAecLogging->StopAecLog\n");
       StopAecLog();
     }
   }
   return true;
 }
 
 bool
 WebrtcGlobalChild::RecvSetDebugMode(const int& aLevel)