<!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>[235045] releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI</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/235045">235045</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2018-08-20 04:11:49 -0700 (Mon, 20 Aug 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/234963">r234963</a> - Web Inspector: Show Initiator information in Network Table
https://bugs.webkit.org/show_bug.cgi?id=188590
<rdar://problem/43305488>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-08-16
Reviewed by Matt Baker.

* UserInterface/Views/NetworkResourceDetailView.js:
(WI.NetworkResourceDetailView):
(WI.NetworkResourceDetailView.prototype.shown):
(WI.NetworkResourceDetailView.prototype.willShowWithCookie):
(WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem):
When a ResourceDetailView gets shown, it may also want to show its initial content view
with a cookie as the cookie may contain position highlight information.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._showResourceDetailView):
(WI.NetworkTableContentView.prototype.showRepresentedObject):
When showing a represented object, pass the cookie information on to the detail
view's so that it may include the cookie when showing the final content view.

(WI.NetworkTableContentView.prototype.tablePopulateCell):
(WI.NetworkTableContentView.prototype._populateInitiatorCell):
(WI.NetworkTableContentView.prototype.initialLayout):
New initiator column contains a source code link to the call site.

(WI.NetworkTableContentView.prototype._generateSortComparator):
(WI.NetworkTableContentView.prototype._entryForResource):
Entry data for the initiator is a display string that can be sorted easily.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit222SourceWebInspectorUIChangeLog">releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit222SourceWebInspectorUIUserInterfaceViewsNetworkResourceDetailViewjs">releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js</a></li>
<li><a href="#releasesWebKitGTKwebkit222SourceWebInspectorUIUserInterfaceViewsNetworkTableContentViewjs">releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit222SourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/ChangeLog (235044 => 235045)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/ChangeLog   2018-08-20 11:11:44 UTC (rev 235044)
+++ releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/ChangeLog      2018-08-20 11:11:49 UTC (rev 235045)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2018-08-16  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Show Initiator information in Network Table
+        https://bugs.webkit.org/show_bug.cgi?id=188590
+        <rdar://problem/43305488>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/NetworkResourceDetailView.js:
+        (WI.NetworkResourceDetailView):
+        (WI.NetworkResourceDetailView.prototype.shown):
+        (WI.NetworkResourceDetailView.prototype.willShowWithCookie):
+        (WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem):
+        When a ResourceDetailView gets shown, it may also want to show its initial content view
+        with a cookie as the cookie may contain position highlight information.
+
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView):
+        (WI.NetworkTableContentView.prototype._showResourceDetailView):
+        (WI.NetworkTableContentView.prototype.showRepresentedObject):
+        When showing a represented object, pass the cookie information on to the detail
+        view's so that it may include the cookie when showing the final content view.
+
+        (WI.NetworkTableContentView.prototype.tablePopulateCell):
+        (WI.NetworkTableContentView.prototype._populateInitiatorCell):
+        (WI.NetworkTableContentView.prototype.initialLayout):
+        New initiator column contains a source code link to the call site.
+
+        (WI.NetworkTableContentView.prototype._generateSortComparator):
+        (WI.NetworkTableContentView.prototype._entryForResource):
+        Entry data for the initiator is a display string that can be sorted easily.
+
+2018-08-16  Joseph Pecoraro  <pecoraro@apple.com>
+
</ins><span class="cx">         LayoutTest inspector/worker/debugger-pause.html sometimes times out
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=188580
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit222SourceWebInspectorUIUserInterfaceViewsNetworkResourceDetailViewjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js (235044 => 235045)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js    2018-08-20 11:11:44 UTC (rev 235044)
+++ releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js       2018-08-20 11:11:49 UTC (rev 235045)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx">         this._cookiesContentView = null;
</span><span class="cx">         this._sizesContentView = null;
</span><span class="cx">         this._timingContentView = null;
</span><ins>+
+        this._contentViewCookie = null;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="lines">@@ -54,6 +56,12 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._showPreferredContentView();
</span><ins>+
+        if (this._contentViewCookie) {
+            this._contentBrowser.showContentView(this._contentBrowser.currentContentView, this._contentViewCookie);
+            this._contentViewCookie = null;
+        }
+
</ins><span class="cx">         this._contentBrowser.shown();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -69,6 +77,11 @@
</span><span class="cx">         this._contentBrowser.contentViewContainer.closeAllContentViews();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    willShowWithCookie(cookie)
+    {
+        this._contentViewCookie = cookie;
+    }
+
</ins><span class="cx">     // ResourceHeadersContentView delegate
</span><span class="cx"> 
</span><span class="cx">     headersContentViewGoToRequestData(headersContentView)
</span><span class="lines">@@ -174,27 +187,27 @@
</span><span class="cx">         case "preview":
</span><span class="cx">             if (!this._resourceContentView)
</span><span class="cx">                 this._resourceContentView = this._contentBrowser.showContentViewForRepresentedObject(this._resource);
</span><del>-            this._contentBrowser.showContentView(this._resourceContentView);
</del><ins>+            this._contentBrowser.showContentView(this._resourceContentView, this._contentViewCookie);
</ins><span class="cx">             break;
</span><span class="cx">         case "headers":
</span><span class="cx">             if (!this._headersContentView)
</span><span class="cx">                 this._headersContentView = new WI.ResourceHeadersContentView(this._resource, this);
</span><del>-            this._contentBrowser.showContentView(this._headersContentView);
</del><ins>+            this._contentBrowser.showContentView(this._headersContentView, this._contentViewCookie);
</ins><span class="cx">             break;
</span><span class="cx">         case "cookies":
</span><span class="cx">             if (!this._cookiesContentView)
</span><span class="cx">                 this._cookiesContentView = new WI.ResourceCookiesContentView(this._resource);
</span><del>-            this._contentBrowser.showContentView(this._cookiesContentView);
</del><ins>+            this._contentBrowser.showContentView(this._cookiesContentView, this._contentViewCookie);
</ins><span class="cx">             break;
</span><span class="cx">         case "sizes":
</span><span class="cx">             if (!this._sizesContentView)
</span><span class="cx">                 this._sizesContentView = new WI.ResourceSizesContentView(this._resource, this);
</span><del>-            this._contentBrowser.showContentView(this._sizesContentView);
</del><ins>+            this._contentBrowser.showContentView(this._sizesContentView, this._contentViewCookie);
</ins><span class="cx">             break;
</span><span class="cx">         case "timing":
</span><span class="cx">             if (!this._timingContentView)
</span><span class="cx">                 this._timingContentView = new WI.ResourceTimingContentView(this._resource);
</span><del>-            this._contentBrowser.showContentView(this._timingContentView);
</del><ins>+            this._contentBrowser.showContentView(this._timingContentView, this._contentViewCookie);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit222SourceWebInspectorUIUserInterfaceViewsNetworkTableContentViewjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (235044 => 235045)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js      2018-08-20 11:11:44 UTC (rev 235044)
+++ releases/WebKitGTK/webkit-2.22/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js 2018-08-20 11:11:49 UTC (rev 235045)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">         this._pendingInsertions = [];
</span><span class="cx">         this._pendingUpdates = [];
</span><span class="cx">         this._pendingFilter = false;
</span><ins>+        this._showingRepresentedObjectCookie = null;
</ins><span class="cx"> 
</span><span class="cx">         this._table = null;
</span><span class="cx">         this._nameColumnWidthSetting = new WI.Setting("network-table-content-view-name-column-width", 250);
</span><span class="lines">@@ -289,7 +290,9 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        this._showingRepresentedObjectCookie = cookie;
</ins><span class="cx">         this._table.selectRow(rowIndex);
</span><ins>+        this._showingRepresentedObjectCookie = null;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // NetworkResourceDetailView delegate
</span><span class="lines">@@ -391,6 +394,9 @@
</span><span class="cx">         case "protocol":
</span><span class="cx">             cell.textContent = entry.protocol || emDash;
</span><span class="cx">             break;
</span><ins>+        case "initiator":
+            this._populateInitiatorCell(cell, entry);
+            break;
</ins><span class="cx">         case "priority":
</span><span class="cx">             cell.textContent = WI.Resource.displayNameForPriority(entry.priority) || emDash;
</span><span class="cx">             break;
</span><span class="lines">@@ -460,6 +466,21 @@
</span><span class="cx">         cell.append(entry.domain);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _populateInitiatorCell(cell, entry)
+    {
+        let initiatorLocation = entry.resource.initiatorSourceCodeLocation;
+        if (!initiatorLocation) {
+            cell.textContent = emDash;
+            return;
+        }
+
+        const options = {
+            dontFloat: true,
+            ignoreSearchTab: true,
+        };
+        cell.appendChild(WI.createSourceCodeLocationLink(initiatorLocation, options));
+    }
+
</ins><span class="cx">     _populateTransferSizeCell(cell, entry)
</span><span class="cx">     {
</span><span class="cx">         let responseSource = entry.resource.responseSource;
</span><span class="lines">@@ -578,6 +599,7 @@
</span><span class="cx">         case "method":
</span><span class="cx">         case "scheme":
</span><span class="cx">         case "protocol":
</span><ins>+        case "initiator":
</ins><span class="cx">         case "remoteAddress":
</span><span class="cx">             // Simple string.
</span><span class="cx">             comparator = (a, b) => (a[sortColumnIdentifier] || "").extendedLocaleCompare(b[sortColumnIdentifier] || "");
</span><span class="lines">@@ -717,6 +739,13 @@
</span><span class="cx">             initialWidth: 75,
</span><span class="cx">         });
</span><span class="cx"> 
</span><ins>+        this._initiatorColumn = new WI.TableColumn("initiator", WI.UIString("Initiator"), {
+            hidden: true,
+            minWidth: 75,
+            maxWidth: 175,
+            initialWidth: 125,
+        });
+
</ins><span class="cx">         this._priorityColumn = new WI.TableColumn("priority", WI.UIString("Priority"), {
</span><span class="cx">             hidden: true,
</span><span class="cx">             minWidth: 65,
</span><span class="lines">@@ -777,6 +806,7 @@
</span><span class="cx">         this._table.addColumn(this._schemeColumn);
</span><span class="cx">         this._table.addColumn(this._statusColumn);
</span><span class="cx">         this._table.addColumn(this._protocolColumn);
</span><ins>+        this._table.addColumn(this._initiatorColumn);
</ins><span class="cx">         this._table.addColumn(this._priorityColumn);
</span><span class="cx">         this._table.addColumn(this._remoteAddressColumn);
</span><span class="cx">         this._table.addColumn(this._connectionIdentifierColumn);
</span><span class="lines">@@ -969,6 +999,10 @@
</span><span class="cx">             this.replaceSubview(oldResourceDetailView, this._resourceDetailView);
</span><span class="cx">         } else
</span><span class="cx">             this.addSubview(this._resourceDetailView);
</span><ins>+
+        if (this._showingRepresentedObjectCookie)
+            this._resourceDetailView.willShowWithCookie(this._showingRepresentedObjectCookie);
+
</ins><span class="cx">         this._resourceDetailView.shown();
</span><span class="cx"> 
</span><span class="cx">         this.element.classList.add("showing-detail");
</span><span class="lines">@@ -1197,6 +1231,7 @@
</span><span class="cx">             transferSize: !isNaN(resource.networkTotalTransferSize) ? resource.networkTotalTransferSize : resource.estimatedTotalTransferSize,
</span><span class="cx">             time: resource.totalDuration,
</span><span class="cx">             protocol: resource.protocol,
</span><ins>+            initiator: resource.initiatorSourceCodeLocation ? resource.initiatorSourceCodeLocation.displayLocationString() : "",
</ins><span class="cx">             priority: resource.priority,
</span><span class="cx">             remoteAddress: resource.remoteAddress,
</span><span class="cx">             connectionIdentifier: resource.connectionIdentifier,
</span></span></pre>
</div>
</div>

</body>
</html>