<!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>[184553] trunk/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/184553">184553</a></dd>
<dt>Author</dt> <dd>nvasilyev@apple.com</dd>
<dt>Date</dt> <dd>2015-05-19 00:12:40 -0700 (Tue, 19 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Convert stackTrace from raw payload data to an array of CallFrames
https://bugs.webkit.org/show_bug.cgi?id=144982

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/LogManager.js:
* UserInterface/Main.html:
* UserInterface/Models/CallFrame.js:
(WebInspector.CallFrame.fromPayload):
Consider an empty string url as a native code as it was in
WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame

* UserInterface/Models/ConsoleMessage.js:
(WebInspector.ConsoleMessage):
Convert _stackTrace from an array of payload objects to WebInspector.StackTrace model.

* UserInterface/Models/StackTrace.js: Added.
(WebInspector.StackTrace):
(WebInspector.StackTrace.prototype.get callFrames):
(WebInspector.StackTrace.prototype.get firstNonNativeCallFrame): Added.
(WebInspector.StackTrace.fromPayload):
* UserInterface/Test.html:
* UserInterface/Views/CallFrameView.js:
(WebInspector.CallFrameView):
Don't show a URL when sourceCodeLocation is missing, fix webkit.org/b/145071.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView):
(WebInspector.ConsoleMessageView.prototype.toClipboardString):
(WebInspector.ConsoleMessageView.prototype._appendLocationLink):
(WebInspector.ConsoleMessageView.prototype._appendStackTrace):
(WebInspector.ConsoleMessageView.prototype._shouldShowStackTrace):
(WebInspector.ConsoleMessageView.prototype._linkifyCallFrame):
(WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCallFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsConsoleMessagejs">trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCallFrameViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsStackTracejs">trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2015-05-19  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
+
+        Web Inspector: Convert stackTrace from raw payload data to an array of CallFrames
+        https://bugs.webkit.org/show_bug.cgi?id=144982
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Controllers/LogManager.js:
+        * UserInterface/Main.html:
+        * UserInterface/Models/CallFrame.js:
+        (WebInspector.CallFrame.fromPayload):
+        Consider an empty string url as a native code as it was in 
+        WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame
+
+        * UserInterface/Models/ConsoleMessage.js:
+        (WebInspector.ConsoleMessage):
+        Convert _stackTrace from an array of payload objects to WebInspector.StackTrace model.
+
+        * UserInterface/Models/StackTrace.js: Added.
+        (WebInspector.StackTrace):
+        (WebInspector.StackTrace.prototype.get callFrames):
+        (WebInspector.StackTrace.prototype.get firstNonNativeCallFrame): Added.
+        (WebInspector.StackTrace.fromPayload):
+        * UserInterface/Test.html:
+        * UserInterface/Views/CallFrameView.js:
+        (WebInspector.CallFrameView):
+        Don't show a URL when sourceCodeLocation is missing, fix webkit.org/b/145071.
+
+        * UserInterface/Views/ConsoleMessageView.js:
+        (WebInspector.ConsoleMessageView):
+        (WebInspector.ConsoleMessageView.prototype.toClipboardString):
+        (WebInspector.ConsoleMessageView.prototype._appendLocationLink):
+        (WebInspector.ConsoleMessageView.prototype._appendStackTrace):
+        (WebInspector.ConsoleMessageView.prototype._shouldShowStackTrace):
+        (WebInspector.ConsoleMessageView.prototype._linkifyCallFrame):
+        (WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame): Deleted.
+
</ins><span class="cx"> 2015-05-18  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Improve Reliability of Closing and Reopening Elements Tab
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx">     {
</span><span class="cx">         // Called from WebInspector.ConsoleObserver.
</span><span class="cx"> 
</span><del>-        // FIXME: stackTrace should be converted to a model object.
</del><span class="cx">         // FIXME: Get a request from request ID.
</span><span class="cx"> 
</span><span class="cx">         if (parameters)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -299,6 +299,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeTimeline.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceMap.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceMapResource.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/StackTrace.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/TextMarker.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/TextRange.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/TimelineMarker.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCallFramejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -108,20 +108,23 @@
</span><span class="cx"> 
</span><span class="cx">         var url = payload.url;
</span><span class="cx">         var nativeCode = false;
</span><ins>+        var sourceCodeLocation = null;
</ins><span class="cx"> 
</span><del>-        if (url === &quot;[native code]&quot;) {
</del><ins>+        if (!url || url === &quot;[native code]&quot;) {
</ins><span class="cx">             nativeCode = true;
</span><span class="cx">             url = null;
</span><ins>+        } else {
+            var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
+            if (!sourceCode)
+                sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
+
+            if (sourceCode) {
+                // The lineNumber is 1-based, but we expect 0-based.
+                var lineNumber = payload.lineNumber - 1;
+                sourceCodeLocation = sourceCode.createLazySourceCodeLocation(lineNumber, payload.columnNumber);
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
-        if (!sourceCode)
-            sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
-
-        // The lineNumber is 1-based, but we expect 0-based.
-        var lineNumber = payload.lineNumber - 1;
-
-        var sourceCodeLocation = sourceCode ? sourceCode.createLazySourceCodeLocation(lineNumber, payload.columnNumber) : null;
</del><span class="cx">         var functionName = payload.functionName !== &quot;global code&quot; ? payload.functionName : null;
</span><span class="cx"> 
</span><span class="cx">         return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsConsoleMessagejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -44,7 +44,9 @@
</span><span class="cx"> 
</span><span class="cx">         this._repeatCount = repeatCount || 0;
</span><span class="cx">         this._parameters = parameters;
</span><del>-        this._stackTrace = stackTrace;
</del><ins>+
+        this._stackTrace = WebInspector.StackTrace.fromPayload(stackTrace || []);
+
</ins><span class="cx">         this._request = request;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsStackTracejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js (0 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.StackTrace = class StackTrace extends WebInspector.Object
+{
+    constructor(callFrames)
+    {
+        super();
+
+        console.assert(callFrames &amp;&amp; callFrames.every(function(callFrame) { return callFrame instanceof WebInspector.CallFrame; }));
+
+        this._callFrames = callFrames;
+    }
+
+    get callFrames()
+    {
+        return this._callFrames;
+    }
+
+    get firstNonNativeCallFrame()
+    {
+        for (var frame of this._callFrames) {
+            if (!frame.nativeCode)
+                return frame;
+        }
+
+        return null;
+    }
+
+    // Static
+
+    static fromPayload(payload)
+    {
+        var callFrames = payload.map(WebInspector.CallFrame.fromPayload);
+        return new WebInspector.StackTrace(callFrames);
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -123,6 +123,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeRevision.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeTimeline.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceMapResource.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/StackTrace.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/TextRange.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/TimelineMarker.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/TimelineRecording.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCallFrameViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameView.js (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameView.js        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameView.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -27,23 +27,26 @@
</span><span class="cx"> {
</span><span class="cx">     constructor(callFrame)
</span><span class="cx">     {
</span><del>-        console.assert(callFrame.sourceCodeLocation &amp;&amp; callFrame.sourceCodeLocation.sourceCode);
</del><ins>+        console.assert(callFrame instanceof WebInspector.CallFrame);
</ins><span class="cx"> 
</span><span class="cx">         var callFrameElement = document.createElement(&quot;div&quot;);
</span><span class="cx">         callFrameElement.classList.add(&quot;call-frame&quot;, WebInspector.CallFrameView.iconClassNameForCallFrame(callFrame));
</span><span class="cx"> 
</span><ins>+        var subtitleElement = document.createElement(&quot;span&quot;);
+        subtitleElement.classList.add(&quot;subtitle&quot;);
+
</ins><span class="cx">         var sourceCodeLocation = callFrame.sourceCodeLocation;
</span><del>-        WebInspector.linkifyElement(callFrameElement, sourceCodeLocation);
</del><ins>+        if (sourceCodeLocation) {
+            WebInspector.linkifyElement(callFrameElement, sourceCodeLocation);
</ins><span class="cx"> 
</span><del>-        var linkElement = document.createElement(&quot;a&quot;);
-        linkElement.className = &quot;source-link&quot;;
-        linkElement.href = sourceCodeLocation.sourceCode.url;
-        sourceCodeLocation.populateLiveDisplayLocationTooltip(linkElement);
-        sourceCodeLocation.populateLiveDisplayLocationString(linkElement, &quot;textContent&quot;);
</del><ins>+            var linkElement = document.createElement(&quot;a&quot;);
+            linkElement.className = &quot;source-link&quot;;
+            linkElement.href = sourceCodeLocation.sourceCode.url;
+            subtitleElement.appendChild(linkElement);
</ins><span class="cx"> 
</span><del>-        var subtitleElement = document.createElement(&quot;span&quot;);
-        subtitleElement.classList.add(&quot;subtitle&quot;);
-        subtitleElement.appendChild(linkElement);
</del><ins>+            sourceCodeLocation.populateLiveDisplayLocationTooltip(linkElement);
+            sourceCodeLocation.populateLiveDisplayLocationString(linkElement, &quot;textContent&quot;);
+        }
</ins><span class="cx"> 
</span><span class="cx">         if (callFrame.functionName) {
</span><span class="cx">             var imgElement = document.createElement(&quot;img&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js (184552 => 184553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js        2015-05-19 06:49:56 UTC (rev 184552)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js        2015-05-19 07:12:40 UTC (rev 184553)
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> 
</span><span class="cx">         var hasStackTrace = this._shouldShowStackTrace();
</span><span class="cx">         if (hasStackTrace) {
</span><del>-            this._message.stackTrace.forEach(function(frame) {
</del><ins>+            this._message.stackTrace.callFrames.forEach(function(frame) {
</ins><span class="cx">                 clipboardString += &quot;\n\t&quot; + (frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;));
</span><span class="cx">                 if (frame.url)
</span><span class="cx">                     clipboardString += &quot; (&quot; + WebInspector.displayNameForURL(frame.url) + &quot;, line &quot; + frame.lineNumber + &quot;)&quot;;
</span><span class="lines">@@ -286,12 +286,12 @@
</span><span class="cx">         if (this._message.source === WebInspector.ConsoleMessage.MessageSource.Network || this._message.request)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
</del><ins>+        var firstNonNativeCallFrame = this._message.stackTrace.firstNonNativeCallFrame;
</ins><span class="cx"> 
</span><span class="cx">         var callFrame;
</span><span class="cx">         if (firstNonNativeCallFrame) {
</span><span class="cx">             // JavaScript errors and console.* methods.
</span><del>-            callFrame = WebInspector.CallFrame.fromPayload(firstNonNativeCallFrame);
</del><ins>+            callFrame = firstNonNativeCallFrame;
</ins><span class="cx">         } else if (this._message.url &amp;&amp; !this._shouldHideURL(this._message.url)) {
</span><span class="cx">             // CSS warnings have no stack traces.
</span><span class="cx">             callFrame = WebInspector.CallFrame.fromPayload({
</span><span class="lines">@@ -346,11 +346,12 @@
</span><span class="cx">         this._stackTraceElement.classList.add(&quot;console-message-stack-trace-container&quot;);
</span><span class="cx">         this._stackTraceElement.classList.add(&quot;console-message-text&quot;);
</span><span class="cx"> 
</span><del>-        for (var callFrame of this._message.stackTrace) {
</del><ins>+        for (var callFrame of this._message.stackTrace.callFrames) {
</ins><span class="cx">             var callFrameElement = this._stackTraceElement.appendChild(document.createElement(&quot;li&quot;));
</span><span class="cx">             callFrameElement.classList.add(&quot;console-message-stack-trace-call-frame&quot;);
</span><span class="cx">             callFrameElement.textContent = callFrame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;);
</span><del>-            if (callFrame.url &amp;&amp; !this._shouldHideURL(callFrame.url))
</del><ins>+            var url = (callFrame.sourceCodeLocation &amp;&amp; callFrame.sourceCodeLocation.sourceCode &amp;&amp; callFrame.sourceCodeLocation.sourceCode.url) || &quot;&quot;;
+            if (url &amp;&amp; !this._shouldHideURL(url))
</ins><span class="cx">                 callFrameElement.appendChild(this._linkifyCallFrame(callFrame));
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -594,7 +595,7 @@
</span><span class="cx"> 
</span><span class="cx">     _shouldShowStackTrace()
</span><span class="cx">     {
</span><del>-        if (!this._message.stackTrace || !this._message.stackTrace.length)
</del><ins>+        if (!this._message.stackTrace.callFrames.length)
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         return this._message.source === WebInspector.ConsoleMessage.MessageSource.Network
</span><span class="lines">@@ -607,21 +608,6 @@
</span><span class="cx">         return url === &quot;undefined&quot; || url === &quot;[native code]&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _firstNonNativeCallFrame()
-    {
-        if (!this._message.stackTrace)
-            return null;
-
-        for (var i = 0; i &lt; this._message.stackTrace.length; i++) {
-            var frame = this._message.stackTrace[i];
-            if (!frame.url || frame.url === &quot;[native code]&quot;)
-                continue;
-            return frame;
-        }
-
-        return null;
-    }
-
</del><span class="cx">     _linkifyLocation(url, lineNumber, columnNumber)
</span><span class="cx">     {
</span><span class="cx">         // ConsoleMessage stack trace line numbers are one-based.
</span><span class="lines">@@ -632,7 +618,18 @@
</span><span class="cx"> 
</span><span class="cx">     _linkifyCallFrame(callFrame)
</span><span class="cx">     {
</span><del>-        return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
</del><ins>+        var url = &quot;&quot;;
+        var lineNumber = 0;
+        var columnNumber = 0;
+
+        var sourceCodeLocation = callFrame._sourceCodeLocation;
+        if (sourceCodeLocation) {
+            lineNumber = sourceCodeLocation.lineNumber;
+            columnNumber = sourceCodeLocation.columnNumber;
+            url = sourceCodeLocation.sourceCode &amp;&amp; sourceCodeLocation.sourceCode.url || &quot;&quot;;
+        }
+
+        return this._linkifyLocation(url, lineNumber, columnNumber);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _userProvidedColumnNames(columnNamesArgument)
</span></span></pre>
</div>
</div>

</body>
</html>