<!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>[200880] trunk/Tools</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/200880">200880</a></dd>
<dt>Author</dt> <dd>aakash_jain@apple.com</dd>
<dt>Date</dt> <dd>2016-05-13 13:35:58 -0700 (Fri, 13 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Dashboard code restructuring
https://bugs.webkit.org/show_bug.cgi?id=157680
&lt;rdar://problem/14736888&gt;

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js:
(BubbleQueueView.prototype.addLinkToRow): Moved to base class.
(BubbleQueueView.prototype.addTextToRow): Moved to base class.
(BubbleQueueView.prototype._addDividerToPopover): Moved to base class.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js:
(BuildbotBuilderQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js:
(BuildbotCombinedQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
(BuildbotTesterQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._appendPendingRevisionCount): Moved to base class and modified to take
additional argument.
(BuildbotQueueView.prototype._popoverLinesForCommitRange): Moved to base class.
(BuildbotQueueView.prototype._presentPopoverForPendingCommits): Moved to base class.
(BuildbotQueueView.prototype._addDividerToPopover): Moved to base class.
(BuildbotQueueView.prototype._formatRevisionForDisplay): Moved to base class.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js:
(documentReady): Display any customView if available.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js:
(QueueView.prototype.addLinkToRow): Moved from child class, no changes.
(QueueView.prototype.addTextToRow): Moved from child class, no changes.
(QueueView.prototype._addDividerToPopover): Moved from child class, no changes.
(QueueView.prototype._appendPendingRevisionCount): Moved from child class, made it more generic
by taking latestIterationGetter method as an argument.
(QueueView.prototype._popoverLinesForCommitRange): Moved from child class, no changes.
(QueueView.prototype._presentPopoverForPendingCommits): Moved from child class, no changes.
(QueueView.prototype._formatRevisionForDisplay): Moved from child class, no changes.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(a:hover:link): Underline only when there is a link.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotBuilderQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotCombinedQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotTesterQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMainjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsQueueViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardStylesMaincss">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -75,24 +75,6 @@
</span><span class="cx">         }, this);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    addLinkToRow: function(rowElement, className, text, url)
-    {
-        var linkElement = document.createElement(&quot;a&quot;);
-        linkElement.className = className;
-        linkElement.textContent = text;
-        linkElement.href = url;
-        linkElement.target = &quot;_blank&quot;;
-        rowElement.appendChild(linkElement);
-    },
-
-    addTextToRow: function(rowElement, className, text)
-    {
-        var spanElement = document.createElement(&quot;span&quot;);
-        spanElement.className = className;
-        spanElement.textContent = text;
-        rowElement.appendChild(spanElement);
-    },
-
</del><span class="cx">     _addQueueHeadingToPopover: function(queue, content)
</span><span class="cx">     {
</span><span class="cx">         var title = document.createElement(&quot;div&quot;);
</span><span class="lines">@@ -113,13 +95,6 @@
</span><span class="cx">         content.appendChild(title);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _addDividerToPopover: function(content)
-    {
-        var divider = document.createElement(&quot;div&quot;);
-        divider.className = &quot;divider&quot;;
-        content.appendChild(divider);
-    },
-
</del><span class="cx">     _timeIntervalString: function(time)
</span><span class="cx">     {
</span><span class="cx">         var secondsInHour = 60 * 60;
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotBuilderQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            this._appendPendingRevisionCount(queue);
</del><ins>+            this._appendPendingRevisionCount(queue, this._latestProductiveIteration.bind(this, queue));
</ins><span class="cx"> 
</span><span class="cx">             var firstRecentUnsuccessfulIteration = queue.firstRecentUnsuccessfulIteration;
</span><span class="cx">             var mostRecentFinishedIteration = queue.mostRecentFinishedIteration;
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotCombinedQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">             // Show the revision for the slowest queue, because we don't know if any newer revisions are green on all queues.
</span><span class="cx">             // This can be slightly misleading after fixing a problem, because we can show a known broken revision as green.
</span><span class="cx">             var slowestQueue = this.queues.slice().sort(function(a, b) { return BuildbotQueue.prototype.compareIterationsByRevisions(a.mostRecentSuccessfulIteration, b.mostRecentSuccessfulIteration); }).pop();
</span><del>-            this._appendPendingRevisionCount(slowestQueue);
</del><ins>+            this._appendPendingRevisionCount(slowestQueue, this._latestProductiveIteration.bind(this, slowestQueue));
</ins><span class="cx"> 
</span><span class="cx">             var message = this.revisionContentForIteration(slowestQueue.mostRecentSuccessfulIteration);
</span><span class="cx">             var statusMessagePassed = &quot;all &quot; + (queue.builder ? &quot;builds succeeded&quot; : &quot;tests passed&quot;);
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">                     return;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                this._appendPendingRevisionCount(queue);
</del><ins>+                this._appendPendingRevisionCount(queue, this._latestProductiveIteration.bind(this, queue));
</ins><span class="cx"> 
</span><span class="cx">                 var firstRecentUnsuccessfulIteration = queue.firstRecentUnsuccessfulIteration;
</span><span class="cx">                 var mostRecentFinishedIteration = queue.mostRecentFinishedIteration;
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -73,121 +73,6 @@
</span><span class="cx">         this.element.appendChild(status.element);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _appendPendingRevisionCount: function(queue)
-    {
-        var latestProductiveIteration = this._latestProductiveIteration(queue);
-        if (!latestProductiveIteration)
-            return;
-
-        var totalRevisionsBehind = 0;
-
-        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
-        // the queue, see _should_file_trigger_build in wkbuild.py.
-        var branches = queue.branches;
-        for (var i = 0; i &lt; branches.length; ++i) {
-            var branch = branches[i];
-            var repository = branch.repository;
-            var repositoryName = repository.name;
-            var trac = repository.trac;
-            var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
-            if (!latestProductiveRevisionNumber)
-                continue;
-            if (!trac)
-                continue;
-            if (!trac.latestRecordedRevisionNumber || trac.indexOfRevision(trac.oldestRecordedRevisionNumber) &gt; trac.indexOfRevision(latestProductiveRevisionNumber)) {
-                trac.loadMoreHistoricalData();
-                return;
-            }
-
-            totalRevisionsBehind += trac.commitsOnBranchLaterThanRevision(branch.name, latestProductiveRevisionNumber).length;
-        }
-
-        if (!totalRevisionsBehind)
-            return;
-
-        var messageElement = document.createElement(&quot;span&quot;); // We can't just pass text to StatusLineView here, because we need an element that perfectly fits the text for popover positioning.
-        messageElement.textContent = totalRevisionsBehind + &quot; &quot; + (totalRevisionsBehind === 1 ? &quot;revision behind&quot; : &quot;revisions behind&quot;);
-        var status = new StatusLineView(messageElement, StatusLineView.Status.NoBubble);
-        this.element.appendChild(status.element);
-
-        new PopoverTracker(messageElement, this._presentPopoverForPendingCommits.bind(this), queue);
-    },
-
-    _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber)
-    {
-        function lineForCommit(trac, commit)
-        {
-            var result = document.createElement(&quot;div&quot;);
-            result.className = &quot;pending-commit&quot;;
-
-            var linkElement = document.createElement(&quot;a&quot;);
-            linkElement.className = &quot;revision&quot;;
-            linkElement.href = trac.revisionURL(commit.revisionNumber);
-            linkElement.target = &quot;_blank&quot;;
-            linkElement.textContent = this._formatRevisionForDisplay(commit.revisionNumber, branch.repository);
-            result.appendChild(linkElement);
-
-            var authorElement = document.createElement(&quot;span&quot;);
-            authorElement.className = &quot;author&quot;;
-            authorElement.textContent = commit.author;
-            result.appendChild(authorElement);
-
-            var titleElement = document.createElement(&quot;span&quot;);
-            titleElement.className = &quot;title&quot;;
-            titleElement.innerHTML = commit.title.innerHTML;
-            result.appendChild(titleElement);
-
-            return result;
-        }
-
-        console.assert(trac.indexOfRevision(trac.oldestRecordedRevisionNumber) &lt;= trac.indexOfRevision(firstRevisionNumber));
-
-        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
-        // the queue, see _should_file_trigger_build in wkbuild.py.
-        var commits = trac.commitsOnBranchInRevisionRange(branch.name, firstRevisionNumber, lastRevisionNumber);
-        return commits.map(function(commit) {
-            return lineForCommit.call(this, trac, commit);
-        }, this).reverse();
-    },
-
-    _presentPopoverForPendingCommits: function(element, popover, queue)
-    {
-        var latestProductiveIteration = this._latestProductiveIteration(queue);
-        if (!latestProductiveIteration)
-            return false;
-
-        var content = document.createElement(&quot;div&quot;);
-        content.className = &quot;commit-history-popover&quot;;
-
-        var shouldAddDivider = false;
-        var branches = queue.branches;
-        for (var i = 0; i &lt; branches.length; ++i) {
-            var branch = branches[i];
-            var repository = branch.repository;
-            var repositoryName = repository.name;
-            var trac = repository.trac;
-            var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
-            if (!latestProductiveRevisionNumber || !trac.latestRecordedRevisionNumber)
-                continue;
-            var nextRevision = trac.nextRevision(branch.name, latestProductiveRevisionNumber);
-            if (nextRevision === Trac.NO_MORE_REVISIONS)
-                continue;
-            var lines = this._popoverLinesForCommitRange(trac, branch, nextRevision, trac.latestRecordedRevisionNumber);
-            var length = lines.length;
-            if (length &amp;&amp; shouldAddDivider)
-                this._addDividerToPopover(content);
-            for (var j = 0; j &lt; length; ++j)
-                content.appendChild(lines[j]);
-            shouldAddDivider = shouldAddDivider || length &gt; 0;
-        }
-
-        var rect = Dashboard.Rect.rectFromClientRect(element.getBoundingClientRect());
-        popover.content = content;
-        popover.present(rect, [Dashboard.RectEdge.MIN_Y, Dashboard.RectEdge.MAX_Y, Dashboard.RectEdge.MAX_X, Dashboard.RectEdge.MIN_X]);
-
-        return true;
-    },
-
</del><span class="cx">     _presentPopoverForRevisionRange: function(element, popover, context)
</span><span class="cx">     {
</span><span class="cx">         var content = document.createElement(&quot;div&quot;);
</span><span class="lines">@@ -289,13 +174,6 @@
</span><span class="cx">         content.appendChild(title);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _addDividerToPopover: function(content)
-    {
-        var divider = document.createElement(&quot;div&quot;);
-        divider.className = &quot;divider&quot;;
-        content.appendChild(divider);
-    },
-
</del><span class="cx">     revisionContentForIteration: function(iteration, previousDisplayedIteration)
</span><span class="cx">     {
</span><span class="cx">         var fragment = document.createDocumentFragment();
</span><span class="lines">@@ -356,14 +234,5 @@
</span><span class="cx">     _unauthorizedAccess: function(event)
</span><span class="cx">     {
</span><span class="cx">         this.updateSoon();
</span><del>-    },
-
-    _formatRevisionForDisplay: function(revision, repository)
-    {
-        console.assert(repository.isSVN || repository.isGit, &quot;Should not get here; &quot; + repository.name + &quot; did not specify a known VCS type.&quot;);
-        if (repository.isSVN)
-            return &quot;r&quot; + revision;
-        // Truncating for display. Git traditionally uses seven characters for a short hash.
-        return revision.substr(0, 7);
</del><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBuildbotTesterQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            this._appendPendingRevisionCount(queue);
</del><ins>+            this._appendPendingRevisionCount(queue, this._latestProductiveIteration.bind(this, queue));
</ins><span class="cx"> 
</span><span class="cx">             var appendedStatus = false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> var hasBubbles = typeof bubbleQueueServer != &quot;undefined&quot;;
</span><span class="cx"> var BubblesCategory = &quot;bubbles&quot;;
</span><span class="cx"> 
</span><del>-var categorizedQueuesByPlatformAndBuildType = {};
</del><ins>+if (!categorizedQueuesByPlatformAndBuildType)
+    var categorizedQueuesByPlatformAndBuildType = {};
</ins><span class="cx"> var platformsByFamily = {};
</span><span class="cx"> 
</span><span class="cx"> for (var i = 0; i &lt; buildbots.length; ++i) {
</span><span class="lines">@@ -258,6 +259,9 @@
</span><span class="cx">             cell.appendChild(view.element);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (platformQueues.customView)
+            cell.appendChild(platformQueues.customView.element);
+
</ins><span class="cx">         if (platformQueues[BubblesCategory]) {
</span><span class="cx">             var view = new BubbleQueueView(platformQueues[BubblesCategory]);
</span><span class="cx">             cell.appendChild(view.element);
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsQueueViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -78,5 +78,154 @@
</span><span class="cx">             clearInterval(this.updateTimer);
</span><span class="cx">             this.updateTimer = null;
</span><span class="cx">         }
</span><ins>+    },
+
+    addLinkToRow: function(rowElement, className, text, url)
+    {   
+        var linkElement = document.createElement(&quot;a&quot;);
+        linkElement.className = className;
+        linkElement.textContent = text;
+        linkElement.href = url;
+        linkElement.target = &quot;_blank&quot;;
+        rowElement.appendChild(linkElement);
+    },  
+
+    addTextToRow: function(rowElement, className, text)
+    {   
+        var spanElement = document.createElement(&quot;span&quot;);
+        spanElement.className = className;
+        spanElement.textContent = text;
+        rowElement.appendChild(spanElement);
+    },
+
+    _addDividerToPopover: function(content)
+    {
+        var divider = document.createElement(&quot;div&quot;);
+        divider.className = &quot;divider&quot;;
+        content.appendChild(divider);
+    },
+
+    _appendPendingRevisionCount: function(queue, latestIterationGetter)
+    {
+        var latestProductiveIteration = latestIterationGetter();
+        if (!latestProductiveIteration)
+            return;
+
+        var totalRevisionsBehind = 0;
+
+        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
+        // the queue, see _should_file_trigger_build in wkbuild.py.
+        var branches = queue.branches;
+        for (var i = 0; i &lt; branches.length; ++i) {
+            var branch = branches[i];
+            var repository = branch.repository;
+            var repositoryName = repository.name;
+            var trac = repository.trac;
+            var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
+            if (!latestProductiveRevisionNumber)
+                continue;
+            if (!trac)
+                continue;
+            if (!trac.latestRecordedRevisionNumber || trac.indexOfRevision(trac.oldestRecordedRevisionNumber) &gt; trac.indexOfRevision(latestProductiveRevisionNumber)) {
+                trac.loadMoreHistoricalData();
+                return;
+            }
+
+            totalRevisionsBehind += trac.commitsOnBranchLaterThanRevision(branch.name, latestProductiveRevisionNumber).length;
+        }
+
+        if (!totalRevisionsBehind)
+            return;
+
+        var messageElement = document.createElement(&quot;span&quot;); // We can't just pass text to StatusLineView here, because we need an element that perfectly fits the text for popover positioning.
+        messageElement.textContent = totalRevisionsBehind + &quot; &quot; + (totalRevisionsBehind === 1 ? &quot;revision behind&quot; : &quot;revisions behind&quot;);
+        var status = new StatusLineView(messageElement, StatusLineView.Status.NoBubble);
+        this.element.appendChild(status.element);
+
+        new PopoverTracker(messageElement, this._presentPopoverForPendingCommits.bind(this, latestIterationGetter), queue);
+    },
+
+    _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber)
+    {
+        function lineForCommit(trac, commit)
+        {
+            var result = document.createElement(&quot;div&quot;);
+            result.className = &quot;pending-commit&quot;;
+
+            var linkElement = document.createElement(&quot;a&quot;);
+            linkElement.className = &quot;revision&quot;;
+            linkElement.href = trac.revisionURL(commit.revisionNumber);
+            linkElement.target = &quot;_blank&quot;;
+            linkElement.textContent = this._formatRevisionForDisplay(commit.revisionNumber, branch.repository);
+            result.appendChild(linkElement);
+
+            var authorElement = document.createElement(&quot;span&quot;);
+            authorElement.className = &quot;author&quot;;
+            authorElement.textContent = commit.author;
+            result.appendChild(authorElement);
+
+            var titleElement = document.createElement(&quot;span&quot;);
+            titleElement.className = &quot;title&quot;;
+            titleElement.innerHTML = commit.title.innerHTML;
+            result.appendChild(titleElement);
+
+            return result;
+        }
+
+        console.assert(trac.indexOfRevision(trac.oldestRecordedRevisionNumber) &lt;= trac.indexOfRevision(firstRevisionNumber));
+
+        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
+        // the queue, see _should_file_trigger_build in wkbuild.py.
+        var commits = trac.commitsOnBranchInRevisionRange(branch.name, firstRevisionNumber, lastRevisionNumber);
+        return commits.map(function(commit) {
+            return lineForCommit.call(this, trac, commit);
+        }, this).reverse();
+    },
+
+    _presentPopoverForPendingCommits: function(latestIterationGetter, element, popover, queue)
+    {
+        var latestProductiveIteration = latestIterationGetter();
+        if (!latestProductiveIteration)
+            return false;
+
+        var content = document.createElement(&quot;div&quot;);
+        content.className = &quot;commit-history-popover&quot;;
+
+        var shouldAddDivider = false;
+        var branches = queue.branches;
+        for (var i = 0; i &lt; branches.length; ++i) {
+            var branch = branches[i];
+            var repository = branch.repository;
+            var repositoryName = repository.name;
+            var trac = repository.trac;
+            var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
+            if (!latestProductiveRevisionNumber || !trac.latestRecordedRevisionNumber)
+                continue;
+            var nextRevision = trac.nextRevision(branch.name, latestProductiveRevisionNumber);
+            if (nextRevision === Trac.NO_MORE_REVISIONS)
+                continue;
+            var lines = this._popoverLinesForCommitRange(trac, branch, nextRevision, trac.latestRecordedRevisionNumber);
+            var length = lines.length;
+            if (length &amp;&amp; shouldAddDivider)
+                this._addDividerToPopover(content);
+            for (var j = 0; j &lt; length; ++j)
+                content.appendChild(lines[j]);
+            shouldAddDivider = shouldAddDivider || length &gt; 0;
+        }
+
+        var rect = Dashboard.Rect.rectFromClientRect(element.getBoundingClientRect());
+        popover.content = content;
+        popover.present(rect, [Dashboard.RectEdge.MIN_Y, Dashboard.RectEdge.MAX_Y, Dashboard.RectEdge.MAX_X, Dashboard.RectEdge.MIN_X]);
+
+        return true;
+    },
+
+    _formatRevisionForDisplay: function(revision, repository)
+    {
+        console.assert(repository.isSVN || repository.isGit, &quot;Should not get here; &quot; + repository.name + &quot; did not specify a known VCS type.&quot;);
+        if (repository.isSVN)
+            return &quot;r&quot; + revision;
+        // Truncating for display. Git traditionally uses seven characters for a short hash.
+        return revision.substr(0, 7);
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardStylesMaincss"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">     text-decoration: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-a:hover {
</del><ins>+a:hover:link {
</ins><span class="cx">     text-decoration: underline;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (200879 => 200880)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-05-13 20:16:29 UTC (rev 200879)
+++ trunk/Tools/ChangeLog        2016-05-13 20:35:58 UTC (rev 200880)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-05-13  Aakash Jain  &lt;aakash_jain@apple.com&gt;
+
+        Dashboard code restructuring
+        https://bugs.webkit.org/show_bug.cgi?id=157680
+        &lt;rdar://problem/14736888&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js:
+        (BubbleQueueView.prototype.addLinkToRow): Moved to base class.
+        (BubbleQueueView.prototype.addTextToRow): Moved to base class.
+        (BubbleQueueView.prototype._addDividerToPopover): Moved to base class.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js:
+        (BuildbotBuilderQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js:
+        (BuildbotCombinedQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
+        (BuildbotTesterQueueView.prototype.update): Passing additional argument to _appendPendingRevisionCount.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
+        (BuildbotQueueView.prototype._appendPendingRevisionCount): Moved to base class and modified to take
+        additional argument.
+        (BuildbotQueueView.prototype._popoverLinesForCommitRange): Moved to base class.
+        (BuildbotQueueView.prototype._presentPopoverForPendingCommits): Moved to base class.
+        (BuildbotQueueView.prototype._addDividerToPopover): Moved to base class.
+        (BuildbotQueueView.prototype._formatRevisionForDisplay): Moved to base class.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js:
+        (documentReady): Display any customView if available.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js:
+        (QueueView.prototype.addLinkToRow): Moved from child class, no changes.
+        (QueueView.prototype.addTextToRow): Moved from child class, no changes.
+        (QueueView.prototype._addDividerToPopover): Moved from child class, no changes.
+        (QueueView.prototype._appendPendingRevisionCount): Moved from child class, made it more generic
+        by taking latestIterationGetter method as an argument.
+        (QueueView.prototype._popoverLinesForCommitRange): Moved from child class, no changes.
+        (QueueView.prototype._presentPopoverForPendingCommits): Moved from child class, no changes.
+        (QueueView.prototype._formatRevisionForDisplay): Moved from child class, no changes.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
+        (a:hover:link): Underline only when there is a link.
+
</ins><span class="cx"> 2016-05-13  Yoav Weiss  &lt;yoav@yoav.ws&gt;
</span><span class="cx"> 
</span><span class="cx">         Turn on WEB_TIMING for all ports
</span></span></pre>
</div>
</div>

</body>
</html>