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

Unified Diff: content/renderer/media/webrtc_logging_initializer.cc

Issue 15741003: Moving WebRTC logging related files from content to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_logging_initializer.cc
diff --git a/content/renderer/media/webrtc_logging_initializer.cc b/content/renderer/media/webrtc_logging_initializer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d0d95b46ba6aad30d17aa72fe9acc65499c442bf
--- /dev/null
+++ b/content/renderer/media/webrtc_logging_initializer.cc
@@ -0,0 +1,37 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/media/webrtc_logging_initializer.h"
+
+#include "content/public/renderer/render_thread.h"
+#include "content/public/renderer/webrtc_log_message_delegate.h"
+#include "content/renderer/render_thread_impl.h"
+#include "third_party/libjingle/overrides/talk/base/logging.h"
+
+namespace content {
+
+// Shall only be set once and never go back to NULL.
+WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL;
+
+void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) {
+ CHECK(!g_webrtc_logging_delegate);
+ CHECK(delegate);
+
+ g_webrtc_logging_delegate = delegate;
+}
+
+void InitWebRtcLogging(const std::string& app_session_id,
+ const std::string& app_url) {
+ if (g_webrtc_logging_delegate) {
+ g_webrtc_logging_delegate->InitLogging(app_session_id, app_url);
+ talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage);
+ }
+}
+
+void WebRtcLogMessage(const std::string& message) {
+ if (g_webrtc_logging_delegate)
+ g_webrtc_logging_delegate->LogMessage(message);
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/media/webrtc_logging_initializer.h ('k') | content/renderer/media/webrtc_logging_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698