1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/media/webrtc_logging_initializer.h"
7 #include "content/public/renderer/render_thread.h"
8 #include "content/public/renderer/webrtc_log_message_delegate.h"
9 #include "content/renderer/render_thread_impl.h"
10 #include "third_party/libjingle/overrides/talk/base/logging.h"
14 // Shall only be set once and never go back to NULL.
15 WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL;
17 void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) {
18 CHECK(!g_webrtc_logging_delegate);
21 g_webrtc_logging_delegate = delegate;
24 void InitWebRtcLogging() {
25 talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage);
28 void WebRtcLogMessage(const std::string& message) {
29 if (g_webrtc_logging_delegate)
30 g_webrtc_logging_delegate->LogMessage(message);
33 } // namespace content