<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243031] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243031">243031</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2019-03-15 20:14:52 -0700 (Fri, 15 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: HAR Extension for Resource Priority
https://bugs.webkit.org/show_bug.cgi?id=195693

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/HARBuilder.js:
(WI.HARBuilder.entry):
(WI.HARBuilder.priority):
(WI.HARBuilder.networkPriorityFromHARPriority):
Include priority custom extension.

* UserInterface/Models/LocalResource.js:
(WI.LocalResource.fromHAREntry):
Import priority.

LayoutTests:

* http/tests/inspector/network/har/har-basic-expected.txt:
* http/tests/inspector/network/har/har-page-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectornetworkharharbasicexpectedtxt">trunk/LayoutTests/http/tests/inspector/network/har/har-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectornetworkharharpageexpectedtxt">trunk/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersHARBuilderjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsLocalResourcejs">trunk/Source/WebInspectorUI/UserInterface/Models/LocalResource.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/LayoutTests/ChangeLog 2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: HAR Extension for Resource Priority
+        https://bugs.webkit.org/show_bug.cgi?id=195693
+
+        Reviewed by Devin Rousso.
+
+        * http/tests/inspector/network/har/har-basic-expected.txt:
+        * http/tests/inspector/network/har/har-page-expected.txt:
+
+2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
+
</ins><span class="cx">         Web Inspector: Timelines - Import / Export Timeline Recordings
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195709
</span><span class="cx">         <rdar://problem/23188921>
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectornetworkharharbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/network/har/har-basic-expected.txt (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/network/har/har-basic-expected.txt        2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/LayoutTests/http/tests/inspector/network/har/har-basic-expected.txt   2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -136,7 +136,8 @@
</span><span class="cx">         },
</span><span class="cx">         "serverIPAddress": "12.34.56.78",
</span><span class="cx">         "connection": "1",
</span><del>-        "_fetchType": "Network Load"
</del><ins>+        "_fetchType": "Network Load",
+        "_priority": "medium"
</ins><span class="cx">       }
</span><span class="cx">     ]
</span><span class="cx">   }
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectornetworkharharpageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt 2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt    2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -61,7 +61,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "high"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -102,7 +103,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "high"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -143,7 +145,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "high"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -191,7 +194,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -245,7 +249,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -298,7 +303,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -351,7 +357,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -404,7 +411,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -461,7 +469,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -524,7 +533,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -591,7 +601,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -662,7 +673,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         "pageref": "page_0",
</span><span class="lines">@@ -737,7 +749,8 @@
</span><span class="cx">           "send": "<filtered>",
</span><span class="cx">           "wait": "<filtered>",
</span><span class="cx">           "receive": "<filtered>"
</span><del>-        }
</del><ins>+        },
+        "_priority": "medium"
</ins><span class="cx">       }
</span><span class="cx">     ]
</span><span class="cx">   }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog    2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/Source/WebInspectorUI/ChangeLog       2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: HAR Extension for Resource Priority
+        https://bugs.webkit.org/show_bug.cgi?id=195693
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Controllers/HARBuilder.js:
+        (WI.HARBuilder.entry):
+        (WI.HARBuilder.priority):
+        (WI.HARBuilder.networkPriorityFromHARPriority):
+        Include priority custom extension.
+
+        * UserInterface/Models/LocalResource.js:
+        (WI.LocalResource.fromHAREntry):
+        Import priority.
+
+2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
+
</ins><span class="cx">         Web Inspector: CPU Usage Timeline - Give long thread names a tooltip if they could be ellipsized
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195314
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersHARBuilderjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js      2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js 2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -114,7 +114,9 @@
</span><span class="cx">         if (resource.responseSource !== WI.Resource.ResponseSource.Unknown)
</span><span class="cx">             entry._fetchType = HARBuilder.fetchType(resource.responseSource);
</span><span class="cx"> 
</span><del>-        // FIXME: <https://webkit.org/b/195693> Web Inspector: HAR Extension for Resource Priority
</del><ins>+        // WebKit Custom Field `_priority`.
+        if (resource.priority !== WI.Resource.NetworkPriority.Unknown)
+            entry._priority = HARBuilder.priority(resource.priority);
</ins><span class="cx"> 
</span><span class="cx">         return entry;
</span><span class="cx">     }
</span><span class="lines">@@ -315,10 +317,25 @@
</span><span class="cx">             return "Service Worker";
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        console.assert(false);
</del><ins>+        console.assert();
</ins><span class="cx">         return undefined;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static priority(priority)
+    {
+        switch (priority) {
+        case WI.Resource.NetworkPriority.Low:
+            return "low";
+        case WI.Resource.NetworkPriority.Medium:
+            return "medium";
+        case WI.Resource.NetworkPriority.High:
+            return "high";
+        }
+
+        console.assert();
+        return undefined;
+    }
+
</ins><span class="cx">     // Consuming.
</span><span class="cx"> 
</span><span class="cx">     static dateFromHARDate(isoString)
</span><span class="lines">@@ -344,7 +361,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (protocol)
</span><del>-            console.warn("Unknown HAR Protocol value", protocol);
</del><ins>+            console.warn("Unknown HAR protocol value", protocol);
</ins><span class="cx">         return null;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -360,7 +377,23 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (fetchType)
</span><del>-            console.warn("Unknown HAR Protocol _fetchType", fetchType);
</del><ins>+            console.warn("Unknown HAR _fetchType value", fetchType);
</ins><span class="cx">         return WI.Resource.ResponseSource.Other;
</span><span class="cx">     }
</span><ins>+
+    static networkPriorityFromHARPriority(priority)
+    {
+        switch (priority) {
+        case "low":
+            return WI.Resource.NetworkPriority.Low;
+        case "medium":
+            return WI.Resource.NetworkPriority.Medium;
+        case "high":
+            return WI.Resource.NetworkPriority.High;
+        }
+
+        if (priority)
+            console.warn("Unknown HAR priority value", priority);
+        return WI.Resource.NetworkPriority.Unknown;
+    }
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsLocalResourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/LocalResource.js (243030 => 243031)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/LocalResource.js        2019-03-16 02:48:57 UTC (rev 243030)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/LocalResource.js   2019-03-16 03:14:52 UTC (rev 243031)
</span><span class="lines">@@ -99,7 +99,6 @@
</span><span class="cx">     {
</span><span class="cx">         // FIXME: <https://webkit.org/b/195695> Web Inspector: HAR Extension for `serverIPAddress` port number
</span><span class="cx">         // FIXME: <https://webkit.org/b/195694> Web Inspector: HAR Extension for Redirect Timing Info
</span><del>-        // FIXME: <https://webkit.org/b/195693> Web Inspector: HAR Extension for Resource Priority
</del><span class="cx"> 
</span><span class="cx">         let {request, response, startedDateTime, timings} = entry;
</span><span class="cx">         let requestSentWalltime = WI.HARBuilder.dateFromHARDate(startedDateTime) / 1000;
</span><span class="lines">@@ -182,7 +181,7 @@
</span><span class="cx">             metrics: {
</span><span class="cx">                 responseSource: WI.HARBuilder.responseSourceFromHARFetchType(entry._fetchType),
</span><span class="cx">                 protocol: WI.HARBuilder.protocolFromHARProtocol(response.httpVersion),
</span><del>-                priority: null,
</del><ins>+                priority: WI.HARBuilder.networkPriorityFromHARPriority(entry._priority),
</ins><span class="cx">                 remoteAddress: entry.serverIPAddress || null,
</span><span class="cx">                 connectionIdentifier: entry.connection ? parseInt(entry.connection) : null,
</span><span class="cx">                 requestHeaderBytesSent: request.headersSize >= 0 ? request.headersSize : NaN,
</span></span></pre>
</div>
</div>

</body>
</html>