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

Side by Side Diff: content/renderer/media/webrtc_logging_initializer_impl.cc

Issue 15741003: Moving WebRTC logging related files from content to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed handler unit test. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698