OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 "base/logging.h" | |
6 #include "media/audio/audio_logging.h" | |
7 | |
8 namespace media { | |
9 | |
10 WebRtcLoggingCallback g_webrtc_logging_callback = nullptr; | |
11 | |
12 // TODO: Make sure it's thread safe. | |
o1ka
2016/04/05 15:28:42
You can use atomic flag to guard initialization.
| |
13 | |
14 void InitWebRtcLoggingCallback(WebRtcLoggingCallback callback) { | |
15 CHECK(!g_webrtc_logging_callback); | |
16 g_webrtc_logging_callback = callback; | |
17 } | |
18 | |
19 void WebRtcLogMessage(const std::string& message) { | |
20 if (g_webrtc_logging_callback) | |
21 g_webrtc_logging_callback(message); | |
22 } | |
23 | |
24 } // namespace media | |
OLD | NEW |