Add MSE logging configuration
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 18:38:03 +0000 (18:38 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 18:38:03 +0000 (18:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194719
<rdar://problem/48122151>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ConsoleMessage.cpp:
(Inspector::messageSourceValue):
* inspector/protocol/Console.json:
* inspector/scripts/codegen/generator.py:
* runtime/ConsoleTypes.h:

Source/WebCore:

No new tests, updated inspector/console/webcore-logging.html.

* dom/Document.cpp:
(WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.

* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): Ditto.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/ConsoleMessage.js:
* UserInterface/Models/IssueMessage.js:
(WI.IssueMessage):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.mm:
(stringForMessageSource): Recognize the MSE message source.

LayoutTests:

* inspector/console/webcore-logging-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241729 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/console/webcore-logging-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/ConsoleMessage.cpp
Source/JavaScriptCore/inspector/protocol/Console.json
Source/JavaScriptCore/inspector/scripts/codegen/generator.py
Source/JavaScriptCore/runtime/ConsoleTypes.h
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/inspector/agents/WebConsoleAgent.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js
Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js
Source/WebInspectorUI/UserInterface/Models/IssueMessage.js
Source/WebInspectorUI/UserInterface/Models/LoggingChannel.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm

index dbe21cd..6f97079 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Add MSE logging configuration
+        https://bugs.webkit.org/show_bug.cgi?id=194719
+        <rdar://problem/48122151>
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/console/webcore-logging-expected.txt:
+
 2019-02-18  Alex Christensen  <achristensen@webkit.org>
 
         Disable safe browsing in WKWebView and remove its WKPreferences API
index d282c05..a328a52 100644 (file)
@@ -13,6 +13,8 @@ PASS: Log channel has known source.
 PASS: Log channel disabled by default.
 PASS: Log channel has known source.
 PASS: Log channel disabled by default.
+PASS: Log channel has known source.
+PASS: Log channel disabled by default.
 
 -- Running test case: Console.Logging.InvalidChannel
 PASS: Logging channel not found
index eeff7e6..b7abc6e 100644 (file)
@@ -1,3 +1,17 @@
+2019-02-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Add MSE logging configuration
+        https://bugs.webkit.org/show_bug.cgi?id=194719
+        <rdar://problem/48122151>
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/ConsoleMessage.cpp:
+        (Inspector::messageSourceValue):
+        * inspector/protocol/Console.json:
+        * inspector/scripts/codegen/generator.py:
+        * runtime/ConsoleTypes.h:
+
 2019-02-18  Tadeu Zagallo  <tzagallo@apple.com>
 
         Add version number to cached bytecode
index 716ac44..f73deef 100644 (file)
@@ -170,6 +170,7 @@ static Protocol::Console::ChannelSource messageSourceValue(MessageSource source)
     case MessageSource::Other: return Protocol::Console::ChannelSource::Other;
     case MessageSource::Media: return Protocol::Console::ChannelSource::Media;
     case MessageSource::WebRTC: return Protocol::Console::ChannelSource::WebRTC;
+    case MessageSource::MediaSource: return Protocol::Console::ChannelSource::MediaSource;
     }
     return Protocol::Console::ChannelSource::Other;
 }
index 6b94399..8fff4a9 100644 (file)
@@ -5,7 +5,7 @@
         {
             "id": "ChannelSource",
             "type": "string",
-            "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "content-blocker", "media", "webrtc", "other"],
+            "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "content-blocker", "media", "mediasource", "webrtc", "other"],
             "description": "Channels for different types of log messages."
         },
         {
index 86b0f07..d2aa226 100755 (executable)
@@ -53,6 +53,7 @@ _ENUM_IDENTIFIER_RENAME_MAP = {
     'webmetal': 'WebMetal',  # Canvas.ContextType.webmetal
     'bitmaprenderer': 'BitmapRenderer',  # Canvas.ContextType.bitmaprenderer
     'webrtc': 'WebRTC',  # Console.ChannelSource.webrtc
+    'mediasource': 'MediaSource',  # Console.ChannelSource.mediasource
 }
 
 # These objects are built manually by creating and setting JSON::Value instances.
index 021c753..fffebed 100644 (file)
@@ -43,6 +43,7 @@ enum class MessageSource : uint8_t {
     Other,
     Media,
     WebRTC,
+    MediaSource,
 };
 
 enum class MessageType {
@@ -88,7 +89,8 @@ template<> struct EnumTraits<JSC::MessageSource> {
         JSC::MessageSource::ContentBlocker,
         JSC::MessageSource::Other,
         JSC::MessageSource::Media,
-        JSC::MessageSource::WebRTC
+        JSC::MessageSource::WebRTC,
+        JSC::MessageSource::MediaSource
     >;
 };
 
index e905b57..7e86ea9 100644 (file)
@@ -1,3 +1,19 @@
+2019-02-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Add MSE logging configuration
+        https://bugs.webkit.org/show_bug.cgi?id=194719
+        <rdar://problem/48122151>
+
+        Reviewed by Joseph Pecoraro.
+
+        No new tests, updated inspector/console/webcore-logging.html.
+
+        * dom/Document.cpp:
+        (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
+
+        * inspector/agents/WebConsoleAgent.cpp:
+        (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
+
 2019-02-18  Antoine Quint  <graouts@apple.com>
 
         [iOS] Dispatch additional events along with pointerdown and pointerup
index 050555b..7518199 100644 (file)
@@ -8562,6 +8562,7 @@ static MessageSource messageSourceForWTFLogChannel(const WTFLogChannel& channel)
 {
     static const NeverDestroyed<String> mediaChannel = MAKE_STATIC_STRING_IMPL("media");
     static const NeverDestroyed<String> webrtcChannel = MAKE_STATIC_STRING_IMPL("webrtc");
+    static const NeverDestroyed<String> mediaSourceChannel = MAKE_STATIC_STRING_IMPL("mediasource");
 
     if (equalIgnoringASCIICase(mediaChannel, channel.name))
         return MessageSource::Media;
@@ -8569,6 +8570,9 @@ static MessageSource messageSourceForWTFLogChannel(const WTFLogChannel& channel)
     if (equalIgnoringASCIICase(webrtcChannel, channel.name))
         return MessageSource::WebRTC;
 
+    if (equalIgnoringASCIICase(mediaSourceChannel, channel.name))
+        return MessageSource::MediaSource;
+
     return MessageSource::Other;
 }
 
index 1359fa6..c963138 100644 (file)
@@ -56,6 +56,7 @@ void WebConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Insp
     } channelTable[] = {
         { MAKE_STATIC_STRING_IMPL("WebRTC"), Inspector::Protocol::Console::ChannelSource::WebRTC },
         { MAKE_STATIC_STRING_IMPL("Media"), Inspector::Protocol::Console::ChannelSource::Media },
+        { MAKE_STATIC_STRING_IMPL("MediaSource"), Inspector::Protocol::Console::ChannelSource::MediaSource },
     };
 
     channels = JSON::ArrayOf<Inspector::Protocol::Console::Channel>::create();
index c08f51c..1904dbe 100644 (file)
@@ -1,3 +1,20 @@
+2019-02-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Add MSE logging configuration
+        https://bugs.webkit.org/show_bug.cgi?id=194719
+        <rdar://problem/48122151>
+
+        Reviewed by Joseph Pecoraro.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Models/ConsoleMessage.js:
+        * UserInterface/Models/IssueMessage.js:
+        (WI.IssueMessage):
+        * UserInterface/Views/LogContentView.js:
+        (WI.LogContentView):
+        * UserInterface/Views/SettingsTabContentView.js:
+        (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
+
 2019-02-17  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: Move CSS completion logic from SpreadsheetTextField to SpreadsheetStyleProperty
index 6fd8ea7..a2b113e 100644 (file)
@@ -593,6 +593,7 @@ localizedStrings["Low-Power Mode"] = "Low-Power Mode";
 localizedStrings["Lowest: %s"] = "Lowest: %s";
 localizedStrings["MIME Type"] = "MIME Type";
 localizedStrings["MIME Type:"] = "MIME Type:";
+localizedStrings["MSE Logging:"] = "MSE Logging:";
 localizedStrings["Manifest URL"] = "Manifest URL";
 localizedStrings["Mass"] = "Mass";
 localizedStrings["Matching"] = "Matching";
@@ -604,6 +605,7 @@ localizedStrings["Maximum maximum memory size in this recording"] = "Maximum max
 localizedStrings["Media"] = "Media";
 localizedStrings["Media Event"] = "Media Event";
 localizedStrings["Media Logging:"] = "Media Logging:";
+localizedStrings["MediaSource"] = "MediaSource";
 localizedStrings["Medium"] = "Medium";
 localizedStrings["Memory"] = "Memory";
 localizedStrings["Memory Cache"] = "Memory Cache";
index bc56eb1..52f72a4 100644 (file)
@@ -160,7 +160,7 @@ WI.ConsoleManager = class ConsoleManager extends WI.Object
         if (this._loggingChannelSources.length)
             return;
 
-        this._loggingChannelSources = [WI.ConsoleMessage.MessageSource.Media, WI.ConsoleMessage.MessageSource.WebRTC];
+        this._loggingChannelSources = [WI.ConsoleMessage.MessageSource.Media, WI.ConsoleMessage.MessageSource.WebRTC, , WI.ConsoleMessage.MessageSource.MessageSource];
 
         target.ConsoleAgent.getLoggingChannels((error, channels) => {
             if (error)
index d061d52..04a4008 100644 (file)
@@ -110,6 +110,7 @@ WI.ConsoleMessage.MessageSource = {
     Security: "security",
     Other: "other",
     Media: "media",
+    MediaSource: "mediasource",
     WebRTC: "webrtc",
 };
 
index ad3d248..cd0ca56 100644 (file)
@@ -67,6 +67,7 @@ WI.IssueMessage = class IssueMessage extends WI.Object
         case "rendering":
         case "other":
         case "media":
+        case "mediasource":
         case "webrtc":
             this._type = WI.IssueMessage.Type.OtherIssue;
             break;
index 162cd7b..cbb4f5c 100644 (file)
@@ -28,7 +28,7 @@ WI.LoggingChannel = class LoggingChannel
     constructor(source, level)
     {
         console.assert(typeof source === "string");
-        console.assert(source === WI.ConsoleMessage.MessageSource.Media || source === WI.ConsoleMessage.MessageSource.WebRTC);
+        console.assert(source === WI.ConsoleMessage.MessageSource.Media || source === WI.ConsoleMessage.MessageSource.WebRTC || source === WI.ConsoleMessage.MessageSource.MediaSource);
 
         console.assert(typeof level === "string");
         console.assert(Object.values(WI.LoggingChannel.Level).includes(level));
index 964bd00..c002a19 100644 (file)
@@ -99,6 +99,7 @@ WI.LogContentView = class LogContentView extends WI.ContentView
             let messageChannelBarItems = [
                 new WI.ScopeBarItem(WI.LogContentView.Scopes.AllChannels, WI.UIString("All"), {exclusive: true}),
                 new WI.ScopeBarItem(WI.LogContentView.Scopes.Media, WI.UIString("Media"), {className: "media"}),
+                new WI.ScopeBarItem(WI.LogContentView.Scopes.MediaSource, WI.UIString("MediaSource"), {className: "mediasource"}),
                 new WI.ScopeBarItem(WI.LogContentView.Scopes.WebRTC, WI.UIString("WebRTC"), {className: "webrtc"}),
             ];
 
@@ -390,6 +391,8 @@ WI.LogContentView = class LogContentView extends WI.ContentView
             return WI.LogContentView.Scopes.Media;
         case WI.ConsoleMessage.MessageSource.WebRTC:
             return WI.LogContentView.Scopes.WebRTC;
+        case WI.ConsoleMessage.MessageSource.MediaSource:
+            return WI.LogContentView.Scopes.MediaSource;
         }
 
         return undefined;
@@ -1175,6 +1178,7 @@ WI.LogContentView.Scopes = {
     AllChannels: "log-all-channels",
     Media: "log-media",
     WebRTC: "log-webrtc",
+    MediaSource: "log-mediasource",
 };
 
 WI.LogContentView.ItemWrapperStyleClassName = "console-item";
index 52299bb..e0beda9 100644 (file)
@@ -227,6 +227,7 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
             ];
             const editorLabels = {
                 media: WI.UIString("Media Logging:"),
+                mediasource: WI.UIString("MSE Logging:"),
                 webrtc: WI.UIString("WebRTC Logging:"),
             };
 
index d7a3f6f..5f40b79 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Add MSE logging configuration
+        https://bugs.webkit.org/show_bug.cgi?id=194719
+        <rdar://problem/48122151>
+
+        Reviewed by Joseph Pecoraro.
+
+        * WebCoreSupport/WebChromeClient.mm:
+        (stringForMessageSource): Recognize the MSE message source.
+
 2019-02-17  David Kilzer  <ddkilzer@apple.com>
 
         Unreviewed, rolling out r241620.
index 167a3bf..f74a4f6 100644 (file)
@@ -122,6 +122,7 @@ NSString *WebConsoleMessageContentBlockerMessageSource = @"ContentBlockerMessage
 NSString *WebConsoleMessageOtherMessageSource = @"OtherMessageSource";
 NSString *WebConsoleMessageMediaMessageSource = @"MediaMessageSource";
 NSString *WebConsoleMessageWebRTCMessageSource = @"WebRTCMessageSource";
+NSString *WebConsoleMessageMediaSourceMessageSource = @"MediaSourceMessageSource";
 
 NSString *WebConsoleMessageDebugMessageLevel = @"DebugMessageLevel";
 NSString *WebConsoleMessageLogMessageLevel = @"LogMessageLevel";
@@ -397,6 +398,8 @@ inline static NSString *stringForMessageSource(MessageSource source)
         return WebConsoleMessageMediaMessageSource;
     case MessageSource::WebRTC:
         return WebConsoleMessageWebRTCMessageSource;
+    case MessageSource::MediaSource:
+        return WebConsoleMessageMediaSourceMessageSource;
     }
     ASSERT_NOT_REACHED();
     return @"";