Title: [231438] trunk/Source/WebCore
Revision
231438
Author
[email protected]
Date
2018-05-07 08:54:56 -0700 (Mon, 07 May 2018)

Log Message

Text track cue logging should include cue text
https://bugs.webkit.org/show_bug.cgi?id=185353
<rdar://problem/40003565>

Reviewed by Youenn Fablet.

No new tests, tested manually.

* html/track/VTTCue.cpp:
(WebCore::VTTCue::toJSONString const): Use toJSON.
(WebCore::VTTCue::toJSON const): New.
* html/track/VTTCue.h:

* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toJSONString const): Log m_content.

* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (231437 => 231438)


--- trunk/Source/WebCore/ChangeLog	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/ChangeLog	2018-05-07 15:54:56 UTC (rev 231438)
@@ -1,3 +1,24 @@
+2018-05-07  Eric Carlson  <[email protected]>
+
+        Text track cue logging should include cue text
+        https://bugs.webkit.org/show_bug.cgi?id=185353
+        <rdar://problem/40003565>
+
+        Reviewed by Youenn Fablet.
+
+        No new tests, tested manually.
+
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::toJSONString const): Use toJSON.
+        (WebCore::VTTCue::toJSON const): New.
+        * html/track/VTTCue.h:
+
+        * platform/graphics/InbandTextTrackPrivateClient.h:
+        (WebCore::GenericCueData::toJSONString const): Log m_content.
+
+        * platform/graphics/iso/ISOVTTCue.cpp:
+        (WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
+
 2018-05-06  Zalan Bujtas  <[email protected]>
 
         [LFC] Add assertions for stale Display::Box geometry

Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp (231437 => 231438)


--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp	2018-05-07 15:54:56 UTC (rev 231438)
@@ -272,7 +272,7 @@
 {
     auto object = JSON::Object::create();
 
-    VTTCue::toJSON(object.get());
+    toJSON(object.get());
 
     if (m_foregroundColor.isValid())
         object->setString(ASCIILiteral("foregroundColor"), m_foregroundColor.serialized());

Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (231437 => 231438)


--- trunk/Source/WebCore/html/track/VTTCue.cpp	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp	2018-05-07 15:54:56 UTC (rev 231438)
@@ -1182,19 +1182,24 @@
 String VTTCue::toJSONString() const
 {
     auto object = JSON::Object::create();
+    toJSON(object.get());
 
-    TextTrackCue::toJSON(object.get());
+    return object->toJSONString();
+}
 
-    object->setString(ASCIILiteral("vertical"), vertical());
-    object->setBoolean(ASCIILiteral("snapToLines"), snapToLines());
-    object->setDouble(ASCIILiteral("line"), m_linePosition);
-    object->setDouble(ASCIILiteral("position"), position());
-    object->setInteger(ASCIILiteral("size"), m_cueSize);
-    object->setString(ASCIILiteral("align"), align());
-    object->setString(ASCIILiteral("text"), text());
-    object->setString(ASCIILiteral("regionId"), regionId());
+void VTTCue::toJSON(JSON::Object& object) const
+{
+    TextTrackCue::toJSON(object);
 
-    return object->toJSONString();
+    object.setString(ASCIILiteral("text"), text());
+    object.setString(ASCIILiteral("vertical"), vertical());
+    object.setBoolean(ASCIILiteral("snapToLines"), snapToLines());
+    object.setDouble(ASCIILiteral("line"), m_linePosition);
+    object.setDouble(ASCIILiteral("position"), position());
+    object.setInteger(ASCIILiteral("size"), m_cueSize);
+    object.setString(ASCIILiteral("align"), align());
+    object.setString(ASCIILiteral("text"), text());
+    object.setString(ASCIILiteral("regionId"), regionId());
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/track/VTTCue.h (231437 => 231438)


--- trunk/Source/WebCore/html/track/VTTCue.h	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/html/track/VTTCue.h	2018-05-07 15:54:56 UTC (rev 231438)
@@ -177,6 +177,8 @@
     virtual Ref<VTTCueBox> createDisplayTree();
     VTTCueBox& displayTreeInternal();
 
+    void toJSON(JSON::Object&) const final;
+
 private:
     void initialize(ScriptExecutionContext&);
     void createWebVTTNodeTree();

Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (231437 => 231438)


--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h	2018-05-07 15:54:56 UTC (rev 231438)
@@ -120,6 +120,7 @@
 {
     auto object = JSON::Object::create();
 
+    object->setString(ASCIILiteral("text"), m_content);
     object->setDouble(ASCIILiteral("start"), m_startTime.toDouble());
     object->setDouble(ASCIILiteral("end"), m_endTime.toDouble());
 

Modified: trunk/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp (231437 => 231438)


--- trunk/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp	2018-05-07 13:36:14 UTC (rev 231437)
+++ trunk/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp	2018-05-07 15:54:56 UTC (rev 231438)
@@ -114,6 +114,7 @@
 {
     auto object = JSON::Object::create();
 
+    object->setString(ASCIILiteral("text"), m_cueText);
     object->setString(ASCIILiteral("sourceId"), m_sourceID);
     object->setString(ASCIILiteral("id"), m_identifier);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to