Index: content/renderer/media/webrtc_logging.cc |
diff --git a/content/renderer/media/webrtc_logging.cc b/content/renderer/media/webrtc_logging.cc |
index 17e5c5745420d96fcd68aefd64911bdf1f9c5140..28ed9996d664ccb88770e7676a8dc8db612935f2 100644 |
--- a/content/renderer/media/webrtc_logging.cc |
+++ b/content/renderer/media/webrtc_logging.cc |
@@ -4,17 +4,25 @@ |
#include "content/renderer/media/webrtc_logging.h" |
+#include "base/command_line.h" |
#include "base/time/time.h" |
+#include "content/public/common/content_switches.h" |
#include "content/public/renderer/webrtc_log_message_delegate.h" |
#include "third_party/webrtc/overrides/webrtc/base/logging.h" |
namespace content { |
-// Shall only be set once and never go back to NULL. |
+// Shall only be set once and never go back to NULL |
+// except for single process model. |
WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; |
void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { |
- CHECK(!g_webrtc_logging_delegate); |
+ // We will not check g_webrtc_logging_delegate in single process mode, |
+ // since g_webrtc_logging_delegate may shared by two RenderThreads in |
+ // the same browser process. |
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kSingleProcess) || |
+ !g_webrtc_logging_delegate); |
tommi (sloooow) - chröme
2015/03/04 13:23:20
In the case where g_webrtc_logging_delegate is not
jinlong.zhai
2015/03/05 01:50:17
In this case, it will overwrite the provious value
|
CHECK(delegate); |
g_webrtc_logging_delegate = delegate; |