Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: media/audio/audio_logging.cc

Issue 1864483002: Forward output glitch information from stream WebRTC log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_logging.cc
diff --git a/media/audio/audio_logging.cc b/media/audio/audio_logging.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4361816ddb1449d87bbb145a8cbee59272060927
--- /dev/null
+++ b/media/audio/audio_logging.cc
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#include "media/audio/audio_logging.h"
+
+namespace media {
+
+WebRtcLoggingCallback g_webrtc_logging_callback = nullptr;
+
+// TODO: Make sure it's thread safe.
o1ka 2016/04/05 15:28:42 You can use atomic flag to guard initialization.
+
+void InitWebRtcLoggingCallback(WebRtcLoggingCallback callback) {
+ CHECK(!g_webrtc_logging_callback);
+ g_webrtc_logging_callback = callback;
+}
+
+void WebRtcLogMessage(const std::string& message) {
+ if (g_webrtc_logging_callback)
+ g_webrtc_logging_callback(message);
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698