Bug 1407492: remove aec log dir user pref. r=mjf
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 10 Oct 2017 19:43:37 -0700
changeset 385864 5579a492f9648f0b5634485eb962500cc1edb453
parent 385863 1da1df814ad3bcb7aefb5f2c00c18b3c55f72284
child 385865 d1225e35f57071f8d4c9f117eade868a63d83956
push id53186
push userdrno@ohlmeier.org
push dateThu, 12 Oct 2017 17:23:03 +0000
treeherderautoland@5579a492f964 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1407492
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1407492: remove aec log dir user pref. r=mjf MozReview-Commit-ID: 5oNuOrSHY2y
media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
modules/libpref/init/all.js
--- a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
+++ b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
@@ -56,22 +56,21 @@ private:
 
 // For WEBRTC_TRACE()
 static WebRtcTraceCallback gWebRtcCallback;
 // For LOG()
 static mozilla::StaticAutoPtr<LogSinkImpl> sSink;
 
 void
 GetWebRtcLogPrefs(uint32_t *aTraceMask, nsACString& aLogFile,
-                  nsACString& aAECLogDir, bool *aMultiLog)
+                  bool *aMultiLog)
 {
   *aMultiLog = mozilla::Preferences::GetBool("media.webrtc.debug.multi_log");
   *aTraceMask = mozilla::Preferences::GetUint("media.webrtc.debug.trace_mask");
   mozilla::Preferences::GetCString("media.webrtc.debug.log_file", aLogFile);
-  mozilla::Preferences::GetCString("media.webrtc.debug.aec_log_dir", aAECLogDir);
   webrtc::Trace::set_aec_debug_size(mozilla::Preferences::GetUint("media.webrtc.debug.aec_dump_max_size"));
 }
 
 mozilla::LogLevel
 CheckOverrides(uint32_t *aTraceMask, nsACString *aLogFile, bool *aMultiLog)
 {
   mozilla::LogModule *log_info = sWebRtcLog;
   mozilla::LogLevel log_level = log_info->Level();
@@ -118,17 +117,17 @@ CheckOverrides(uint32_t *aTraceMask, nsA
   const char *file_name = PR_GetEnv("WEBRTC_TRACE_FILE");
   if (file_name) {
     aLogFile->Assign(file_name);
   }
   return log_level;
 }
 
 void ConfigWebRtcLog(mozilla::LogLevel level, uint32_t trace_mask,
-                     nsCString &aLogFile, nsCString &aAECLogDir, bool multi_log)
+                     nsCString &aLogFile, bool multi_log)
 {
   if (gWebRtcTraceLoggingOn) {
     return;
   }
 
 #if defined(ANDROID)
   // Special case: use callback to pipe to NSPR logging.
   aLogFile.Assign(default_log_name);
@@ -212,99 +211,86 @@ void StartWebRtcLog(uint32_t log_level)
       webrtc::Trace::set_level_filter(webrtc::kTraceNone);
     }
     return;
   }
 
   uint32_t trace_mask = 0;
   bool multi_log = false;
   nsAutoCString log_file;
-  nsAutoCString aec_log_dir;
 
-  GetWebRtcLogPrefs(&trace_mask, log_file, aec_log_dir, &multi_log);
+  GetWebRtcLogPrefs(&trace_mask, log_file, &multi_log);
   mozilla::LogLevel level = CheckOverrides(&trace_mask, &log_file, &multi_log);
 
   if (trace_mask == 0) {
     trace_mask = log_level;
   }
 
-  ConfigWebRtcLog(level, trace_mask, log_file, aec_log_dir, multi_log);
+  ConfigWebRtcLog(level, trace_mask, log_file, multi_log);
 
 }
 
 void EnableWebRtcLog()
 {
   if (gWebRtcTraceLoggingOn) {
     return;
   }
 
   uint32_t trace_mask = 0;
   bool multi_log = false;
   nsAutoCString log_file;
-  nsAutoCString aec_log_dir;
 
-  GetWebRtcLogPrefs(&trace_mask, log_file, aec_log_dir, &multi_log);
+  GetWebRtcLogPrefs(&trace_mask, log_file, &multi_log);
   mozilla::LogLevel level = CheckOverrides(&trace_mask, &log_file, &multi_log);
-  ConfigWebRtcLog(level, trace_mask, log_file, aec_log_dir, multi_log);
+  ConfigWebRtcLog(level, trace_mask, log_file, multi_log);
 }
 
 // Called when we destroy the singletons from PeerConnectionCtx or if the
 // user changes logging in about:webrtc
 void StopWebRtcLog()
 {
   // TODO(NG) strip/fix gWebRtcTraceLoggingOn which is never set to true
   webrtc::Trace::set_level_filter(webrtc::kTraceNone);
   webrtc::Trace::SetTraceCallback(nullptr);
   webrtc::Trace::SetTraceFile(nullptr);
   if (sSink) {
     rtc::LogMessage::RemoveLogToStream(sSink);
     sSink = nullptr;
   }
 }
 
-void ConfigAecLog(nsCString &aAECLogDir) {
+void ConfigAecLog() {
   if (webrtc::Trace::aec_debug()) {
     return;
   }
+  nsCString aAECLogDir;
 #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);
-  }
+  aAECLogDir.Assign(default_tmp_dir);
 #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);
-      }
-    }
+  nsCOMPtr<nsIFile> tempDir;
+  nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir));
+  if (NS_SUCCEEDED(rv)) {
+    tempDir->GetNativePath(aAECLogDir);
   }
 #endif
   webrtc::Trace::set_aec_debug_filename(aAECLogDir.get());
-  if (XRE_IsParentProcess()) {
-    // Capture the final choice for the aec_log_dir setting.
-    mozilla::Preferences::SetCString("media.webrtc.debug.aec_log_dir", aAECLogDir);
-  }
 }
 
 void StartAecLog()
 {
   if (webrtc::Trace::aec_debug()) {
     return;
   }
   uint32_t trace_mask = 0;
   bool multi_log = false;
   nsAutoCString log_file;
-  nsAutoCString aec_log_dir;
 
-  GetWebRtcLogPrefs(&trace_mask, log_file, aec_log_dir, &multi_log);
+  GetWebRtcLogPrefs(&trace_mask, log_file, &multi_log);
   CheckOverrides(&trace_mask, &log_file, &multi_log);
-  ConfigAecLog(aec_log_dir);
+  ConfigAecLog();
 
   webrtc::Trace::set_aec_debug(true);
 }
 
 void StopAecLog()
 {
   webrtc::Trace::set_aec_debug(false);
 }
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -466,17 +466,16 @@ pref("media.navigator.video.use_remb", t
 pref("media.navigator.video.use_tmmbr", false);
 pref("media.navigator.audio.use_fec", true);
 pref("media.navigator.video.red_ulpfec_enabled", false);
 
 pref("media.peerconnection.dtmf.enabled", true);
 
 pref("media.webrtc.debug.trace_mask", 0);
 pref("media.webrtc.debug.multi_log", false);
-pref("media.webrtc.debug.aec_log_dir", "");
 pref("media.webrtc.debug.log_file", "");
 pref("media.webrtc.debug.aec_dump_max_size", 4194304); // 4MB
 
 pref("media.navigator.video.default_width",0);  // adaptive default
 pref("media.navigator.video.default_height",0); // adaptive default
 pref("media.peerconnection.enabled", true);
 pref("media.peerconnection.video.enabled", true);
 pref("media.navigator.video.max_fs", 12288); // Enough for 2048x1536