Back out 1cbb486b4fb7:8e3a17767287 (bug 906990) for leaks
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 28 Oct 2013 15:30:11 -0700
changeset 152585 921f89fa8568fe2fdbb3226ae94ebb0e8119476a
parent 152584 9677c6c4e94a70434eb92dc3b516f995f1c53e47
child 152586 e463952c055f8b2974ae319094972895c7483af8
push id3261
push useremorley@mozilla.com
push dateTue, 29 Oct 2013 16:40:19 +0000
treeherderfx-team@9abfda5e2577 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs906990
milestone27.0a1
backs out1cbb486b4fb73f257088ce3d3a1db974a3b79c88
Back out 1cbb486b4fb7:8e3a17767287 (bug 906990) for leaks CLOSED TREE
media/mtransport/build/moz.build
media/mtransport/nricectx.cpp
media/mtransport/nricemediastream.cpp
media/mtransport/nricemediastream.h
media/mtransport/objs.mozbuild
media/mtransport/rlogringbuffer.cpp
media/mtransport/rlogringbuffer.h
media/mtransport/test/ice_unittest.cpp
media/mtransport/test/moz.build
media/mtransport/test/rlogringbuffer_unittest.cpp
media/mtransport/third_party/nICEr/src/ice/ice_candidate_pair.c
media/mtransport/third_party/nICEr/src/ice/ice_component.c
media/mtransport/third_party/nrappkit/src/log/r_log.c
--- a/media/mtransport/build/moz.build
+++ b/media/mtransport/build/moz.build
@@ -7,17 +7,16 @@
 MODULE = 'mtransport'
 
 EXPORTS.mtransport += [
     '../dtlsidentity.h',
     '../m_cpp_utils.h',
     '../nricectx.h',
     '../nricemediastream.h',
     '../nriceresolverfake.h',
-    '../rlogringbuffer.h',
     '../runnable_utils.h',
     '../runnable_utils_generated.h',
     '../sigslot.h',
     '../transportflow.h',
     '../transportlayer.h',
     '../transportlayerdtls.h',
     '../transportlayerice.h',
     '../transportlayerlog.h',
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -78,17 +78,16 @@ extern "C" {
 #include "ice_handler.h"
 }
 
 // Local includes
 #include "nricectx.h"
 #include "nricemediastream.h"
 #include "nr_socket_prsock.h"
 #include "nrinterfaceprioritizer.h"
-#include "rlogringbuffer.h"
 
 namespace mozilla {
 
 MOZ_MTLOG_MODULE("mtransport")
 
 static bool initialized = false;
 
 // Implement NSPR-based crypto algorithms
@@ -332,20 +331,19 @@ void NrIceCtx::trickle_cb(void *arg, nr_
   s->SignalCandidate(s, candidate_str);
 }
 
 RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
                                   bool offerer,
                                   bool set_interface_priorities) {
   RefPtr<NrIceCtx> ctx = new NrIceCtx(name, offerer);
 
-  // Initialize the crypto callbacks and logging stuff
+  // Initialize the crypto callbacks
   if (!initialized) {
     NR_reg_init(NR_REG_MODE_LOCAL);
-    RLogRingBuffer::CreateInstance();
     nr_crypto_vtbl = &nr_ice_crypto_nss_vtbl;
     initialized = true;
 
     // Set the priorites for candidate type preferences.
     // These numbers come from RFC 5245 S. 4.1.2.2
     NR_reg_set_uchar((char *)"ice.pref.type.srv_rflx", 100);
     NR_reg_set_uchar((char *)"ice.pref.type.peer_rflx", 110);
     NR_reg_set_uchar((char *)"ice.pref.type.host", 126);
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -286,17 +286,16 @@ nsresult NrIceMediaStream::GetCandidateP
       default:
         MOZ_ASSERT(0);
     }
 
     pair.priority = p1->priority;
     pair.nominated = p1->peer_nominated || p1->nominated;
     pair.selected = p1->local->component &&
                     p1->local->component->active == p1;
-    pair.codeword = p1->codeword;
 
     if (!ToNrIceCandidate(*(p1->local), &pair.local) ||
         !ToNrIceCandidate(*(p1->remote), &pair.remote)) {
       return NS_ERROR_FAILURE;
     }
 
     out_pairs->push_back(pair);
   }
--- a/media/mtransport/nricemediastream.h
+++ b/media/mtransport/nricemediastream.h
@@ -99,17 +99,16 @@ struct NrIceCandidatePair {
   // in STATE_SUCCEEDED.
   bool nominated;
   // Set if this candidate pair has been selected. Note: Since we are using
   // aggressive nomination, this could change frequently as ICE runs.
   bool selected;
   NrIceCandidate local;
   NrIceCandidate remote;
   // TODO(bcampen@mozilla.com): Is it important to put the foundation in here?
-  std::string codeword;
 };
 
 // Abstract base class for opaque values.
 class NrIceOpaque {
  public:
   virtual ~NrIceOpaque() {}
 };
 
--- a/media/mtransport/objs.mozbuild
+++ b/media/mtransport/objs.mozbuild
@@ -8,17 +8,16 @@ mtransport_lcppsrcs = [
     'dtlsidentity.cpp',
     'nr_socket_prsock.cpp',
     'nr_timer.cpp',
     'nricectx.cpp',
     'nricemediastream.cpp',
     'nriceresolver.cpp',
     'nriceresolverfake.cpp',
     'nrinterfaceprioritizer.cpp',
-    'rlogringbuffer.cpp',
     'transportflow.cpp',
     'transportlayer.cpp',
     'transportlayerdtls.cpp',
     'transportlayerice.cpp',
     'transportlayerlog.cpp',
     'transportlayerloopback.cpp',
     'transportlayerprsock.cpp',
 ]
deleted file mode 100644
--- a/media/mtransport/rlogringbuffer.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Original author: bcampen@mozilla.com */
-
-#include <cstdarg>
-
-#include "rlogringbuffer.h"
-
-#include <deque>
-#include <string>
-#include "mozilla/Move.h" // Pinch hitting for <utility> and std::move
-#include <vector>
-
-extern "C" {
-#include <csi_platform.h>
-#include "r_log.h"
-}
-
-/* Matches r_dest_vlog type defined in r_log.h */
-static int ringbuffer_vlog(int facility,
-                           int level,
-                           const char *format,
-                           va_list ap) {
-  MOZ_ASSERT(mozilla::RLogRingBuffer::GetInstance());
-  // I could be evil and printf right into a std::string, but unless this
-  // shows up in profiling, it is not worth doing.
-  char temp[4096];
-  vsnprintf(temp, sizeof(temp), format, ap);
-
-  mozilla::RLogRingBuffer::GetInstance()->Log(std::string(temp));
-  return 0;
-}
-
-namespace mozilla {
-
-RLogRingBuffer* RLogRingBuffer::instance;
-
-RLogRingBuffer::RLogRingBuffer()
-  : log_limit_(4096),
-    mutex_("RLogRingBuffer::mutex_") {
-}
-
-RLogRingBuffer::~RLogRingBuffer() {
-}
-
-void RLogRingBuffer::SetLogLimit(uint32_t new_limit) {
-  mozilla::MutexAutoLock lock(mutex_);
-  log_limit_ = new_limit;
-  RemoveOld();
-}
-
-void RLogRingBuffer::Log(std::string&& log) {
-  mozilla::MutexAutoLock lock(mutex_);
-  log_messages_.push_front(Move(log));
-  RemoveOld();
-}
-
-inline void RLogRingBuffer::RemoveOld() {
-  if (log_messages_.size() > log_limit_) {
-    log_messages_.resize(log_limit_);
-  }
-}
-
-
-RLogRingBuffer* RLogRingBuffer::CreateInstance() {
-  if (!instance) {
-    instance = new RLogRingBuffer;
-    r_log_set_extra_destination(LOG_INFO, &ringbuffer_vlog);
-  }
-  return instance;
-}
-
-RLogRingBuffer* RLogRingBuffer::GetInstance() {
-  return instance;
-}
-
-void RLogRingBuffer::DestroyInstance() {
-  // First param is ignored when passing null
-  r_log_set_extra_destination(LOG_INFO, nullptr);
-  delete instance;
-  instance = nullptr;
-}
-
-void RLogRingBuffer::Filter(const std::string& substring,
-                            uint32_t limit,
-                            std::deque<std::string>* matching_logs) {
-  std::vector<std::string> substrings;
-  substrings.push_back(substring);
-  FilterAny(substrings, limit, matching_logs);
-}
-
-inline bool AnySubstringMatches(const std::vector<std::string>& substrings,
-                                const std::string& string) {
-  for (auto sub = substrings.begin(); sub != substrings.end(); ++sub) {
-    if (string.find(*sub) != std::string::npos) {
-      return true;
-    }
-  }
-  return false;
-}
-
-void RLogRingBuffer::FilterAny(const std::vector<std::string>& substrings,
-                               uint32_t limit,
-                               std::deque<std::string>* matching_logs) {
-  mozilla::MutexAutoLock lock(mutex_);
-  if (limit == 0) {
-    // At a max, all of the log messages.
-    limit = log_limit_;
-  }
-
-  for (auto log = log_messages_.begin();
-       log != log_messages_.end() && matching_logs->size() < limit;
-       ++log) {
-    if (AnySubstringMatches(substrings, *log)) {
-      matching_logs->push_front(*log);
-    }
-  }
-}
-
-} // namespace mozilla
-
deleted file mode 100644
--- a/media/mtransport/rlogringbuffer.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Some of this code is cut-and-pasted from nICEr. Copyright is:
-
-/*
-Copyright (c) 2007, Adobe Systems, Incorporated
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of Adobe Systems, Network Resonance nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Original author: bcampen@mozilla.com */
-
-/*
-   This file defines an r_dest_vlog that can be used to accumulate log messages
-   for later inspection/filtering. The intent is to use this for interactive
-   debug purposes on an about:webrtc page or similar.
-*/
-
-#ifndef rlogringbuffer_h__
-#define rlogringbuffer_h__
-
-#include <deque>
-#include <string>
-#include <vector>
-
-#include "mozilla/Mutex.h"
-
-#include "m_cpp_utils.h"
-
-namespace mozilla {
-
-class RLogRingBuffer {
-  public:
-    /*
-       NB: These are not threadsafe, nor are they safe to call during static
-       init/deinit.
-    */
-    static RLogRingBuffer* CreateInstance();
-    static RLogRingBuffer* GetInstance();
-    static void DestroyInstance();
-
-    /*
-       Retrieves log statements that match a given substring, subject to a
-       limit. |matching_logs| will be filled in chronological order (front()
-       is oldest, back() is newest). |limit| == 0 will be interpreted as no
-       limit.
-    */
-    void Filter(const std::string& substring,
-                uint32_t limit,
-                std::deque<std::string>* matching_logs);
-
-    void FilterAny(const std::vector<std::string>& substrings,
-                   uint32_t limit,
-                   std::deque<std::string>* matching_logs);
-
-    inline void GetAny(uint32_t limit,
-                       std::deque<std::string>* matching_logs) {
-      Filter("", limit, matching_logs);
-    }
-
-    void SetLogLimit(uint32_t new_limit);
-
-    void Log(std::string&& log);
-
-  private:
-    RLogRingBuffer();
-    ~RLogRingBuffer();
-    void RemoveOld();
-    static RLogRingBuffer* instance;
-
-    /*
-     * Might be worthwhile making this a circular buffer, but I think it is
-     * preferable to take up as little space as possible if no logging is
-     * happening/the ringbuffer is not being used.
-    */
-    std::deque<std::string> log_messages_;
-    /* Max size of log buffer (should we use time-depth instead/also?) */
-    uint32_t log_limit_;
-    mozilla::Mutex mutex_;
-
-    DISALLOW_COPY_ASSIGN(RLogRingBuffer);
-}; // class RLogRingBuffer
-
-} // namespace mozilla
-
-#endif // rlogringbuffer_h__
-
-
--- a/media/mtransport/test/ice_unittest.cpp
+++ b/media/mtransport/test/ice_unittest.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Original author: ekr@rtfm.com
 
 #include <algorithm>
-#include <deque>
 #include <iostream>
 #include <limits>
 #include <map>
 #include <string>
 #include <vector>
 
 #include "sigslot.h"
 
@@ -26,17 +25,16 @@
 #include "nsXPCOM.h"
 
 #include "nricectx.h"
 #include "nricemediastream.h"
 #include "nriceresolverfake.h"
 #include "nriceresolver.h"
 #include "nrinterfaceprioritizer.h"
 #include "mtransport_test_utils.h"
-#include "rlogringbuffer.h"
 #include "runnable_utils.h"
 #include "stunserver.h"
 // TODO(bcampen@mozilla.com): Big fat hack since the build system doesn't give
 // us a clean way to add object files to a single executable.
 #include "stunserver.cpp"
 
 #define GTEST_HAS_RTTI 0
 #include "gtest/gtest.h"
@@ -102,19 +100,16 @@ bool operator==(const NrIceCandidate& lh
 }
 
 class IceCandidatePairCompare {
   public:
     bool operator()(const NrIceCandidatePair& lhs,
                     const NrIceCandidatePair& rhs) const {
       if (lhs.priority == rhs.priority) {
         if (lhs.local == rhs.local) {
-          if (lhs.remote == rhs.remote) {
-            return lhs.codeword < rhs.codeword;
-          }
           return lhs.remote < rhs.remote;
         }
         return lhs.local < rhs.local;
       }
       return lhs.priority < rhs.priority;
     }
 };
 
@@ -479,18 +474,17 @@ class IceTestPeer : public sigslot::has_
 
   void DumpCandidatePair(const NrIceCandidatePair& pair) {
       std::cerr << std::endl;
       DumpCandidate("Local", pair.local);
       DumpCandidate("Remote", pair.remote);
       std::cerr << "state = " << pair.state
                 << " priority = " << pair.priority
                 << " nominated = " << pair.nominated
-                << " selected = " << pair.selected
-                << " codeword = " << pair.codeword << std::endl;
+                << " selected = " << pair.selected << std::endl;
   }
 
   void DumpCandidatePairs(NrIceMediaStream *stream) {
     std::vector<NrIceCandidatePair> pairs;
     nsresult res = stream->GetCandidatePairs(&pairs);
     ASSERT_TRUE(NS_SUCCEEDED(res));
 
     std::cerr << "Begin list of candidate pairs [" << std::endl;
@@ -1223,59 +1217,16 @@ TEST_F(IceConnectTest, TestPollCandPairs
 
   WaitForComplete();
   p1_->UpdateAndValidateCandidatePairs(0, &pairs1);
   p2_->UpdateAndValidateCandidatePairs(0, &pairs2);
   ASSERT_TRUE(ContainsSucceededPair(pairs1));
   ASSERT_TRUE(ContainsSucceededPair(pairs2));
 }
 
-TEST_F(IceConnectTest, TestRLogRingBuffer) {
-  RLogRingBuffer::CreateInstance();
-  AddStream("first", 1);
-  ASSERT_TRUE(Gather(true));
-
-  p1_->Connect(p2_, TRICKLE_NONE, false);
-  p2_->Connect(p1_, TRICKLE_NONE, false);
-
-  std::vector<NrIceCandidatePair> pairs1;
-  std::vector<NrIceCandidatePair> pairs2;
-
-  p1_->StartChecks();
-  p1_->UpdateAndValidateCandidatePairs(0, &pairs1);
-  p2_->UpdateAndValidateCandidatePairs(0, &pairs2);
-
-  p2_->StartChecks();
-  p1_->UpdateAndValidateCandidatePairs(0, &pairs1);
-  p2_->UpdateAndValidateCandidatePairs(0, &pairs2);
-
-  WaitForComplete();
-  p1_->UpdateAndValidateCandidatePairs(0, &pairs1);
-  p2_->UpdateAndValidateCandidatePairs(0, &pairs2);
-  ASSERT_TRUE(ContainsSucceededPair(pairs1));
-  ASSERT_TRUE(ContainsSucceededPair(pairs2));
-
-  for (auto p = pairs1.begin(); p != pairs1.end(); ++p) {
-    std::deque<std::string> logs;
-    std::string substring("CAND-PAIR(");
-    substring += p->codeword;
-    RLogRingBuffer::GetInstance()->Filter(substring, 0, &logs);
-    ASSERT_NE(0U, logs.size());
-  }
-
-  for (auto p = pairs2.begin(); p != pairs2.end(); ++p) {
-    std::deque<std::string> logs;
-    std::string substring("CAND-PAIR(");
-    substring += p->codeword;
-    RLogRingBuffer::GetInstance()->Filter(substring, 0, &logs);
-    ASSERT_NE(0U, logs.size());
-  }
-
-  RLogRingBuffer::DestroyInstance();
-}
 
 TEST_F(PrioritizerTest, TestPrioritizer) {
   SetPriorizer(::mozilla::CreateInterfacePrioritizer());
 
   AddInterface("0", NR_INTERFACE_TYPE_VPN, 100); // unknown vpn
   AddInterface("1", NR_INTERFACE_TYPE_VPN | NR_INTERFACE_TYPE_WIRED, 100); // wired vpn
   AddInterface("2", NR_INTERFACE_TYPE_VPN | NR_INTERFACE_TYPE_WIFI, 100); // wifi vpn
   AddInterface("3", NR_INTERFACE_TYPE_VPN | NR_INTERFACE_TYPE_MOBILE, 100); // wifi vpn
--- a/media/mtransport/test/moz.build
+++ b/media/mtransport/test/moz.build
@@ -5,17 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'test_mtransport'
 
 if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     CPP_UNIT_TESTS += [
         'ice_unittest.cpp',
         'nrappkit_unittest.cpp',
-        'rlogringbuffer_unittest.cpp',
         'runnable_utils_unittest.cpp',
         'sockettransportservice_unittest.cpp',
         'TestSyncRunnable.cpp',
         'transport_unittests.cpp',
         'turn_unittest.cpp',
     ]
 
     if CONFIG['MOZ_SCTP']:
deleted file mode 100644
--- a/media/mtransport/test/rlogringbuffer_unittest.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Original author: bcampen@mozilla.com */
-
-#include "rlogringbuffer.h"
-
-extern "C" {
-#include "registry.h"
-#include "r_log.h"
-}
-
-#define GTEST_HAS_RTTI 0
-#include "gtest/gtest.h"
-#include "gtest_utils.h"
-
-#include <deque>
-#include <string>
-#include <vector>
-
-using mozilla::RLogRingBuffer;
-
-int NR_LOG_TEST = 0;
-
-class RLogRingBufferTest : public ::testing::Test {
-  public:
-    RLogRingBufferTest() {
-      Init();
-    }
-
-    ~RLogRingBufferTest() {
-      Free();
-    }
-
-    void Init() {
-      RLogRingBuffer::CreateInstance();
-    }
-
-    void Free() {
-      RLogRingBuffer::DestroyInstance();
-    }
-
-    void ReInit() {
-      Free();
-      Init();
-    }
-};
-
-TEST_F(RLogRingBufferTest, TestGetFree) {
-  RLogRingBuffer* instance = RLogRingBuffer::GetInstance();
-  ASSERT_NE(nullptr, instance);
-}
-
-TEST_F(RLogRingBufferTest, TestFilterEmpty) {
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(0U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestBasicFilter) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->Filter("Test", 0, &logs);
-  ASSERT_EQ(1U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestBasicFilterContent) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->Filter("Test", 0, &logs);
-  ASSERT_EQ("Test", logs.back());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterAnyFrontMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::vector<std::string> substrings;
-  substrings.push_back("foo");
-  substrings.push_back("Test");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->FilterAny(substrings, 0, &logs);
-  ASSERT_EQ("Test", logs.back());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterAnyBackMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::vector<std::string> substrings;
-  substrings.push_back("Test");
-  substrings.push_back("foo");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->FilterAny(substrings, 0, &logs);
-  ASSERT_EQ("Test", logs.back());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterAnyBothMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::vector<std::string> substrings;
-  substrings.push_back("Tes");
-  substrings.push_back("est");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->FilterAny(substrings, 0, &logs);
-  ASSERT_EQ("Test", logs.back());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterAnyNeitherMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test");
-  std::vector<std::string> substrings;
-  substrings.push_back("tes");
-  substrings.push_back("esT");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->FilterAny(substrings, 0, &logs);
-  ASSERT_EQ(0U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestAllMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(2U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestOrder) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ("Test2", logs.back());
-  ASSERT_EQ("Test1", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestNoMatch) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->Filter("foo", 0, &logs);
-  ASSERT_EQ(0U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestSubstringFilter) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->Filter("t1", 0, &logs);
-  ASSERT_EQ(1U, logs.size());
-  ASSERT_EQ("Test1", logs.back());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterLimit) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->Filter("Test", 2, &logs);
-  ASSERT_EQ(2U, logs.size());
-  ASSERT_EQ("Test6", logs.back());
-  ASSERT_EQ("Test5", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestFilterAnyLimit) {
-  r_log(NR_LOG_TEST, LOG_INFO, "TestOne");
-  r_log(NR_LOG_TEST, LOG_INFO, "TestTwo");
-  r_log(NR_LOG_TEST, LOG_INFO, "TestThree");
-  r_log(NR_LOG_TEST, LOG_INFO, "TestFour");
-  r_log(NR_LOG_TEST, LOG_INFO, "TestFive");
-  r_log(NR_LOG_TEST, LOG_INFO, "TestSix");
-  std::vector<std::string> substrings;
-  // Matches Two, Three, Four, and Six
-  substrings.push_back("tT");
-  substrings.push_back("o");
-  substrings.push_back("r");
-  substrings.push_back("S");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->FilterAny(substrings, 2, &logs);
-  ASSERT_EQ(2U, logs.size());
-  ASSERT_EQ("TestSix", logs.back());
-  ASSERT_EQ("TestFour", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestLimit) {
-  RLogRingBuffer::GetInstance()->SetLogLimit(3);
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(3U, logs.size());
-  ASSERT_EQ("Test6", logs.back());
-  ASSERT_EQ("Test4", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestLimitBulkDiscard) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  RLogRingBuffer::GetInstance()->SetLogLimit(3);
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(3U, logs.size());
-  ASSERT_EQ("Test6", logs.back());
-  ASSERT_EQ("Test4", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestIncreaseLimit) {
-  RLogRingBuffer::GetInstance()->SetLogLimit(3);
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  RLogRingBuffer::GetInstance()->SetLogLimit(300);
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(3U, logs.size());
-  ASSERT_EQ("Test6", logs.back());
-  ASSERT_EQ("Test4", logs.front());
-}
-
-TEST_F(RLogRingBufferTest, TestClear) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  RLogRingBuffer::GetInstance()->SetLogLimit(0);
-  RLogRingBuffer::GetInstance()->SetLogLimit(4096);
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(0U, logs.size());
-}
-
-TEST_F(RLogRingBufferTest, TestReInit) {
-  r_log(NR_LOG_TEST, LOG_INFO, "Test1");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test2");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test3");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test4");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test5");
-  r_log(NR_LOG_TEST, LOG_INFO, "Test6");
-  ReInit();
-  std::deque<std::string> logs;
-  RLogRingBuffer::GetInstance()->GetAny(0, &logs);
-  ASSERT_EQ(0U, logs.size());
-}
-
-int main(int argc, char** argv) {
-  NR_reg_init(NR_REG_MODE_LOCAL);
-  r_log_init();
-  /* Would be nice to be able to register/unregister in the fixture */
-  const char* facility = "rlogringbuffer_test";
-  r_log_register(const_cast<char*>(facility), &NR_LOG_TEST);
-  ::testing::InitGoogleTest(&argc, argv);
-
-  int rv = RUN_ALL_TESTS();
-  return rv;
-}
-
--- a/media/mtransport/third_party/nICEr/src/ice/ice_candidate_pair.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_candidate_pair.c
@@ -378,17 +378,17 @@ int nr_ice_candidate_pair_start(nr_ice_p
     return(_status);
   }
 
 
 int nr_ice_candidate_pair_do_triggered_check(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair)
   {
     int r,_status;
 
-    r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/CAND-PAIR(%s): triggered check on %s",pctx->label,pair->codeword,pair->as_string);
+    r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/CAND-PAIR(%s): triggered check on %s",pctx->label,pair->codeword,pair->as_string);
 
     switch(pair->state){
       case NR_ICE_PAIR_STATE_FROZEN:
         nr_ice_candidate_pair_set_state(pctx,pair,NR_ICE_PAIR_STATE_WAITING);
         /* Fall through */
       case NR_ICE_PAIR_STATE_WAITING:
         /* Start the checks */
         if(r=nr_ice_candidate_pair_start(pctx,pair))
@@ -456,17 +456,17 @@ int nr_ice_candidate_pair_select(nr_ice_
   abort:
     return(_status);
  }
 
 int nr_ice_candidate_pair_set_state(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair, int state)
   {
     int r,_status;
 
-    r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/CAND-PAIR(%s): setting pair to state %s: %s",
+    r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/CAND-PAIR(%s): setting pair to state %s: %s",
       pctx->label,pair->codeword,nr_ice_cand_pair_states[state],pair->as_string);
 
     /* NOTE: This function used to reference pctx->state instead of
        pair->state and the assignment to pair->state was at the top
        of this function. Because pctx->state was never changed, this seems to have
        been a typo. The natural logic is "if the state changed
        decrement the counter" so this implies we should be checking
        the pair state rather than the pctx->state.
@@ -528,17 +528,17 @@ int nr_ice_candidate_pair_insert(nr_ice_
 
 void nr_ice_candidate_pair_restart_stun_nominated_cb(NR_SOCKET s, int how, void *cb_arg)
   {
     nr_ice_cand_pair *pair=cb_arg;
     int r,_status;
 
     pair->restart_nominated_cb_timer=0;
 
-    r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/CAND-PAIR(%s)/COMP(%d): Restarting pair as nominated: %s",pair->pctx->label,pair->local->stream->label,pair->codeword,pair->remote->component->component_id,pair->as_string);
+    r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/CAND-PAIR(%s)/COMP(%d): Restarting pair as nominated: %s",pair->pctx->label,pair->local->stream->label,pair->codeword,pair->remote->component->component_id,pair->as_string);
 
     nr_stun_client_reset(pair->stun_client);
 
     if(r=nr_stun_client_start(pair->stun_client,NR_ICE_CLIENT_MODE_USE_CANDIDATE,nr_ice_candidate_pair_stun_cb,pair))
       ABORT(r);
 
     if(r=nr_ice_ctx_remember_id(pair->pctx->ctx, pair->stun_client->request))
       ABORT(r);
@@ -550,17 +550,17 @@ void nr_ice_candidate_pair_restart_stun_
 
 static void nr_ice_candidate_pair_restart_stun_controlled_cb(NR_SOCKET s, int how, void *cb_arg)
   {
     nr_ice_cand_pair *pair=cb_arg;
     int r,_status;
 
     pair->restart_controlled_cb_timer=0;
 
-    r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/CAND-PAIR(%s):COMP(%d): Restarting pair as CONTROLLED: %s",pair->pctx->label,pair->local->stream->label,pair->codeword,pair->remote->component->component_id,pair->as_string);
+    r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/CAND-PAIR(%s):COMP(%d): Restarting pair as CONTROLLED: %s",pair->pctx->label,pair->local->stream->label,pair->codeword,pair->remote->component->component_id,pair->as_string);
 
     nr_stun_client_reset(pair->stun_client);
     pair->stun_client->params.ice_binding_request.control=NR_ICE_CONTROLLED;
 
     if(r=nr_stun_client_start(pair->stun_client,NR_ICE_CLIENT_MODE_BINDING_REQUEST,nr_ice_candidate_pair_stun_cb,pair))
       ABORT(r);
 
     if(r=nr_ice_ctx_remember_id(pair->pctx->ctx, pair->stun_client->request))
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
@@ -787,35 +787,35 @@ int nr_ice_component_nominated_pair(nr_i
 
     if(!comp->nominated)
       fire_cb=1;
 
     /* Are we changing what the nominated pair is? */
     if(comp->nominated){
       if(comp->nominated->priority > pair->priority)
         return(0);
-      r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): replacing pair %s with CAND-PAIR(%s)",comp->stream->pctx->label,comp->stream->label,comp->component_id,comp->nominated->codeword,comp->nominated->as_string,pair->codeword);
+      r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): replacing pair %s with CAND-PAIR(%s)",comp->stream->pctx->label,comp->stream->label,comp->component_id,comp->nominated->codeword,comp->nominated->as_string,pair->codeword);
     }
 
     /* Set the new nominated pair */
     r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): nominated pair is %s",comp->stream->pctx->label,comp->stream->label,comp->component_id,pair->codeword,pair->as_string);
     comp->state=NR_ICE_COMPONENT_NOMINATED;
     comp->nominated=pair;
     comp->active=pair;
 
-    r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): cancelling all pairs but %s",comp->stream->pctx->label,comp->stream->label,comp->component_id,pair->codeword,pair->as_string);
+    r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): cancelling all pairs but %s",comp->stream->pctx->label,comp->stream->label,comp->component_id,pair->codeword,pair->as_string);
 
     /* Cancel checks in WAITING and FROZEN per ICE S 8.1.2 */
     p2=TAILQ_FIRST(&comp->stream->check_list);
     while(p2){
       if((p2 != pair) &&
          (p2->remote->component->component_id == comp->component_id) &&
          ((p2->state == NR_ICE_PAIR_STATE_FROZEN) ||
 	  (p2->state == NR_ICE_PAIR_STATE_WAITING))) {
-        r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): cancelling FROZEN/WAITING pair %s because CAND-PAIR(%s) was nominated.",comp->stream->pctx->label,comp->stream->label,comp->component_id,p2->codeword,p2->as_string,pair->codeword);
+        r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/COMP(%d)/CAND-PAIR(%s): cancelling FROZEN/WAITING pair %s because CAND-PAIR(%s) was nominated.",comp->stream->pctx->label,comp->stream->label,comp->component_id,p2->codeword,p2->as_string,pair->codeword);
 
         if(r=nr_ice_candidate_pair_cancel(pair->pctx,p2))
           ABORT(r);
       }
 
       p2=TAILQ_NEXT(p2,entry);
     }
     r_log(LOG_ICE,LOG_DEBUG,"ICE-PEER(%s)/STREAM(%s)/COMP(%d): cancelling done",comp->stream->pctx->label,comp->stream->label,comp->component_id);
--- a/media/mtransport/third_party/nrappkit/src/log/r_log.c
+++ b/media/mtransport/third_party/nrappkit/src/log/r_log.c
@@ -325,25 +325,16 @@ int r_dump(int facility,int level,char *
       r_log(facility,level,"%s[%d]=%s",name,len,hex);
     else
       r_log(facility,level,"%s",hex);
 
     RFREE(hex);
     return(0);
   }
 
-// Some platforms (notably WIN32) do not have this
-#ifndef va_copy
-  #ifdef WIN32
-    #define va_copy(dest, src) ( (dest) = (src) )
-  #else  // WIN32
-    #error va_copy undefined, and semantics of assignment on va_list unknown
-  #endif //WIN32
-#endif //va_copy
-
 int r_vlog(int facility,int level,const char *format,va_list ap)
   {
     char log_fmt_buf[MAX_ERROR_STRING_SIZE];
     char *level_str="unknown";
     char *facility_str="unknown";
     char *fmt_str=(char *)format;
     int i;
 
@@ -358,22 +349,17 @@ int r_vlog(int facility,int level,const 
         facility_str,level_str,format);
 
       log_fmt_buf[MAX_ERROR_STRING_SIZE-1]=0;
       fmt_str=log_fmt_buf;
     }
 
     for(i=0; i<LOG_NUM_DESTINATIONS; i++){
       if(r_logging_dest(i,facility,level)){
-        // Some platforms do not react well when you use a va_list more than
-        // once
-        va_list copy;
-        va_copy(copy, ap);
-        log_destinations[i].dest_vlog(facility,level,fmt_str,copy);
-        va_end(copy);
+        log_destinations[i].dest_vlog(facility,level,fmt_str,ap);
       }
     }
     return(0);
   }
 
 int stderr_vlog(int facility,int level,const char *format,va_list ap)
   {
 #if 0 /* remove time stamping, for now */