Changeset 242886 in webkit
- Timestamp:
- Mar 13, 2019, 10:14:18 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
-
ThirdParty/libwebrtc/ChangeLog (modified) (1 diff)
-
ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp (modified) (1 diff)
-
ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp (modified) (1 diff)
-
ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp (modified) (1 diff)
-
ThirdParty/libwebrtc/Source/webrtc/rtc_base/logging.cc (modified) (3 diffs)
-
ThirdParty/libwebrtc/Source/webrtc/rtc_base/logging.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/mediastream/RTCPeerConnection.cpp (modified) (1 diff)
-
WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (modified) (2 diffs)
-
WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r242623 r242886 1 2019-03-13 Youenn Fablet <youenn@apple.com> 2 3 Enable libwebrtc logging control through WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=195658 5 6 Reviewed by Eric Carlson. 7 8 Add a callback to get access to libwebrtc log messages. 9 10 * Configurations/libwebrtc.iOS.exp: 11 * Configurations/libwebrtc.iOSsim.exp: 12 * Configurations/libwebrtc.mac.exp: 13 * Source/webrtc/rtc_base/logging.cc: 14 * Source/webrtc/rtc_base/logging.h: 15 1 16 2019-03-07 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp
r239252 r242886 247 247 __ZN6webrtc16RtpRtxParametersC1ERKS0_ 248 248 __ZN6webrtc16RtpRtxParametersD1Ev 249 __ZN3rtc10LogMessage12SetLogOutputENS_15LoggingSeverityEPFvS1_PKcE -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp
r239252 r242886 248 248 __ZN6webrtc16RtpRtxParametersC1ERKS0_ 249 249 __ZN6webrtc16RtpRtxParametersD1Ev 250 __ZN3rtc10LogMessage12SetLogOutputENS_15LoggingSeverityEPFvS1_PKcE -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
r239252 r242886 248 248 __ZN6webrtc16RtpRtxParametersC1ERKS0_ 249 249 __ZN6webrtc16RtpRtxParametersD1Ev 250 __ZN3rtc10LogMessage12SetLogOutputENS_15LoggingSeverityEPFvS1_PKcE -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/logging.cc
r238967 r242886 53 53 static LoggingSeverity g_dbg_sev = LS_NONE; 54 54 #endif 55 static LogMessage::LogOutputCallback g_log_output_callback = nullptr; 56 55 57 56 58 // Return the filename portion of the string (that following the last slash). … … 268 270 CritScope cs(&logCriticalScope()); 269 271 UpdateMinLogSeverity(); 272 } 273 274 void LogMessage::SetLogOutput(LoggingSeverity min_sev, LogOutputCallback callback) 275 { 276 g_dbg_sev = min_sev; 277 CritScope cs(&logCriticalScope()); 278 UpdateMinLogSeverity(); 279 g_log_output_callback = callback; 270 280 } 271 281 … … 457 467 #endif // WEBRTC_ANDROID 458 468 if (log_to_stderr) { 469 if (g_log_output_callback) 470 g_log_output_callback(severity, str.c_str()); 459 471 fprintf(stderr, "%s", str.c_str()); 460 472 fflush(stderr); -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/logging.h
r238967 r242886 431 431 // Debug: Debug console on Windows, otherwise stderr 432 432 static void LogToDebug(LoggingSeverity min_sev); 433 434 typedef void (*LogOutputCallback)(LoggingSeverity severity, const char*); 435 static void SetLogOutput(LoggingSeverity min_sev, LogOutputCallback); 433 436 static LoggingSeverity GetLogToDebug(); 434 437 -
trunk/Source/WebCore/ChangeLog
r242883 r242886 1 2019-03-13 Youenn Fablet <youenn@apple.com> 2 3 Enable libwebrtc logging control through WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=195658 5 6 Reviewed by Eric Carlson. 7 8 Add support for WebCore logging of libwebrtc messages. 9 This is controlled by WebRTC log channel state and level. 10 In case of private browsing mode, any logging is disabled. 11 This will stay for the lifetime of the process. 12 No change of behavior. 13 14 * Modules/mediastream/RTCPeerConnection.cpp: 15 (WebCore::RTCPeerConnection::create): 16 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: 17 (WebCore::doReleaseLogging): 18 (WebCore::setLogging): 19 (WebCore::computeLogLevel): 20 (WebCore::initializePeerConnectionFactoryAndThreads): 21 (WebCore::LibWebRTCProvider::setEnableLogging): 22 * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 23 1 24 2019-03-13 Thibault Saunier <tsaunier@igalia.com> 2 25 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r242804 r242886 71 71 if (!peerConnection->isClosed()) { 72 72 peerConnection->m_pendingActivity = peerConnection->makePendingActivity(peerConnection.get()); 73 if (auto* page = downcast<Document>(context).page()) 73 if (auto* page = downcast<Document>(context).page()) { 74 74 peerConnection->registerToController(page->rtcController()); 75 page->libWebRTCProvider().setEnableLogging(!context.sessionID().isEphemeral()); 76 } 75 77 } 76 78 return peerConnection; -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp
r239427 r242886 121 121 }; 122 122 123 static void initializePeerConnectionFactoryAndThreads(PeerConnectionFactoryAndThreads& factoryAndThreads) 124 { 125 ASSERT(!factoryAndThreads.networkThread); 126 123 static void doReleaseLogging(rtc::LoggingSeverity severity, const char* message) 124 { 125 if (severity == rtc::LS_ERROR) 126 RELEASE_LOG_ERROR(WebRTC, "LibWebRTC error: %{public}s", message); 127 else 128 RELEASE_LOG(WebRTC, "LibWebRTC message: %{public}s", message); 129 } 130 131 static void setLogging(rtc::LoggingSeverity level) 132 { 133 rtc::LogMessage::SetLogOutput(level, (level == rtc::LS_NONE) ? nullptr : doReleaseLogging); 134 } 135 136 static rtc::LoggingSeverity computeLogLevel() 137 { 127 138 #if defined(NDEBUG) 128 139 #if !LOG_DISABLED || !RELEASE_LOG_DISABLED 129 rtc::LogMessage::LogToDebug(LogWebRTC.state != WTFLogChannelOn ? rtc::LS_NONE : rtc::LS_INFO); 140 if (LogWebRTC.state != WTFLogChannelOn) 141 return rtc::LS_ERROR; 142 143 switch (LogWebRTC.level) { 144 case WTFLogLevelAlways: 145 case WTFLogLevelError: 146 return rtc::LS_ERROR; 147 case WTFLogLevelWarning: 148 return rtc::LS_WARNING; 149 case WTFLogLevelInfo: 150 return rtc::LS_INFO; 151 case WTFLogLevelDebug: 152 return rtc::LS_VERBOSE; 153 } 130 154 #else 131 r tc::LogMessage::LogToDebug(rtc::LS_NONE);155 return rtc::LS_NONE; 132 156 #endif 133 157 #else 134 r tc::LogMessage::LogToDebug(LogWebRTC.state != WTFLogChannelOn ? rtc::LS_WARNING : rtc::LS_INFO);158 return (LogWebRTC.state != WTFLogChannelOn) ? rtc::LS_WARNING : rtc::LS_INFO; 135 159 #endif 160 } 161 162 static void initializePeerConnectionFactoryAndThreads(PeerConnectionFactoryAndThreads& factoryAndThreads) 163 { 164 ASSERT(!factoryAndThreads.networkThread); 136 165 137 166 factoryAndThreads.networkThread = factoryAndThreads.networkThreadWithSocketServer ? rtc::Thread::CreateWithSocketServer() : rtc::Thread::Create(); … … 193 222 PeerConnectionFactoryAndThreads& threads = staticFactoryAndThreads(); 194 223 threads.signalingThread->Post(RTC_FROM_HERE, &threads, 1, new ThreadMessageData(WTFMove(callback))); 224 } 225 226 void LibWebRTCProvider::setEnableLogging(bool enableLogging) 227 { 228 if (!m_enableLogging) 229 return; 230 m_enableLogging = enableLogging; 231 setLogging(enableLogging ? computeLogLevel() : rtc::LS_NONE); 195 232 } 196 233 -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h
r241200 r242886 116 116 void clearFactory() { m_factory = nullptr; } 117 117 118 void setEnableLogging(bool); 119 118 120 protected: 119 121 LibWebRTCProvider() = default; … … 132 134 bool m_disableNonLocalhostConnections { false }; 133 135 bool m_supportsVP8 { false }; 136 bool m_enableLogging { true }; 134 137 #endif 135 138 };
Note:
See TracChangeset
for help on using the changeset viewer.