OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "content/renderer/media/webrtc_logging_initializer_impl.h" |
| 6 |
| 7 #include "content/public/renderer/media/webrtc_log_message_delegate.h" |
| 8 #include "content/public/renderer/media/webrtc_logging_initializer.h" |
| 9 #include "content/public/renderer/render_thread.h" |
| 10 #include "content/renderer/render_thread_impl.h" |
| 11 #include "third_party/libjingle/overrides/talk/base/logging.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // Shall only be set once and never go back to NULL. |
| 16 WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; |
| 17 |
| 18 void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { |
| 19 CHECK(!g_webrtc_logging_delegate); |
| 20 CHECK(delegate); |
| 21 |
| 22 g_webrtc_logging_delegate = delegate; |
| 23 } |
| 24 |
| 25 void InitWebRtcLogging(const std::string& app_session_id, |
| 26 const std::string& app_url) { |
| 27 if (g_webrtc_logging_delegate) { |
| 28 g_webrtc_logging_delegate->InitLogging(app_session_id, app_url); |
| 29 talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage); |
| 30 } |
| 31 } |
| 32 |
| 33 void WebRtcLogMessage(const std::string& message) { |
| 34 if (g_webrtc_logging_delegate) |
| 35 g_webrtc_logging_delegate->LogMessage(message); |
| 36 } |
| 37 |
| 38 } // namespace content |
OLD | NEW |