WebKit Bugzilla
Attachment 339867 Details for
Bug 185437
: Log rtcstats as JSON
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185437-20180508134406.patch (text/plain), 3.80 KB, created by
Eric Carlson
on 2018-05-08 13:44:07 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2018-05-08 13:44:07 PDT
Size:
3.80 KB
patch
obsolete
>Subversion Revision: 231494 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a326d412092674f54172d97dec0dd66823d92c6c..f7a7adc671e6ebddcbfd62a0ca2e061c742484a9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-08 Eric Carlson <eric.carlson@apple.com> >+ >+ Log rtcstats as JSON >+ https://bugs.webkit.org/show_bug.cgi?id=185437 >+ <rdar://problem/40065332> >+ >+ Reviewed by Youenn Fablet. >+ >+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: >+ (WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a >+ toJSONString method to libwebrtc. >+ (WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON. >+ (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because >+ it doesn't work well inside of a lambda. >+ (WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only >+ used here. >+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: >+ (WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file. >+ > 2018-05-08 Sihui Liu <sihui_liu@apple.com> > > [WKHTTPCookieStore getAllCookies] returns inconsistent creation time >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >index 415ef97c7918c341b2cec59adad3540c3eb4d80d..0599d0970347b8e7fef0ec294acafa379e1d98c6 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >@@ -1043,6 +1043,19 @@ void LibWebRTCMediaEndpoint::gatherStatsForLogging() > }); > } > >+class RTCStatsLogger { >+public: >+ explicit RTCStatsLogger(const webrtc::RTCStats& stats) >+ : m_stats(stats) >+ { >+ } >+ >+ String toJSONString() const { return String(m_stats.ToJson().c_str()); } >+ >+private: >+ const webrtc::RTCStats& m_stats; >+}; >+ > void LibWebRTCMediaEndpoint::OnStatsDelivered(const rtc::scoped_refptr<const webrtc::RTCStatsReport>& report) > { > #if !RELEASE_LOG_DISABLED >@@ -1060,7 +1073,7 @@ void LibWebRTCMediaEndpoint::OnStatsDelivered(const rtc::scoped_refptr<const web > if (iterator->type() == webrtc::RTCCodecStats::kType) > continue; > >- ALWAYS_LOG(LOGIDENTIFIER, "WebRTC stats for :", *iterator); >+ ALWAYS_LOG(Logger::LogSiteIdentifier("LibWebRTCMediaEndpoint", "OnStatsDelivered", logIdentifier()), RTCStatsLogger { *iterator }); > } > }); > #else >@@ -1102,4 +1115,20 @@ Seconds LibWebRTCMediaEndpoint::statsLogInterval(int64_t reportTimestamp) const > > } // namespace WebCore > >+namespace WTF { >+ >+template<typename Type> >+struct LogArgument; >+ >+template <> >+struct LogArgument<WebCore::RTCStatsLogger> { >+ static String toString(const WebCore::RTCStatsLogger& logger) >+ { >+ return String(logger.toJSONString()); >+ } >+}; >+ >+}; // namespace WTF >+ >+ > #endif // USE(LIBWEBRTC) >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >index c1d3a273f4a27f0cb74af6ba91850c89f90d6716..22ae284e852e34b5a9d1f6c7e3333dfb50b95d77 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >@@ -223,19 +223,4 @@ private: > > } // namespace WebCore > >-namespace WTF { >- >-template<typename Type> >-struct LogArgument; >- >-template <> >-struct LogArgument<webrtc::RTCStats> { >- static String toString(const webrtc::RTCStats& stats) >- { >- return WTF::String(stats.ToJson().c_str()); >- } >-}; >- >-}; // namespace WTF >- > #endif // USE(LIBWEBRTC)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185437
:
339849
| 339867 |
339876
|
339883