OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/webrtc_logging_initializer.h" | 5 #include "content/renderer/media/webrtc_logging_initializer.h" |
6 | 6 |
7 #include "content/public/renderer/render_thread.h" | 7 #include "content/public/renderer/render_thread.h" |
8 #include "content/public/renderer/webrtc_log_message_delegate.h" | 8 #include "content/public/renderer/webrtc_log_message_delegate.h" |
9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
10 #include "third_party/libjingle/overrides/talk/base/logging.h" | 10 #include "third_party/libjingle/overrides/talk/base/logging.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // Shall only be set once and never go back to NULL. | 14 // Shall only be set once and never go back to NULL. |
15 WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; | 15 WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; |
16 | 16 |
17 void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { | 17 void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { |
18 CHECK(!g_webrtc_logging_delegate); | 18 CHECK(!g_webrtc_logging_delegate); |
19 CHECK(delegate); | 19 CHECK(delegate); |
20 | 20 |
21 g_webrtc_logging_delegate = delegate; | 21 g_webrtc_logging_delegate = delegate; |
22 } | 22 } |
23 | 23 |
24 void InitWebRtcLogging(const std::string& app_session_id, | 24 void InitWebRtcLogging() { |
Jói
2013/09/27 14:39:53
Did you mean to completely remove the declaration
Henrik Grunell
2013/10/02 12:47:18
The "old" InitWebRtcLogging has been removed. It w
| |
25 const std::string& app_url) { | 25 talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage); |
26 if (g_webrtc_logging_delegate) { | |
27 g_webrtc_logging_delegate->InitLogging(app_session_id, app_url); | |
28 talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage); | |
29 } | |
30 } | 26 } |
31 | 27 |
32 void WebRtcLogMessage(const std::string& message) { | 28 void WebRtcLogMessage(const std::string& message) { |
33 if (g_webrtc_logging_delegate) | 29 if (g_webrtc_logging_delegate) |
34 g_webrtc_logging_delegate->LogMessage(message); | 30 g_webrtc_logging_delegate->LogMessage(message); |
35 } | 31 } |
36 | 32 |
37 } // namespace content | 33 } // namespace content |
OLD | NEW |