<!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>[163138] 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/163138">163138</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2014-01-30 17:34:19 -0800 (Thu, 30 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Prefix existing Web Inspector profiler classes with "Legacy".
Remove a dependency on ProfileView for showTimeAsPercent and selection as a drive-by.
Also remove the unfinished Canvas profiler classes, they will need redone for the Timeline view.
https://bugs.webkit.org/show_bug.cgi?id=127655
Reviewed by Joseph Pecoraro.
* UserInterface/CanvasDataGridNode.js: Removed.
* UserInterface/CanvasObserver.js: Removed.
* UserInterface/CanvasProfileObject.js: Removed.
* UserInterface/CanvasProfileType.js: Removed.
* UserInterface/CanvasProfileView.js: Removed.
* UserInterface/ConsoleObserver.js:
(WebInspector.ConsoleObserver.prototype.messageAdded):
* UserInterface/ContentView.js:
(WebInspector.ContentView):
(WebInspector.ContentView.isViewable):
* UserInterface/InspectorFrontendAPI.js:
(InspectorFrontendAPI.isProfilingJavaScript):
(InspectorFrontendAPI.startProfilingJavaScript):
(InspectorFrontendAPI.stopProfilingJavaScript):
* UserInterface/LegacyBottomUpProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js.
* UserInterface/LegacyJavaScriptProfileObject.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js.
* UserInterface/LegacyJavaScriptProfileType.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js.
* UserInterface/LegacyJavaScriptProfileView.css: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css.
* UserInterface/LegacyJavaScriptProfileView.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js.
* UserInterface/LegacyProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js.
* UserInterface/LegacyProfileManager.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileManager.js.
* UserInterface/LegacyProfileObject.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileObject.js.
* UserInterface/LegacyProfileType.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileType.js.
* UserInterface/LegacyProfileView.css: Renamed from Source/WebInspectorUI/UserInterface/ProfileView.css.
* UserInterface/LegacyProfileView.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileView.js.
* UserInterface/LegacyProfilerObserver.js: Renamed from Source/WebInspectorUI/UserInterface/ProfilerObserver.js.
* UserInterface/LegacyTopDownProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js.
* UserInterface/Main.html:
* UserInterface/Main.js:
(WebInspector.loaded):
(WebInspector.openURL):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleObserverjs">trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorFrontendAPIjs">trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainjs">trunk/Source/WebInspectorUI/UserInterface/Main.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyBottomUpProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileManagerjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfilerObserverjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyTopDownProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBottomUpProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCanvasDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/CanvasDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCanvasObserverjs">trunk/Source/WebInspectorUI/UserInterface/CanvasObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCanvasProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/CanvasProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCanvasProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/CanvasProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCanvasProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/CanvasProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileManagerjs">trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/ProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/ProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/ProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/ProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfilerObserverjs">trunk/Source/WebInspectorUI/UserInterface/ProfilerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTopDownProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2014-01-26 Timothy Hatcher <timothy@apple.com>
+
+ Prefix existing Web Inspector profiler classes with "Legacy".
+
+ Remove a dependency on ProfileView for showTimeAsPercent and selection as a drive-by.
+ Also remove the unfinished Canvas profiler classes, they will need redone for the Timeline view.
+
+ https://bugs.webkit.org/show_bug.cgi?id=127655
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/CanvasDataGridNode.js: Removed.
+ * UserInterface/CanvasObserver.js: Removed.
+ * UserInterface/CanvasProfileObject.js: Removed.
+ * UserInterface/CanvasProfileType.js: Removed.
+ * UserInterface/CanvasProfileView.js: Removed.
+ * UserInterface/ConsoleObserver.js:
+ (WebInspector.ConsoleObserver.prototype.messageAdded):
+ * UserInterface/ContentView.js:
+ (WebInspector.ContentView):
+ (WebInspector.ContentView.isViewable):
+ * UserInterface/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.isProfilingJavaScript):
+ (InspectorFrontendAPI.startProfilingJavaScript):
+ (InspectorFrontendAPI.stopProfilingJavaScript):
+ * UserInterface/LegacyBottomUpProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js.
+ * UserInterface/LegacyJavaScriptProfileObject.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js.
+ * UserInterface/LegacyJavaScriptProfileType.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js.
+ * UserInterface/LegacyJavaScriptProfileView.css: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css.
+ * UserInterface/LegacyJavaScriptProfileView.js: Renamed from Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js.
+ * UserInterface/LegacyProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js.
+ * UserInterface/LegacyProfileManager.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileManager.js.
+ * UserInterface/LegacyProfileObject.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileObject.js.
+ * UserInterface/LegacyProfileType.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileType.js.
+ * UserInterface/LegacyProfileView.css: Renamed from Source/WebInspectorUI/UserInterface/ProfileView.css.
+ * UserInterface/LegacyProfileView.js: Renamed from Source/WebInspectorUI/UserInterface/ProfileView.js.
+ * UserInterface/LegacyProfilerObserver.js: Renamed from Source/WebInspectorUI/UserInterface/ProfilerObserver.js.
+ * UserInterface/LegacyTopDownProfileDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js.
+ * UserInterface/Main.html:
+ * UserInterface/Main.js:
+ (WebInspector.loaded):
+ (WebInspector.openURL):
+
</ins><span class="cx"> 2014-01-30 Diego Pino Garcia <dpino@igalia.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: [REGRESSION(r163086)] Missing localized string 'Hide console (%s)'
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBottomUpProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,265 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North Inc. All Rights Reserved.
- * Copyright (C) 2013 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. ``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
- * 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.
- */
-
-// Bottom Up Profiling shows the entire callstack backwards:
-// The root node is a representation of each individual function called, and each child of that node represents
-// a reverse-callstack showing how many of those calls came from it. So, unlike top-down, the statistics in
-// each child still represent the root node. We have to be particularly careful of recursion with this mode
-// because a root node can represent itself AND an ancestor.
-
-WebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree)
-{
- WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode));
-
- this._remainingNodeInfos = [];
-}
-
-WebInspector.BottomUpProfileDataGridNode.prototype = {
- _takePropertiesFromProfileDataGridNode: function(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- this._save();
-
- this.selfTime = profileDataGridNode.selfTime;
- this.totalTime = profileDataGridNode.totalTime;
- this.numberOfCalls = profileDataGridNode.numberOfCalls;
- },
-
- // When focusing, we keep just the members of the callstack.
- _keepOnlyChild: function(/*ProfileDataGridNode*/ child)
- {
- this._save();
-
- this.removeChildren();
- this.appendChild(child);
- },
-
- _exclude: function(aCallUID)
- {
- if (this._remainingNodeInfos)
- this._populate();
-
- this._save();
-
- var children = this.children;
- var index = this.children.length;
-
- while (index--)
- children[index]._exclude(aCallUID);
-
- var child = this.childrenByCallUID[aCallUID];
-
- if (child)
- this._merge(child, true);
- },
-
- _restore: function()
- {
- WebInspector.ProfileDataGridNode.prototype._restore();
-
- if (!this.children.length)
- this.hasChildren = this._willHaveChildren();
- },
-
- _merge: function(/*ProfileDataGridNode*/ child, /*Boolean*/ shouldAbsorb)
- {
- this.selfTime -= child.selfTime;
-
- WebInspector.ProfileDataGridNode.prototype._merge.call(this, child, shouldAbsorb);
- },
-
- _sharedPopulate: function()
- {
- var remainingNodeInfos = this._remainingNodeInfos;
- var count = remainingNodeInfos.length;
-
- for (var index = 0; index < count; ++index) {
- var nodeInfo = remainingNodeInfos[index];
- var ancestor = nodeInfo.ancestor;
- var focusNode = nodeInfo.focusNode;
- var child = this.findChild(ancestor);
-
- // If we already have this child, then merge the data together.
- if (child) {
- var totalTimeAccountedFor = nodeInfo.totalTimeAccountedFor;
-
- child.selfTime += focusNode.selfTime;
- child.numberOfCalls += focusNode.numberOfCalls;
-
- if (!totalTimeAccountedFor)
- child.totalTime += focusNode.totalTime;
- } else {
- // If not, add it as a true ancestor.
- // In heavy mode, we take our visual identity from ancestor node...
- child = new WebInspector.BottomUpProfileDataGridNode(this.profileView, ancestor, this.tree);
-
- if (ancestor !== focusNode) {
- // but the actual statistics from the "root" node (bottom of the callstack).
- child.selfTime = focusNode.selfTime;
- child.totalTime = focusNode.totalTime;
- child.numberOfCalls = focusNode.numberOfCalls;
- }
-
- this.appendChild(child);
- }
-
- var parent = ancestor.parent;
- if (parent && parent.parent) {
- nodeInfo.ancestor = parent;
- child._remainingNodeInfos.push(nodeInfo);
- }
- }
-
- delete this._remainingNodeInfos;
- },
-
- _willHaveChildren: function(profileNode)
- {
- profileNode = profileNode || this.profileNode;
- // In bottom up mode, our parents are our children since we display an inverted tree.
- // However, we don't want to show the very top parent since it is redundant.
- return !!(profileNode.parent && profileNode.parent.parent);
- }
-}
-
-WebInspector.BottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;
-
-WebInspector.BottomUpProfileDataGridTree = function(/*ProfileView*/ aProfileView, /*ProfileNode*/ aProfileNode)
-{
- WebInspector.ProfileDataGridTree.call(this, aProfileView, aProfileNode);
-
- // Iterate each node in pre-order.
- var profileNodeUIDs = 0;
- var profileNodeGroups = [[], [aProfileNode]];
- var visitedProfileNodesForCallUID = {};
-
- this._remainingNodeInfos = [];
-
- for (var profileNodeGroupIndex = 0; profileNodeGroupIndex < profileNodeGroups.length; ++profileNodeGroupIndex) {
- var parentProfileNodes = profileNodeGroups[profileNodeGroupIndex];
- var profileNodes = profileNodeGroups[++profileNodeGroupIndex];
- var count = profileNodes.length;
-
- for (var index = 0; index < count; ++index) {
- var profileNode = profileNodes[index];
-
- if (!profileNode.UID)
- profileNode.UID = ++profileNodeUIDs;
-
- if (profileNode.head && profileNode !== profileNode.head) {
- // The total time of this ancestor is accounted for if we're in any form of recursive cycle.
- var visitedNodes = visitedProfileNodesForCallUID[profileNode.callUID];
- var totalTimeAccountedFor = false;
-
- if (!visitedNodes) {
- visitedNodes = {};
- visitedProfileNodesForCallUID[profileNode.callUID] = visitedNodes;
- } else {
- // The total time for this node has already been accounted for iff one of it's parents has already been visited.
- // We can do this check in this style because we are traversing the tree in pre-order.
- var parentCount = parentProfileNodes.length;
- for (var parentIndex = 0; parentIndex < parentCount; ++parentIndex) {
- if (visitedNodes[parentProfileNodes[parentIndex].UID]) {
- totalTimeAccountedFor = true;
- break;
- }
- }
- }
-
- visitedNodes[profileNode.UID] = true;
-
- this._remainingNodeInfos.push({ ancestor:profileNode, focusNode:profileNode, totalTimeAccountedFor:totalTimeAccountedFor });
- }
-
- var children = profileNode.children;
- if (children.length) {
- profileNodeGroups.push(parentProfileNodes.concat([profileNode]));
- profileNodeGroups.push(children);
- }
- }
- }
-
- // Populate the top level nodes.
- WebInspector.BottomUpProfileDataGridNode.prototype._populate.call(this);
-
- return this;
-}
-
-WebInspector.BottomUpProfileDataGridTree.prototype = {
- // When focusing, we keep the entire callstack up to this ancestor.
- focus: function(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this._save();
-
- var currentNode = profileDataGridNode;
- var focusNode = profileDataGridNode;
-
- while (currentNode.parent && (currentNode instanceof WebInspector.ProfileDataGridNode)) {
- currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode);
-
- focusNode = currentNode;
- currentNode = currentNode.parent;
-
- if (currentNode instanceof WebInspector.ProfileDataGridNode)
- currentNode._keepOnlyChild(focusNode);
- }
-
- this.children = [focusNode];
- this.totalTime = profileDataGridNode.totalTime;
- },
-
- exclude: function(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this._save();
-
- var excludedCallUID = profileDataGridNode.callUID;
- var excludedTopLevelChild = this.childrenByCallUID[excludedCallUID];
-
- // If we have a top level node that is excluded, get rid of it completely (not keeping children),
- // since bottom up data relies entirely on the root node.
- if (excludedTopLevelChild)
- this.children.remove(excludedTopLevelChild);
-
- var children = this.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- children[index]._exclude(excludedCallUID);
-
- if (this.lastComparator)
- this.sort(this.lastComparator, true);
- },
-
- _sharedPopulate: WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate
-}
-
-WebInspector.BottomUpProfileDataGridTree.prototype.__proto__ = WebInspector.ProfileDataGridTree.prototype;
-
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCanvasDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CanvasDataGridNode.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CanvasDataGridNode.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/CanvasDataGridNode.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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. ``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
- * 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.CanvasDataGridNode = function(profileView, data)
-{
- WebInspector.DataGridNode.call(this, data, false);
- this._profileView = profileView;
-}
-
-WebInspector.CanvasDataGridNode.prototype = {
-
- constructor: WebInspector.CanvasDataGridNode,
-
- get data()
- {
- var data = {};
- return data;
- },
-
- get rawData()
- {
- return this._data;
- },
-
- createCell: function(columnIdentifier)
- {
- var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
- cell.removeChildren();
-
- if (this.rawData.url) {
- var wrapperDiv = cell.createChild("div");
- wrapperDiv.appendChild(this._linkifyLocation(this.rawData.url, this.rawData.lineNumber, this.rawData.columnNumber));
- }
-
- return cell;
- },
-
- _linkifyLocation: function(url, lineNumber, columnNumber)
- {
- return WebInspector.linkifyLocation(url, lineNumber, columnNumber || 0);
- }
-}
-
-WebInspector.CanvasDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
-
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCanvasObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CanvasObserver.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CanvasObserver.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/CanvasObserver.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.CanvasObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.CanvasObserver.prototype = {
- constructor: WebInspector.CanvasObserver,
-
- // Events defined by the "Canvas" domain.
-
- contextCreated: function(frameId)
- {
- // FIXME: Implement this.
- },
-
- traceLogsRemoved: function(frameId, traceLogId)
- {
- // FIXME: Implement this.
- }
-};
-
-WebInspector.CanvasObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCanvasProfileObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CanvasProfileObject.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CanvasProfileObject.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/CanvasProfileObject.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.CanvasProfileObject = function(title, id, recording, data)
-{
- WebInspector.ProfileObject.call(this, WebInspector.CanvasProfileType.TypeId, title, id, recording);
-
- this._data = data || [];
-};
-
-WebInspector.CanvasProfileObject.prototype = {
- constructor: WebInspector.CanvasProfileObject,
-
- get data()
- {
- return this._data;
- },
-
- set data(data)
- {
- this._data = data;
- }
-};
-
-WebInspector.CanvasProfileObject.prototype.__proto__ = WebInspector.ProfileObject.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCanvasProfileTypejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CanvasProfileType.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CanvasProfileType.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/CanvasProfileType.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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. ``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
- * 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.CanvasProfileType = function()
-{
- WebInspector.ProfileType.call(this, WebInspector.CanvasProfileType.TypeId, WebInspector.UIString("Collect Canvas Profile"));
- this._recording = false;
- this._profileId = 1;
- WebInspector.CanvasProfileType.instance = this;
-}
-
-WebInspector.CanvasProfileType.TypeId = "CANVAS";
-
-WebInspector.CanvasProfileType.prototype = {
-
- constructor: WebInspector.CanvasProfileType,
-
- get buttonTooltip()
- {
- return this._recording ? WebInspector.UIString("Stop Canvas profiling.") : WebInspector.UIString("Start Canvas profiling.");
- },
-
- buttonClicked: function()
- {
- if (this._recording)
- this.stopRecordingProfile();
- else
- this.startRecordingProfile();
- },
-
- get treeItemTitle()
- {
- return WebInspector.UIString("CANVAS PROFILES");
- },
-
- get description()
- {
- return WebInspector.UIString("Canvas profiles allow you to examine drawing operations on canvas elements.");
- },
-
- reset: function()
- {
- this._profileId = 1;
- },
-
- nextProfileId: function()
- {
- return this._profileId++;
- },
-
- isRecordingProfile: function()
- {
- return this._recording;
- },
-
- setRecordingProfile: function(isProfiling)
- {
- this._recording = isProfiling;
- },
-
- startRecordingProfile: function()
- {
- this._recording = true;
- // FIXME: This is where we would ask the Canvas Agent to profile.
- },
-
- stopRecordingProfile: function(callback)
- {
- this._recording = false;
- // FIXME: This is where we would ask the Canvas Agent to stop profiling.
- // For now pass in an empty array of canvas calls.
- callback(null, {data: []});
- },
-
- createSidebarTreeElementForProfile: function(profile)
- {
- return new WebInspector.ProfileSidebarTreeElement(profile, profile.title, "profile-sidebar-tree-item");
- },
-
- createView: function(profile)
- {
- return new WebInspector.CanvasProfileView(profile);
- }
-}
-
-WebInspector.CanvasProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCanvasProfileViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CanvasProfileView.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CanvasProfileView.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/CanvasProfileView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,100 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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. ``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
- * 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.CanvasProfileView = function(profile)
-{
- console.assert(profile instanceof WebInspector.CanvasProfileObject);
-
- WebInspector.ProfileView.call(this, profile);
-}
-
-WebInspector.CanvasProfileView.prototype = {
-
- constructor: WebInspector.CanvasProfileView,
-
- updateLayout: function()
- {
- if (this.dataGrid)
- this.dataGrid.updateLayout();
- },
-
- get recordingTitle()
- {
- return WebInspector.UIString("Recording Canvas Profile…");
- },
-
- displayProfile: function()
- {
- var columns = {"number": {title: "#", width: "5%", sortable: false},
- "source": {title: WebInspector.UIString("Call"), width: "75%", sortable: false, disclosure: true},
- "location": {title: WebInspector.UIString("Location"), width: "20%", sortable: false}};
-
- this.dataGrid = new WebInspector.DataGrid(columns);
- this.dataGrid.element.classList.add("canvas-profile-view");
-
- this.element.appendChild(this.dataGrid.element);
- this.dataGrid.updateLayout();
-
- this._createProfileNodes();
- },
-
- _createProfileNodes: function()
- {
- var data = this.profile.data;
- if (!data) {
- // The profiler may have been terminated with the "Clear all profiles." button.
- return;
- }
-
- this.profile.children = [];
- for (var i = 0; i < data.length; ++i) {
- var node = new WebInspector.CanvasDataGridNode(this, data[i]);
- this.profile.children.push(node);
- }
- },
-
- rebuildGridItems: function()
- {
- this.dataGrid.removeChildren();
-
- var children = this.profile.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- this.dataGrid.appendChild(children[index]);
- },
-
- refreshData: function()
- {
- var child = this.dataGrid.children[0];
- while (child) {
- child.refresh();
- child = child.traverseNextNode(false, null, true);
- }
- }
-
-}
-
-WebInspector.CanvasProfileView.prototype.__proto__ = WebInspector.ProfileView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleObserverjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx">
</span><span class="cx"> if (message.url === "[native code]") {
</span><span class="cx"> if (message.type === "profile")
</span><del>- WebInspector.profileManager.profileWasStartedFromConsole(message.text);
</del><ins>+ WebInspector.legacyProfileManager.profileWasStartedFromConsole(message.text);
</ins><span class="cx"> else if (message.type === "profileEnd")
</span><del>- WebInspector.profileManager.profileWasEndedFromConsole();
</del><ins>+ WebInspector.legacyProfileManager.profileWasEndedFromConsole();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (message.source === "console-api" && message.type === "clear")
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/ContentView.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentView.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -63,12 +63,9 @@
</span><span class="cx"> if (representedObject instanceof WebInspector.LogObject)
</span><span class="cx"> return new WebInspector.LogContentView(representedObject);
</span><span class="cx">
</span><del>- if (representedObject instanceof WebInspector.JavaScriptProfileObject)
- return new WebInspector.JavaScriptProfileView(representedObject);
</del><ins>+ if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
+ return new WebInspector.LegacyJavaScriptProfileView(representedObject);
</ins><span class="cx">
</span><del>- if (representedObject instanceof WebInspector.CanvasProfileObject)
- return new WebInspector.CanvasProfileView(representedObject);
-
</del><span class="cx"> if (representedObject instanceof WebInspector.ContentFlow)
</span><span class="cx"> return new WebInspector.ContentFlowDOMTreeContentView(representedObject);
</span><span class="cx">
</span><span class="lines">@@ -120,10 +117,8 @@
</span><span class="cx"> return true;
</span><span class="cx"> if (representedObject instanceof WebInspector.LogObject)
</span><span class="cx"> return true;
</span><del>- if (representedObject instanceof WebInspector.JavaScriptProfileObject)
</del><ins>+ if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
</ins><span class="cx"> return true;
</span><del>- if (representedObject instanceof WebInspector.CanvasProfileObject)
- return true;
</del><span class="cx"> if (representedObject instanceof WebInspector.ContentFlow)
</span><span class="cx"> return true;
</span><span class="cx"> if (typeof representedObject === "string" || representedObject instanceof String)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorFrontendAPIjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -66,18 +66,18 @@
</span><span class="cx">
</span><span class="cx"> isProfilingJavaScript: function()
</span><span class="cx"> {
</span><del>- return WebInspector.profileManager.isProfilingJavaScript();
</del><ins>+ return WebInspector.legacyProfileManager.isProfilingJavaScript();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> startProfilingJavaScript: function()
</span><span class="cx"> {
</span><del>- WebInspector.profileManager.startProfilingJavaScript();
</del><ins>+ WebInspector.legacyProfileManager.startProfilingJavaScript();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> stopProfilingJavaScript: function()
</span><span class="cx"> {
</span><span class="cx"> WebInspector.timelineSidebarPanel.show();
</span><del>- WebInspector.profileManager.stopProfilingJavaScript();
</del><ins>+ WebInspector.legacyProfileManager.stopProfilingJavaScript();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> setDockSide: function(side)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.JavaScriptProfileObject = function(title, id, recording)
-{
- WebInspector.ProfileObject.call(this, WebInspector.JavaScriptProfileType.TypeId, title, id, recording);
-};
-
-WebInspector.JavaScriptProfileObject.prototype = {
- constructor: WebInspector.JavaScriptProfileObject
-};
-
-WebInspector.JavaScriptProfileObject.prototype.__proto__ = WebInspector.ProfileObject.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileTypejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 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. ``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
- * 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.JavaScriptProfileType = function()
-{
- WebInspector.ProfileType.call(this, WebInspector.JavaScriptProfileType.TypeId, WebInspector.UIString("Collect JavaScript Profile"));
- this._recording = false;
- WebInspector.JavaScriptProfileType.instance = this;
-}
-
-WebInspector.JavaScriptProfileType.TypeId = "CPU";
-
-WebInspector.JavaScriptProfileType.prototype = {
- get buttonTooltip()
- {
- return this._recording ? WebInspector.UIString("Stop JavaScript profiling.") : WebInspector.UIString("Start JavaScript profiling.");
- },
-
- buttonClicked: function()
- {
- if (this._recording) {
- this.stopRecordingProfile();
- WebInspector.networkManager.enableResourceTracking();
- } else {
- WebInspector.networkManager.disableResourceTracking();
- this.startRecordingProfile();
- }
- },
-
- get treeItemTitle()
- {
- return WebInspector.UIString("JAVASCRIPT PROFILES");
- },
-
- get description()
- {
- return WebInspector.UIString("JavaScript profiles show where the execution time is spent in your page's JavaScript functions.");
- },
-
- isRecordingProfile: function()
- {
- return this._recording;
- },
-
- startRecordingProfile: function()
- {
- this._recording = true;
- ProfilerAgent.start();
- },
-
- stopRecordingProfile: function()
- {
- this._recording = false;
- ProfilerAgent.stop();
- },
-
- setRecordingProfile: function(isProfiling)
- {
- this._recording = isProfiling;
- },
-
- createSidebarTreeElementForProfile: function(profile)
- {
- return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
- },
-
- createView: function(profile)
- {
- return new WebInspector.JavaScriptProfileView(profile);
- }
-}
-
-WebInspector.JavaScriptProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.
- */
-
-.content-view.profile-view > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- outline: none;
- border: none;
-}
-
-.profile-view .data-grid th.average-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.average-column {
- text-align: right;
-}
-
-.profile-view .data-grid th.self-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.self-column {
- text-align: right;
-}
-
-.profile-view .data-grid th.total-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.total-column {
- text-align: right;
-}
-
-.profile-view .data-grid .calls-column {
- text-align: center;
-}
-
-.profile-node-file {
- float: right;
- color: gray;
- margin-top: -1px;
-}
-
-.data-grid tr.selected .profile-node-file {
- color: rgb(33%, 33%, 33%);
-}
-
-.data-grid:focus tr.selected .profile-node-file {
- color: white;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,468 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 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. ``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
- * 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.JavaScriptProfileView = function(profile)
-{
- console.assert(profile instanceof WebInspector.JavaScriptProfileObject);
-
- WebInspector.ProfileView.call(this, profile, "javascript-profiler-show-time-as-percent");
-
- this._showTreeBottomUpSetting = new WebInspector.Setting("javascript-profiler-show-tree-bottom-up", true);
-
- this._showTreeBottomUpNavigationItem = new WebInspector.ActivateButtonNavigationItem("show-tree-bottom-up-navigation-item", WebInspector.UIString("Invert call tree"), WebInspector.UIString("Normal call tree"), "Images/BottomUpTree.svg", 16, 16);
- this._showTreeBottomUpNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleBottomUpView, this);
- this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
-
- this._viewType = new WebInspector.Setting("javascript-profiler-view", WebInspector.JavaScriptProfileView._TypeHeavy);
-}
-
-WebInspector.JavaScriptProfileView._TypeTree = "Tree";
-WebInspector.JavaScriptProfileView._TypeHeavy = "Heavy";
-
-WebInspector.JavaScriptProfileView.prototype = {
- constructor: WebInspector.JavaScriptProfileView,
-
- updateLayout: function()
- {
- if (this.dataGrid)
- this.dataGrid.updateLayout();
- },
-
- get recordingTitle()
- {
- return WebInspector.UIString("Recording JavaScript Profile\u2026");
- },
-
- displayProfile: function()
- {
- var columns = { "self": { title: WebInspector.UIString("Self"), width: "72px", sort: "descending", sortable: true },
- "total": { title: WebInspector.UIString("Total"), width: "72px", sortable: true },
- "average": { title: WebInspector.UIString("Average"), width: "72px", sortable: true },
- "calls": { title: WebInspector.UIString("Calls"), width: "54px", sortable: true },
- "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } };
-
- this.dataGrid = new WebInspector.DataGrid(columns);
- this.dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortData, this);
-
- this.element.appendChild(this.dataGrid.element);
- this.dataGrid.updateLayout();
-
- function profileCallback(error, profile)
- {
- if (error)
- return;
-
- if (!profile.head) {
- // Profiling was tentatively terminated with the "Clear all profiles." button.
- return;
- }
- this.profile.head = profile.head;
- this._assignParentsInProfile();
- this._changeView();
- }
-
- // COMPATIBILITY (iOS 6): getCPUProfile use to be called getProfile.
- if (ProfilerAgent.getProfile)
- ProfilerAgent.getProfile(this.profile.type, this.profile.id, profileCallback.bind(this));
- else
- ProfilerAgent.getCPUProfile(this.profile.id, profileCallback.bind(this));
- },
-
- get navigationItems()
- {
- return [this._showTreeBottomUpNavigationItem, this.showTimeAsPercentNavigationItem];
- },
-
- get bottomUpProfileDataGridTree()
- {
- if (!this._bottomUpProfileDataGridTree)
- this._bottomUpProfileDataGridTree = new WebInspector.BottomUpProfileDataGridTree(this, this.profile.head);
- return this._bottomUpProfileDataGridTree;
- },
-
- get topDownProfileDataGridTree()
- {
- if (!this._topDownProfileDataGridTree)
- this._topDownProfileDataGridTree = new WebInspector.TopDownProfileDataGridTree(this, this.profile.head);
- return this._topDownProfileDataGridTree;
- },
-
- willHide: function()
- {
- this._currentSearchResultIndex = -1;
- },
-
- refresh: function()
- {
- var selectedProfileNode = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.profileNode : null;
-
- this.dataGrid.removeChildren();
-
- var children = this.profileDataGridTree.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- this.dataGrid.appendChild(children[index]);
-
- if (selectedProfileNode)
- selectedProfileNode.selected = true;
- },
-
- refreshVisibleData: function()
- {
- var child = this.dataGrid.children[0];
- while (child) {
- child.refresh();
- child = child.traverseNextNode(false, null, true);
- }
- },
-
- searchCanceled: function()
- {
- if (this._searchResults) {
- for (var i = 0; i < this._searchResults.length; ++i) {
- var profileNode = this._searchResults[i].profileNode;
-
- delete profileNode._searchMatchedSelfColumn;
- delete profileNode._searchMatchedTotalColumn;
- delete profileNode._searchMatchedCallsColumn;
- delete profileNode._searchMatchedFunctionColumn;
-
- profileNode.refresh();
- }
- }
-
- delete this._searchFinishedCallback;
- this._currentSearchResultIndex = -1;
- this._searchResults = [];
- },
-
- performSearch: function(query, finishedCallback)
- {
- // Call searchCanceled since it will reset everything we need before doing a new search.
- this.searchCanceled();
-
- query = query.trim();
-
- if (!query.length)
- return;
-
- this._searchFinishedCallback = finishedCallback;
-
- var greaterThan = query.charAt(0) === ">";
- var lessThan = query.charAt(0) === "<";
- var equalTo = (query.charAt(0) === "=" || ((greaterThan || lessThan) && query.charAt(1) === "="));
- var percentUnits = (query.lastIndexOf("%") === (query.length - 1));
- var millisecondsUnits = (query.length > 2 && query.lastIndexOf("ms") === (query.length - 2));
- var secondsUnits = (!millisecondsUnits && query.lastIndexOf("s") === (query.length - 1));
-
- var queryNumber = parseFloat(query);
- if (greaterThan || lessThan || equalTo) {
- if (equalTo && (greaterThan || lessThan))
- queryNumber = parseFloat(query.substring(2));
- else
- queryNumber = parseFloat(query.substring(1));
- }
-
- var queryNumberMilliseconds = (secondsUnits ? (queryNumber * 1000) : queryNumber);
-
- // Make equalTo implicitly true if it wasn't specified there is no other operator.
- if (!isNaN(queryNumber) && !(greaterThan || lessThan))
- equalTo = true;
-
- function matchesQuery(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- delete profileDataGridNode._searchMatchedSelfColumn;
- delete profileDataGridNode._searchMatchedTotalColumn;
- delete profileDataGridNode._searchMatchedAverageColumn;
- delete profileDataGridNode._searchMatchedCallsColumn;
- delete profileDataGridNode._searchMatchedFunctionColumn;
-
- if (percentUnits) {
- if (lessThan) {
- if (profileDataGridNode.selfPercent < queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent < queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- } else if (greaterThan) {
- if (profileDataGridNode.selfPercent > queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent > queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
-
- if (equalTo) {
- if (profileDataGridNode.selfPercent == queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent == queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
- } else if (millisecondsUnits || secondsUnits) {
- if (lessThan) {
- if (profileDataGridNode.selfTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- } else if (greaterThan) {
- if (profileDataGridNode.selfTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
-
- if (equalTo) {
- if (profileDataGridNode.selfTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
- } else {
- if (equalTo && profileDataGridNode.numberOfCalls == queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- if (greaterThan && profileDataGridNode.numberOfCalls > queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- if (lessThan && profileDataGridNode.numberOfCalls < queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- }
-
- if (profileDataGridNode.functionName.hasSubstring(query, true) || profileDataGridNode.url.hasSubstring(query, true))
- profileDataGridNode._searchMatchedFunctionColumn = true;
-
- if (profileDataGridNode._searchMatchedSelfColumn ||
- profileDataGridNode._searchMatchedTotalColumn ||
- profileDataGridNode._searchMatchedAverageColumn ||
- profileDataGridNode._searchMatchedCallsColumn ||
- profileDataGridNode._searchMatchedFunctionColumn)
- {
- profileDataGridNode.refresh();
- return true;
- }
-
- return false;
- }
-
- var current = this.profileDataGridTree.children[0];
-
- while (current) {
- if (matchesQuery(current)) {
- this._searchResults.push({ profileNode: current });
- }
-
- current = current.traverseNextNode(false, null, false);
- }
-
- finishedCallback(this, this._searchResults.length);
- },
-
- jumpToFirstSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- this._currentSearchResultIndex = 0;
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToLastSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- this._currentSearchResultIndex = (this._searchResults.length - 1);
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToNextSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- if (++this._currentSearchResultIndex >= this._searchResults.length)
- this._currentSearchResultIndex = 0;
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToPreviousSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- if (--this._currentSearchResultIndex < 0)
- this._currentSearchResultIndex = (this._searchResults.length - 1);
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- showingFirstSearchResult: function()
- {
- return (this._currentSearchResultIndex === 0);
- },
-
- showingLastSearchResult: function()
- {
- return (this._searchResults && this._currentSearchResultIndex === (this._searchResults.length - 1));
- },
-
- _jumpToSearchResult: function(index)
- {
- var searchResult = this._searchResults[index];
- if (!searchResult)
- return;
-
- var profileNode = searchResult.profileNode;
- profileNode.revealAndSelect();
- },
-
- _toggleBottomUpView: function(event)
- {
- this._showTreeBottomUpSetting.value = !this._showTreeBottomUpSetting.value;
- this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
- this._changeView();
- },
-
- _changeView: function()
- {
- if (!this.profile)
- return;
-
- if (!this._showTreeBottomUpSetting.value) {
- this.profileDataGridTree = this.topDownProfileDataGridTree;
- this._sortProfile();
- this._viewType.value = WebInspector.JavaScriptProfileView._TypeTree;
- } else {
- this.profileDataGridTree = this.bottomUpProfileDataGridTree;
- this._sortProfile();
- this._viewType.value = WebInspector.JavaScriptProfileView._TypeHeavy;
- }
-
- if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
- return;
-
- // The current search needs to be performed again. First negate out previous match
- // count by calling the search finished callback with a negative number of matches.
- // Then perform the search again the with same query and callback.
- this._searchFinishedCallback(this, -this._searchResults.length);
- this.performSearch(this.currentQuery, this._searchFinishedCallback);
- },
-
- toggleTimeDisplay: function(event)
- {
- WebInspector.ProfileView.prototype.toggleTimeDisplay.call(this, event);
- this.showTimeAsPercent.value = !this.showTimeAsPercent.value;
- this.refreshVisibleData();
- },
-
- _focusClicked: function(event)
- {
- if (!this.dataGrid.selectedNode)
- return;
-
- this.profileDataGridTree.focus(this.dataGrid.selectedNode);
- this.refresh();
- this.refreshVisibleData();
- },
-
- _excludeClicked: function(event)
- {
- var selectedNode = this.dataGrid.selectedNode;
-
- if (!selectedNode)
- return;
-
- selectedNode.deselect();
-
- this.profileDataGridTree.exclude(selectedNode);
- this.refresh();
- this.refreshVisibleData();
- },
-
- _resetClicked: function(event)
- {
- this.profileDataGridTree.restore();
- this.refresh();
- this.refreshVisibleData();
- },
-
- _dataGridNodeSelected: function(node)
- {
- // FIXME: Update UI we have to focus on a data grid node or exclude it from the profile.
- },
-
- _dataGridNodeDeselected: function(node)
- {
- // FIXME: Update UI we have to focus on a data grid node or exclude it from the profile.
- },
-
- _sortData: function(event)
- {
- this._sortProfile(this.profile);
- },
-
- _sortProfile: function()
- {
- var sortAscending = this.dataGrid.sortOrder === "ascending";
- var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
- var sortProperty = {
- "average": "averageTime",
- "self": "selfTime",
- "total": "totalTime",
- "calls": "numberOfCalls",
- "function": "functionName"
- }[sortColumnIdentifier];
-
- this.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyComparator(sortProperty, sortAscending));
-
- this.refresh();
- },
-
- _assignParentsInProfile: function()
- {
- var head = this.profile.head;
- head.parent = null;
- head.head = null;
- var nodesToTraverse = [ { parent: head, children: head.children } ];
- while (nodesToTraverse.length > 0) {
- var pair = nodesToTraverse.shift();
- var parent = pair.parent;
- var children = pair.children;
- var length = children.length;
- for (var i = 0; i < length; ++i) {
- children[i].head = head;
- children[i].parent = parent;
- if (children[i].children.length > 0)
- nodesToTraverse.push({ parent: children[i], children: children[i].children });
- }
- }
- }
-}
-
-WebInspector.JavaScriptProfileView.prototype.__proto__ = WebInspector.ProfileView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyBottomUpProfileDataGridTreejsfromrev163137trunkSourceWebInspectorUIUserInterfaceBottomUpProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/BottomUpProfileDataGridTree.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,265 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North Inc. All Rights Reserved.
+ * Copyright (C) 2013 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. ``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
+ * 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.
+ */
+
+// Bottom Up Profiling shows the entire callstack backwards:
+// The root node is a representation of each individual function called, and each child of that node represents
+// a reverse-callstack showing how many of those calls came from it. So, unlike top-down, the statistics in
+// each child still represent the root node. We have to be particularly careful of recursion with this mode
+// because a root node can represent itself AND an ancestor.
+
+WebInspector.LegacyBottomUpProfileDataGridNode = function(profileNode, owningTree)
+{
+ WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, this._willHaveChildren(profileNode));
+
+ this._remainingNodeInfos = [];
+}
+
+WebInspector.LegacyBottomUpProfileDataGridNode.prototype = {
+ _takePropertiesFromProfileDataGridNode: function(profileDataGridNode)
+ {
+ this._save();
+
+ this.selfTime = profileDataGridNode.selfTime;
+ this.totalTime = profileDataGridNode.totalTime;
+ this.numberOfCalls = profileDataGridNode.numberOfCalls;
+ },
+
+ // When focusing, we keep just the members of the callstack.
+ _keepOnlyChild: function(child)
+ {
+ this._save();
+
+ this.removeChildren();
+ this.appendChild(child);
+ },
+
+ _exclude: function(aCallUID)
+ {
+ if (this._remainingNodeInfos)
+ this._populate();
+
+ this._save();
+
+ var children = this.children;
+ var index = this.children.length;
+
+ while (index--)
+ children[index]._exclude(aCallUID);
+
+ var child = this.childrenByCallUID[aCallUID];
+
+ if (child)
+ this._merge(child, true);
+ },
+
+ _restore: function()
+ {
+ WebInspector.LegacyProfileDataGridNode.prototype._restore();
+
+ if (!this.children.length)
+ this.hasChildren = this._willHaveChildren();
+ },
+
+ _merge: function(child, shouldAbsorb)
+ {
+ this.selfTime -= child.selfTime;
+
+ WebInspector.LegacyProfileDataGridNode.prototype._merge.call(this, child, shouldAbsorb);
+ },
+
+ _sharedPopulate: function()
+ {
+ var remainingNodeInfos = this._remainingNodeInfos;
+ var count = remainingNodeInfos.length;
+
+ for (var index = 0; index < count; ++index) {
+ var nodeInfo = remainingNodeInfos[index];
+ var ancestor = nodeInfo.ancestor;
+ var focusNode = nodeInfo.focusNode;
+ var child = this.findChild(ancestor);
+
+ // If we already have this child, then merge the data together.
+ if (child) {
+ var totalTimeAccountedFor = nodeInfo.totalTimeAccountedFor;
+
+ child.selfTime += focusNode.selfTime;
+ child.numberOfCalls += focusNode.numberOfCalls;
+
+ if (!totalTimeAccountedFor)
+ child.totalTime += focusNode.totalTime;
+ } else {
+ // If not, add it as a true ancestor.
+ // In heavy mode, we take our visual identity from ancestor node...
+ child = new WebInspector.LegacyBottomUpProfileDataGridNode(ancestor, this.tree, false, this.showTimeAsPercent);
+
+ if (ancestor !== focusNode) {
+ // but the actual statistics from the "root" node (bottom of the callstack).
+ child.selfTime = focusNode.selfTime;
+ child.totalTime = focusNode.totalTime;
+ child.numberOfCalls = focusNode.numberOfCalls;
+ }
+
+ this.appendChild(child);
+ }
+
+ var parent = ancestor.parent;
+ if (parent && parent.parent) {
+ nodeInfo.ancestor = parent;
+ child._remainingNodeInfos.push(nodeInfo);
+ }
+ }
+
+ delete this._remainingNodeInfos;
+ },
+
+ _willHaveChildren: function(profileNode)
+ {
+ profileNode = profileNode || this.profileNode;
+ // In bottom up mode, our parents are our children since we display an inverted tree.
+ // However, we don't want to show the very top parent since it is redundant.
+ return !!(profileNode.parent && profileNode.parent.parent);
+ }
+}
+
+WebInspector.LegacyBottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
+
+WebInspector.LegacyBottomUpProfileDataGridTree = function(profileNode)
+{
+ WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
+
+ // Iterate each node in pre-order.
+ var profileNodeUIDs = 0;
+ var profileNodeGroups = [[], [profileNode]];
+ var visitedProfileNodesForCallUID = {};
+
+ this._remainingNodeInfos = [];
+
+ for (var profileNodeGroupIndex = 0; profileNodeGroupIndex < profileNodeGroups.length; ++profileNodeGroupIndex) {
+ var parentProfileNodes = profileNodeGroups[profileNodeGroupIndex];
+ var profileNodes = profileNodeGroups[++profileNodeGroupIndex];
+ var count = profileNodes.length;
+
+ for (var index = 0; index < count; ++index) {
+ var profileNode = profileNodes[index];
+
+ if (!profileNode.UID)
+ profileNode.UID = ++profileNodeUIDs;
+
+ if (profileNode.head && profileNode !== profileNode.head) {
+ // The total time of this ancestor is accounted for if we're in any form of recursive cycle.
+ var visitedNodes = visitedProfileNodesForCallUID[profileNode.callUID];
+ var totalTimeAccountedFor = false;
+
+ if (!visitedNodes) {
+ visitedNodes = {};
+ visitedProfileNodesForCallUID[profileNode.callUID] = visitedNodes;
+ } else {
+ // The total time for this node has already been accounted for iff one of it's parents has already been visited.
+ // We can do this check in this style because we are traversing the tree in pre-order.
+ var parentCount = parentProfileNodes.length;
+ for (var parentIndex = 0; parentIndex < parentCount; ++parentIndex) {
+ if (visitedNodes[parentProfileNodes[parentIndex].UID]) {
+ totalTimeAccountedFor = true;
+ break;
+ }
+ }
+ }
+
+ visitedNodes[profileNode.UID] = true;
+
+ this._remainingNodeInfos.push({ ancestor:profileNode, focusNode:profileNode, totalTimeAccountedFor:totalTimeAccountedFor });
+ }
+
+ var children = profileNode.children;
+ if (children.length) {
+ profileNodeGroups.push(parentProfileNodes.concat([profileNode]));
+ profileNodeGroups.push(children);
+ }
+ }
+ }
+
+ // Populate the top level nodes.
+ WebInspector.LegacyBottomUpProfileDataGridNode.prototype._populate.call(this);
+
+ return this;
+}
+
+WebInspector.LegacyBottomUpProfileDataGridTree.prototype = {
+ // When focusing, we keep the entire callstack up to this ancestor.
+ focus: function(profileDataGridNode)
+ {
+ if (!profileDataGridNode)
+ return;
+
+ this._save();
+
+ var currentNode = profileDataGridNode;
+ var focusNode = profileDataGridNode;
+
+ while (currentNode.parent && (currentNode instanceof WebInspector.LegacyProfileDataGridNode)) {
+ currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode);
+
+ focusNode = currentNode;
+ currentNode = currentNode.parent;
+
+ if (currentNode instanceof WebInspector.LegacyProfileDataGridNode)
+ currentNode._keepOnlyChild(focusNode);
+ }
+
+ this.children = [focusNode];
+ this.totalTime = profileDataGridNode.totalTime;
+ },
+
+ exclude: function(profileDataGridNode)
+ {
+ if (!profileDataGridNode)
+ return;
+
+ this._save();
+
+ var excludedCallUID = profileDataGridNode.callUID;
+ var excludedTopLevelChild = this.childrenByCallUID[excludedCallUID];
+
+ // If we have a top level node that is excluded, get rid of it completely (not keeping children),
+ // since bottom up data relies entirely on the root node.
+ if (excludedTopLevelChild)
+ this.children.remove(excludedTopLevelChild);
+
+ var children = this.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ children[index]._exclude(excludedCallUID);
+
+ if (this.lastComparator)
+ this.sort(this.lastComparator, true);
+ },
+
+ _sharedPopulate: WebInspector.LegacyBottomUpProfileDataGridNode.prototype._sharedPopulate
+}
+
+WebInspector.LegacyBottomUpProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
+
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileObjectjsfromrev163137trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileObject.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.LegacyJavaScriptProfileObject = function(title, id, recording)
+{
+ WebInspector.LegacyProfileObject.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, title, id, recording);
+};
+
+WebInspector.LegacyJavaScriptProfileObject.prototype = {
+ constructor: WebInspector.LegacyJavaScriptProfileObject
+};
+
+WebInspector.LegacyJavaScriptProfileObject.prototype.__proto__ = WebInspector.LegacyProfileObject.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileTypejsfromrev163137trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileTypejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileType.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 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. ``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
+ * 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.LegacyJavaScriptProfileType = function()
+{
+ WebInspector.LegacyProfileType.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, WebInspector.UIString("Collect JavaScript Profile"));
+ this._recording = false;
+ WebInspector.LegacyJavaScriptProfileType.instance = this;
+}
+
+WebInspector.LegacyJavaScriptProfileType.TypeId = "CPU";
+
+WebInspector.LegacyJavaScriptProfileType.prototype = {
+ get buttonTooltip()
+ {
+ return this._recording ? WebInspector.UIString("Stop JavaScript profiling.") : WebInspector.UIString("Start JavaScript profiling.");
+ },
+
+ buttonClicked: function()
+ {
+ if (this._recording) {
+ this.stopRecordingProfile();
+ WebInspector.networkManager.enableResourceTracking();
+ } else {
+ WebInspector.networkManager.disableResourceTracking();
+ this.startRecordingProfile();
+ }
+ },
+
+ get treeItemTitle()
+ {
+ return WebInspector.UIString("JAVASCRIPT PROFILES");
+ },
+
+ get description()
+ {
+ return WebInspector.UIString("JavaScript profiles show where the execution time is spent in your page's JavaScript functions.");
+ },
+
+ isRecordingProfile: function()
+ {
+ return this._recording;
+ },
+
+ startRecordingProfile: function()
+ {
+ this._recording = true;
+ ProfilerAgent.start();
+ },
+
+ stopRecordingProfile: function()
+ {
+ this._recording = false;
+ ProfilerAgent.stop();
+ },
+
+ setRecordingProfile: function(isProfiling)
+ {
+ this._recording = isProfiling;
+ },
+
+ createSidebarTreeElementForProfile: function(profile)
+ {
+ return new WebInspector.LegacyProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
+ },
+
+ createView: function(profile)
+ {
+ return new WebInspector.LegacyJavaScriptProfileView(profile);
+ }
+}
+
+WebInspector.LegacyJavaScriptProfileType.prototype.__proto__ = WebInspector.LegacyProfileType.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewcssfromrev163137trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.css) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+.content-view.profile-view > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ outline: none;
+ border: none;
+}
+
+.profile-view .data-grid th.average-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.average-column {
+ text-align: right;
+}
+
+.profile-view .data-grid th.self-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.self-column {
+ text-align: right;
+}
+
+.profile-view .data-grid th.total-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.total-column {
+ text-align: right;
+}
+
+.profile-view .data-grid .calls-column {
+ text-align: center;
+}
+
+.profile-node-file {
+ float: right;
+ color: gray;
+ margin-top: -1px;
+}
+
+.data-grid tr.selected .profile-node-file {
+ color: rgb(33%, 33%, 33%);
+}
+
+.data-grid:focus tr.selected .profile-node-file {
+ color: white;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewjsfromrev163137trunkSourceWebInspectorUIUserInterfaceJavaScriptProfileViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/JavaScriptProfileView.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,458 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 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. ``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
+ * 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.LegacyJavaScriptProfileView = function(profile)
+{
+ console.assert(profile instanceof WebInspector.LegacyJavaScriptProfileObject);
+
+ WebInspector.LegacyProfileView.call(this, profile, "javascript-profiler-show-time-as-percent");
+
+ this._showTreeBottomUpSetting = new WebInspector.Setting("javascript-profiler-show-tree-bottom-up", true);
+
+ this._showTreeBottomUpNavigationItem = new WebInspector.ActivateButtonNavigationItem("show-tree-bottom-up-navigation-item", WebInspector.UIString("Invert call tree"), WebInspector.UIString("Normal call tree"), "Images/BottomUpTree.svg", 16, 16);
+ this._showTreeBottomUpNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleBottomUpView, this);
+ this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
+
+ this._viewType = new WebInspector.Setting("javascript-profiler-view", WebInspector.LegacyJavaScriptProfileView._TypeHeavy);
+}
+
+WebInspector.LegacyJavaScriptProfileView._TypeTree = "Tree";
+WebInspector.LegacyJavaScriptProfileView._TypeHeavy = "Heavy";
+
+WebInspector.LegacyJavaScriptProfileView.prototype = {
+ constructor: WebInspector.LegacyJavaScriptProfileView,
+
+ updateLayout: function()
+ {
+ if (this.dataGrid)
+ this.dataGrid.updateLayout();
+ },
+
+ get recordingTitle()
+ {
+ return WebInspector.UIString("Recording JavaScript Profile\u2026");
+ },
+
+ displayProfile: function()
+ {
+ var columns = { "self": { title: WebInspector.UIString("Self"), width: "72px", sort: "descending", sortable: true },
+ "total": { title: WebInspector.UIString("Total"), width: "72px", sortable: true },
+ "average": { title: WebInspector.UIString("Average"), width: "72px", sortable: true },
+ "calls": { title: WebInspector.UIString("Calls"), width: "54px", sortable: true },
+ "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } };
+
+ this.dataGrid = new WebInspector.DataGrid(columns);
+ this.dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortData, this);
+
+ this.element.appendChild(this.dataGrid.element);
+ this.dataGrid.updateLayout();
+
+ function profileCallback(error, profile)
+ {
+ if (error)
+ return;
+
+ if (!profile.head) {
+ // Profiling was tentatively terminated with the "Clear all profiles." button.
+ return;
+ }
+ this.profile.head = profile.head;
+ this._assignParentsInProfile();
+ this._changeView();
+ }
+
+ // COMPATIBILITY (iOS 6): getCPUProfile use to be called getProfile.
+ if (ProfilerAgent.getProfile)
+ ProfilerAgent.getProfile(this.profile.type, this.profile.id, profileCallback.bind(this));
+ else
+ ProfilerAgent.getCPUProfile(this.profile.id, profileCallback.bind(this));
+ },
+
+ get navigationItems()
+ {
+ return [this._showTreeBottomUpNavigationItem, this.showTimeAsPercentNavigationItem];
+ },
+
+ get bottomUpProfileDataGridTree()
+ {
+ if (!this._bottomUpProfileDataGridTree)
+ this._bottomUpProfileDataGridTree = new WebInspector.LegacyBottomUpProfileDataGridTree(this.profile.head);
+ return this._bottomUpProfileDataGridTree;
+ },
+
+ get topDownProfileDataGridTree()
+ {
+ if (!this._topDownProfileDataGridTree)
+ this._topDownProfileDataGridTree = new WebInspector.LegacyTopDownProfileDataGridTree(this.profile.head);
+ return this._topDownProfileDataGridTree;
+ },
+
+ willHide: function()
+ {
+ this._currentSearchResultIndex = -1;
+ },
+
+ refresh: function()
+ {
+ var selectedProfileNode = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.profileNode : null;
+
+ this.dataGrid.removeChildren();
+
+ var children = this.profileDataGridTree.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ this.dataGrid.appendChild(children[index]);
+
+ if (selectedProfileNode)
+ selectedProfileNode.selected = true;
+ },
+
+ refreshVisibleData: function()
+ {
+ var child = this.dataGrid.children[0];
+ while (child) {
+ child.refresh(this.showTimeAsPercent.value);
+ child = child.traverseNextNode(false, null, true);
+ }
+ },
+
+ searchCanceled: function()
+ {
+ if (this._searchResults) {
+ for (var i = 0; i < this._searchResults.length; ++i) {
+ var profileNode = this._searchResults[i].profileNode;
+
+ delete profileNode._searchMatchedSelfColumn;
+ delete profileNode._searchMatchedTotalColumn;
+ delete profileNode._searchMatchedCallsColumn;
+ delete profileNode._searchMatchedFunctionColumn;
+
+ profileNode.refresh();
+ }
+ }
+
+ delete this._searchFinishedCallback;
+ this._currentSearchResultIndex = -1;
+ this._searchResults = [];
+ },
+
+ performSearch: function(query, finishedCallback)
+ {
+ // Call searchCanceled since it will reset everything we need before doing a new search.
+ this.searchCanceled();
+
+ query = query.trim();
+
+ if (!query.length)
+ return;
+
+ this._searchFinishedCallback = finishedCallback;
+
+ var greaterThan = query.charAt(0) === ">";
+ var lessThan = query.charAt(0) === "<";
+ var equalTo = (query.charAt(0) === "=" || ((greaterThan || lessThan) && query.charAt(1) === "="));
+ var percentUnits = (query.lastIndexOf("%") === (query.length - 1));
+ var millisecondsUnits = (query.length > 2 && query.lastIndexOf("ms") === (query.length - 2));
+ var secondsUnits = (!millisecondsUnits && query.lastIndexOf("s") === (query.length - 1));
+
+ var queryNumber = parseFloat(query);
+ if (greaterThan || lessThan || equalTo) {
+ if (equalTo && (greaterThan || lessThan))
+ queryNumber = parseFloat(query.substring(2));
+ else
+ queryNumber = parseFloat(query.substring(1));
+ }
+
+ var queryNumberMilliseconds = (secondsUnits ? (queryNumber * 1000) : queryNumber);
+
+ // Make equalTo implicitly true if it wasn't specified there is no other operator.
+ if (!isNaN(queryNumber) && !(greaterThan || lessThan))
+ equalTo = true;
+
+ function matchesQuery(/*ProfileDataGridNode*/ profileDataGridNode)
+ {
+ delete profileDataGridNode._searchMatchedSelfColumn;
+ delete profileDataGridNode._searchMatchedTotalColumn;
+ delete profileDataGridNode._searchMatchedAverageColumn;
+ delete profileDataGridNode._searchMatchedCallsColumn;
+ delete profileDataGridNode._searchMatchedFunctionColumn;
+
+ if (percentUnits) {
+ if (lessThan) {
+ if (profileDataGridNode.selfPercent < queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent < queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ } else if (greaterThan) {
+ if (profileDataGridNode.selfPercent > queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent > queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+
+ if (equalTo) {
+ if (profileDataGridNode.selfPercent == queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent == queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+ } else if (millisecondsUnits || secondsUnits) {
+ if (lessThan) {
+ if (profileDataGridNode.selfTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ } else if (greaterThan) {
+ if (profileDataGridNode.selfTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+
+ if (equalTo) {
+ if (profileDataGridNode.selfTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+ } else {
+ if (equalTo && profileDataGridNode.numberOfCalls == queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ if (greaterThan && profileDataGridNode.numberOfCalls > queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ if (lessThan && profileDataGridNode.numberOfCalls < queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ }
+
+ if (profileDataGridNode.functionName.hasSubstring(query, true) || profileDataGridNode.url.hasSubstring(query, true))
+ profileDataGridNode._searchMatchedFunctionColumn = true;
+
+ if (profileDataGridNode._searchMatchedSelfColumn ||
+ profileDataGridNode._searchMatchedTotalColumn ||
+ profileDataGridNode._searchMatchedAverageColumn ||
+ profileDataGridNode._searchMatchedCallsColumn ||
+ profileDataGridNode._searchMatchedFunctionColumn)
+ {
+ profileDataGridNode.refresh();
+ return true;
+ }
+
+ return false;
+ }
+
+ var current = this.profileDataGridTree.children[0];
+
+ while (current) {
+ if (matchesQuery(current)) {
+ this._searchResults.push({ profileNode: current });
+ }
+
+ current = current.traverseNextNode(false, null, false);
+ }
+
+ finishedCallback(this, this._searchResults.length);
+ },
+
+ jumpToFirstSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ this._currentSearchResultIndex = 0;
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToLastSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ this._currentSearchResultIndex = (this._searchResults.length - 1);
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToNextSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ if (++this._currentSearchResultIndex >= this._searchResults.length)
+ this._currentSearchResultIndex = 0;
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToPreviousSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ if (--this._currentSearchResultIndex < 0)
+ this._currentSearchResultIndex = (this._searchResults.length - 1);
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ showingFirstSearchResult: function()
+ {
+ return (this._currentSearchResultIndex === 0);
+ },
+
+ showingLastSearchResult: function()
+ {
+ return (this._searchResults && this._currentSearchResultIndex === (this._searchResults.length - 1));
+ },
+
+ _jumpToSearchResult: function(index)
+ {
+ var searchResult = this._searchResults[index];
+ if (!searchResult)
+ return;
+
+ var profileNode = searchResult.profileNode;
+ profileNode.revealAndSelect();
+ },
+
+ _toggleBottomUpView: function(event)
+ {
+ this._showTreeBottomUpSetting.value = !this._showTreeBottomUpSetting.value;
+ this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
+ this._changeView();
+ },
+
+ _changeView: function()
+ {
+ if (!this.profile)
+ return;
+
+ if (!this._showTreeBottomUpSetting.value) {
+ this.profileDataGridTree = this.topDownProfileDataGridTree;
+ this._sortProfile();
+ this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeTree;
+ } else {
+ this.profileDataGridTree = this.bottomUpProfileDataGridTree;
+ this._sortProfile();
+ this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeHeavy;
+ }
+
+ if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
+ return;
+
+ // The current search needs to be performed again. First negate out previous match
+ // count by calling the search finished callback with a negative number of matches.
+ // Then perform the search again the with same query and callback.
+ this._searchFinishedCallback(this, -this._searchResults.length);
+ this.performSearch(this.currentQuery, this._searchFinishedCallback);
+ },
+
+ toggleTimeDisplay: function(event)
+ {
+ WebInspector.LegacyProfileView.prototype.toggleTimeDisplay.call(this, event);
+ this.showTimeAsPercent.value = !this.showTimeAsPercent.value;
+ this.refreshVisibleData();
+ },
+
+ _focusClicked: function(event)
+ {
+ if (!this.dataGrid.selectedNode)
+ return;
+
+ this.profileDataGridTree.focus(this.dataGrid.selectedNode);
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _excludeClicked: function(event)
+ {
+ var selectedNode = this.dataGrid.selectedNode;
+
+ if (!selectedNode)
+ return;
+
+ selectedNode.deselect();
+
+ this.profileDataGridTree.exclude(selectedNode);
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _resetClicked: function(event)
+ {
+ this.profileDataGridTree.restore();
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _sortData: function(event)
+ {
+ this._sortProfile(this.profile);
+ },
+
+ _sortProfile: function()
+ {
+ var sortAscending = this.dataGrid.sortOrder === "ascending";
+ var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
+ var sortProperty = {
+ "average": "averageTime",
+ "self": "selfTime",
+ "total": "totalTime",
+ "calls": "numberOfCalls",
+ "function": "functionName"
+ }[sortColumnIdentifier];
+
+ this.profileDataGridTree.sort(WebInspector.LegacyProfileDataGridTree.propertyComparator(sortProperty, sortAscending));
+
+ this.refresh();
+ },
+
+ _assignParentsInProfile: function()
+ {
+ var head = this.profile.head;
+ head.parent = null;
+ head.head = null;
+ var nodesToTraverse = [ { parent: head, children: head.children } ];
+ while (nodesToTraverse.length > 0) {
+ var pair = nodesToTraverse.shift();
+ var parent = pair.parent;
+ var children = pair.children;
+ var length = children.length;
+ for (var i = 0; i < length; ++i) {
+ children[i].head = head;
+ children[i].parent = parent;
+ if (children[i].children.length > 0)
+ nodesToTraverse.push({ parent: children[i], children: children[i].children });
+ }
+ }
+ }
+}
+
+WebInspector.LegacyJavaScriptProfileView.prototype.__proto__ = WebInspector.LegacyProfileView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileDataGridTreejsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,399 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North 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. ``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
+ * 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.LegacyProfileDataGridNode = function(profileNode, owningTree, hasChildren, showTimeAsPercent)
+{
+ this.profileNode = profileNode;
+
+ WebInspector.DataGridNode.call(this, null, hasChildren);
+
+ this.addEventListener("populate", this._populate, this);
+
+ this.tree = owningTree;
+
+ this.childrenByCallUID = {};
+ this.lastComparator = null;
+
+ this.callUID = profileNode.callUID;
+ this.selfTime = profileNode.selfTime;
+ this.totalTime = profileNode.totalTime;
+ this.functionName = profileNode.functionName;
+ this.numberOfCalls = profileNode.numberOfCalls;
+ this.url = profileNode.url;
+
+ this._showTimeAsPercent = showTimeAsPercent || false;
+}
+
+WebInspector.LegacyProfileDataGridNode.prototype = {
+ get data()
+ {
+ function formatMilliseconds(time)
+ {
+ return Number.secondsToString(time / 1000, true);
+ }
+
+ var data = {};
+
+ data["function"] = this.functionName;
+ data["calls"] = this.numberOfCalls;
+
+ if (this._showTimeAsPercent) {
+ data["self"] = WebInspector.UIString("%.2f %%").format(this.selfPercent);
+ data["total"] = WebInspector.UIString("%.2f %%").format(this.totalPercent);
+ data["average"] = WebInspector.UIString("%.2f %%").format(this.averagePercent);
+ } else {
+ data["self"] = formatMilliseconds(this.selfTime);
+ data["total"] = formatMilliseconds(this.totalTime);
+ data["average"] = formatMilliseconds(this.averageTime);
+ }
+
+ return data;
+ },
+
+ get showTimeAsPercent()
+ {
+ return this._showTimeAsPercent;
+ },
+
+ refresh: function(showTimeAsPercent)
+ {
+ this._showTimeAsPercent = showTimeAsPercent;
+
+ WebInspector.DataGridNode.prototype.refresh.call(this);
+ },
+
+ createCell: function(columnIdentifier)
+ {
+ var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
+
+ if (columnIdentifier === "self" && this._searchMatchedSelfColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "total" && this._searchMatchedTotalColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "average" && this._searchMatchedAverageColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "calls" && this._searchMatchedCallsColumn)
+ cell.classList.add("highlight");
+
+ if (columnIdentifier !== "function")
+ return cell;
+
+ if (this.profileNode._searchMatchedFunctionColumn)
+ cell.classList.add("highlight");
+
+ if (this.profileNode.url) {
+ // FIXME(62725): profileNode should reference a debugger location.
+ var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
+ var urlElement = this._linkifyLocation(this.profileNode.url, lineNumber, "profile-node-file");
+ urlElement.style.maxWidth = "75%";
+ cell.insertBefore(urlElement, cell.firstChild);
+ }
+
+ return cell;
+ },
+
+ sort: function(comparator, force)
+ {
+ var gridNodeGroups = [[this]];
+
+ for (var gridNodeGroupIndex = 0; gridNodeGroupIndex < gridNodeGroups.length; ++gridNodeGroupIndex) {
+ var gridNodes = gridNodeGroups[gridNodeGroupIndex];
+ var count = gridNodes.length;
+
+ for (var index = 0; index < count; ++index) {
+ var gridNode = gridNodes[index];
+
+ // If the grid node is collapsed, then don't sort children (save operation for later).
+ // If the grid node has the same sorting as previously, then there is no point in sorting it again.
+ if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {
+ if (gridNode.children.length)
+ gridNode.shouldRefreshChildren = true;
+ continue;
+ }
+
+ gridNode.lastComparator = comparator;
+
+ var children = gridNode.children;
+ var childCount = children.length;
+
+ if (childCount) {
+ children.sort(comparator);
+
+ for (var childIndex = 0; childIndex < childCount; ++childIndex)
+ children[childIndex]._recalculateSiblings(childIndex);
+
+ gridNodeGroups.push(children);
+ }
+ }
+ }
+ },
+
+ insertChild: function(profileDataGridNode, index)
+ {
+ WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
+
+ this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;
+ },
+
+ removeChild: function(profileDataGridNode)
+ {
+ WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
+
+ delete this.childrenByCallUID[profileDataGridNode.callUID];
+ },
+
+ removeChildren: function(profileDataGridNode)
+ {
+ WebInspector.DataGridNode.prototype.removeChildren.call(this);
+
+ this.childrenByCallUID = {};
+ },
+
+ findChild: function(node)
+ {
+ if (!node)
+ return null;
+ return this.childrenByCallUID[node.callUID];
+ },
+
+ get averageTime()
+ {
+ return this.selfTime / Math.max(1, this.numberOfCalls);
+ },
+
+ get averagePercent()
+ {
+ return this.averageTime / this.tree.totalTime * 100.0;
+ },
+
+ get selfPercent()
+ {
+ return this.selfTime / this.tree.totalTime * 100.0;
+ },
+
+ get totalPercent()
+ {
+ return this.totalTime / this.tree.totalTime * 100.0;
+ },
+
+ get _parent()
+ {
+ return this.parent !== this.dataGrid ? this.parent : this.tree;
+ },
+
+ _populate: function(event)
+ {
+ this._sharedPopulate();
+
+ if (this._parent) {
+ var currentComparator = this._parent.lastComparator;
+
+ if (currentComparator)
+ this.sort(currentComparator, true);
+ }
+
+ if (this.removeEventListener)
+ this.removeEventListener("populate", this._populate, this);
+ },
+
+ // When focusing and collapsing we modify lots of nodes in the tree.
+ // This allows us to restore them all to their original state when we revert.
+ _save: function()
+ {
+ if (this._savedChildren)
+ return;
+
+ this._savedSelfTime = this.selfTime;
+ this._savedTotalTime = this.totalTime;
+ this._savedNumberOfCalls = this.numberOfCalls;
+
+ this._savedChildren = this.children.slice();
+ },
+
+ // When focusing and collapsing we modify lots of nodes in the tree.
+ // This allows us to restore them all to their original state when we revert.
+ _restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.selfTime = this._savedSelfTime;
+ this.totalTime = this._savedTotalTime;
+ this.numberOfCalls = this._savedNumberOfCalls;
+
+ this.removeChildren();
+
+ var children = this._savedChildren;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ children[index]._restore();
+ this.appendChild(children[index]);
+ }
+ },
+
+ _merge: function(child, shouldAbsorb)
+ {
+ this.selfTime += child.selfTime;
+
+ if (!shouldAbsorb) {
+ this.totalTime += child.totalTime;
+ this.numberOfCalls += child.numberOfCalls;
+ }
+
+ var children = this.children.slice();
+
+ this.removeChildren();
+
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ if (!shouldAbsorb || children[index] !== child)
+ this.appendChild(children[index]);
+ }
+
+ children = child.children.slice();
+ count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ var orphanedChild = children[index],
+ existingChild = this.childrenByCallUID[orphanedChild.callUID];
+
+ if (existingChild)
+ existingChild._merge(orphanedChild, false);
+ else
+ this.appendChild(orphanedChild);
+ }
+ },
+
+ _linkifyLocation: function(url, lineNumber, className)
+ {
+ // FIXME: CPUProfileNode's need columnNumbers.
+ return WebInspector.linkifyLocation(url, lineNumber, 0, className);
+ }
+}
+
+WebInspector.LegacyProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
+
+WebInspector.LegacyProfileDataGridTree = function(profileNode)
+{
+ this.tree = this;
+ this.children = [];
+
+ this.totalTime = profileNode.totalTime;
+ this.lastComparator = null;
+
+ this.childrenByCallUID = {};
+}
+
+WebInspector.LegacyProfileDataGridTree.prototype = {
+ get expanded()
+ {
+ return true;
+ },
+
+ appendChild: function(child)
+ {
+ this.insertChild(child, this.children.length);
+ },
+
+ insertChild: function(child, index)
+ {
+ this.children.splice(index, 0, child);
+ this.childrenByCallUID[child.callUID] = child;
+ },
+
+ removeChildren: function()
+ {
+ this.children = [];
+ this.childrenByCallUID = {};
+ },
+
+ findChild: WebInspector.LegacyProfileDataGridNode.prototype.findChild,
+ sort: WebInspector.LegacyProfileDataGridNode.prototype.sort,
+
+ _save: function()
+ {
+ if (this._savedChildren)
+ return;
+
+ this._savedTotalTime = this.totalTime;
+ this._savedChildren = this.children.slice();
+ },
+
+ restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.children = this._savedChildren;
+ this.totalTime = this._savedTotalTime;
+
+ var children = this.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ children[index]._restore();
+
+ this._savedChildren = null;
+ }
+}
+
+WebInspector.LegacyProfileDataGridTree.propertyComparators = [{}, {}];
+
+WebInspector.LegacyProfileDataGridTree.propertyComparator = function(property, isAscending)
+{
+ var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
+
+ if (!comparator) {
+ if (isAscending) {
+ comparator = function(lhs, rhs)
+ {
+ if (lhs[property] < rhs[property])
+ return -1;
+
+ if (lhs[property] > rhs[property])
+ return 1;
+
+ return 0;
+ };
+ } else {
+ comparator = function(lhs, rhs)
+ {
+ if (lhs[property] > rhs[property])
+ return -1;
+
+ if (lhs[property] < rhs[property])
+ return 1;
+
+ return 0;
+ };
+ }
+
+ this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
+ }
+
+ return comparator;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileManagerjsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,182 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.LegacyProfileManager = function()
+{
+ WebInspector.Object.call(this);
+
+ this._javaScriptProfileType = new WebInspector.LegacyJavaScriptProfileType;
+
+ if (window.ProfilerAgent) {
+ ProfilerAgent.enable();
+ ProfilerAgent.getProfileHeaders();
+ }
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ this.initialize();
+};
+
+WebInspector.LegacyProfileManager.Event = {
+ ProfileWasAdded: "profile-manager-profile-was-added",
+ ProfileWasUpdated: "profile-manager-profile-was-updated",
+ ProfilingStarted: "profile-manager-profiling-started",
+ ProfilingEnded: "profile-manager-profiling-ended",
+ ProfilingInterrupted: "profile-manager-profiling-interrupted",
+ Cleared: "profile-manager-cleared"
+};
+
+WebInspector.LegacyProfileManager.UserInitiatedProfileName = "org.webkit.profiles.user-initiated";
+
+WebInspector.LegacyProfileManager.prototype = {
+ constructor: WebInspector.LegacyProfileManager,
+
+ // Public
+
+ initialize: function()
+ {
+ this._checkForInterruptions();
+
+ this._recordingJavaScriptProfile = null;
+
+ this._isProfiling = false;
+
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.Cleared);
+ },
+
+ isProfilingJavaScript: function()
+ {
+ return this._javaScriptProfileType.isRecordingProfile();
+ },
+
+ startProfilingJavaScript: function()
+ {
+ this._javaScriptProfileType.startRecordingProfile();
+ },
+
+ stopProfilingJavaScript: function()
+ {
+ this._javaScriptProfileType.stopRecordingProfile();
+ },
+
+ profileWasStartedFromConsole: function(title)
+ {
+ this.setRecordingJavaScriptProfile(true, true);
+
+ if (title.indexOf(WebInspector.LegacyProfileManager.UserInitiatedProfileName) === -1) {
+ this._recordingJavaScriptProfile.title = title;
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
+ }
+ },
+
+ profileWasEndedFromConsole: function()
+ {
+ this.setRecordingJavaScriptProfile(false, true);
+ },
+
+ addJavaScriptProfile: function(profile)
+ {
+ console.assert(this._recordingJavaScriptProfile);
+ if (!this._recordingJavaScriptProfile)
+ return;
+
+ this._recordingJavaScriptProfile.type = profile.typeId;
+ this._recordingJavaScriptProfile.title = profile.title;
+ this._recordingJavaScriptProfile.id = profile.uid;
+ this._recordingJavaScriptProfile.recording = false;
+
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
+
+ // We want to reset _recordingJavaScriptProfile so that we can identify
+ // interruptions, but we also want to keep track of the last profile
+ // we've recorded so that we can provide it as data to the ProfilingEnded event
+ // we'll dispatch in setRecordingJavaScriptProfile().
+ this._lastJavaScriptProfileAdded = this._recordingJavaScriptProfile;
+ this._recordingJavaScriptProfile = null;
+ },
+
+ setRecordingJavaScriptProfile: function(isProfiling, fromConsole)
+ {
+ if (this._isProfiling === isProfiling)
+ return;
+
+ this._isProfiling = isProfiling;
+
+ // We've interrupted the current JS profile due to a page reload. Return
+ // now and _attemptToResumeProfiling will pick things up after the reload.
+ if (!isProfiling && !!this._recordingJavaScriptProfile)
+ return;
+
+ if (isProfiling && !this._recordingJavaScriptProfile)
+ this._recordingJavaScriptProfile = new WebInspector.LegacyJavaScriptProfileObject(WebInspector.LegacyProfileManager.UserInitiatedProfileName, -1, true);
+
+ if (isProfiling) {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasAdded, {profile: this._recordingJavaScriptProfile});
+ if (!fromConsole)
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingStarted);
+ } else {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingEnded, {
+ profile: this._lastJavaScriptProfileAdded,
+ fromConsole: fromConsole
+ });
+ this._lastJavaScriptProfileAdded = null;
+ }
+ },
+
+ // Private
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ var oldMainResource = event.data.oldMainResource;
+ var newMainResource = event.target.mainResource;
+ if (oldMainResource.url !== newMainResource.url)
+ this.initialize();
+ else
+ this._attemptToResumeProfiling();
+ },
+
+ _checkForInterruptions: function()
+ {
+ if (this._recordingJavaScriptProfile) {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
+ this._javaScriptProfileType.setRecordingProfile(false);
+ }
+ },
+
+ _attemptToResumeProfiling: function()
+ {
+ this._checkForInterruptions();
+
+ if (this._recordingJavaScriptProfile)
+ this.startProfilingJavaScript();
+ }
+};
+
+WebInspector.LegacyProfileManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileObjectjsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileObject.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.LegacyProfileObject = function(type, title, id, isRecording)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(type);
+ console.assert(title);
+ console.assert(id);
+
+ this._type = type;
+ this._title = title;
+ this._id = id;
+ this._isRecording = isRecording || false;
+};
+
+WebInspector.LegacyProfileObject.Event = {
+ FinshedRecording: "profile-object-finished-recording"
+};
+
+WebInspector.LegacyProfileObject.prototype = {
+ constructor: WebInspector.LegacyProfileObject,
+
+ get type()
+ {
+ return this._type;
+ },
+
+ set type(type)
+ {
+ this._type = type;
+ },
+
+ get title()
+ {
+ return this._title;
+ },
+
+ set title(title)
+ {
+ this._title = title;
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ set id(id)
+ {
+ this._id = id;
+ },
+
+ get recording()
+ {
+ return this._isRecording;
+ },
+
+ set recording(flag)
+ {
+ if (this._isRecording === flag)
+ return;
+
+ this._isRecording = flag;
+ if (!flag)
+ this.dispatchEventToListeners(WebInspector.LegacyProfileObject.Event.FinshedRecording);
+ }
+};
+
+WebInspector.LegacyProfileObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileTypejsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileTypejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileType.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 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. ``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
+ * 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.LegacyProfileType = function(id, name)
+{
+ this._id = id;
+ this._name = name;
+}
+
+WebInspector.LegacyProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
+WebInspector.LegacyProfileType.ProfileScheme = "webkit-profile";
+
+WebInspector.LegacyProfileType.prototype = {
+ get buttonTooltip()
+ {
+ return "";
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get treeItemTitle()
+ {
+ return this._name;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ buttonClicked: function()
+ {
+ },
+
+ viewForProfile: function(profile)
+ {
+ if (!profile._profileView)
+ profile._profileView = this.createView(profile);
+ return profile._profileView;
+ },
+
+ reset: function()
+ {
+ },
+
+ get description()
+ {
+ return "";
+ },
+
+ // Must be implemented by subclasses.
+ createView: function(profile)
+ {
+ throw new Error("Needs implemented.");
+ },
+
+ // Must be implemented by subclasses.
+ createSidebarTreeElementForProfile: function(profile)
+ {
+ throw new Error("Needs implemented.");
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewcssfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileView.css) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+.recording-profile-view {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+
+ display: -webkit-flex;
+ -webkit-flex-flow: row nowrap;
+ -webkit-justify-content: center;
+ -webkit-align-content: center;
+ -webkit-align-items: center;
+
+ background-color: rgb(232, 232, 232);
+}
+
+.recording-profile-view > .indeterminate-progress-spinner {
+ position: static;
+ margin: 0;
+}
+
+.recording-profile-view > span {
+ font-family: 'Lucida Grande', Helvetica, sans-serif;
+ font-size: 14px;
+
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ color: rgb(60, 60, 60);
+
+ padding-left: 10px;
+
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewjsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfileViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfileView.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.LegacyProfileView = function(profile, settingId)
+{
+ WebInspector.ContentView.call(this, profile);
+
+ this._profile = profile;
+
+ this.element.classList.add("profile-view");
+
+ this.showTimeAsPercent = new WebInspector.Setting(settingId, true);
+ this.showTimeAsPercentNavigationItem = new WebInspector.ActivateButtonNavigationItem("selector-profiler-show-time-as-percent-navigation-item", WebInspector.UIString("Show times as percentages"), WebInspector.UIString("Show times as absolute times"), "Images/Percent.svg", 16, 16);
+ this.showTimeAsPercentNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleTimeDisplay, this);
+ this.showTimeAsPercentNavigationItem.activated = this.showTimeAsPercent.value;
+
+ if (profile.recording) {
+ this._showRecordingMessage();
+ profile.addEventListener(WebInspector.LegacyProfileObject.Event.FinshedRecording, this._profileFinishedRecording, this);
+ } else
+ this.displayProfile();
+};
+
+WebInspector.LegacyProfileView.prototype = {
+ constructor: WebInspector.LegacyProfileView,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this.showTimeAsPercentNavigationItem];
+ },
+
+ get allowedNavigationSidebarPanels()
+ {
+ return ["instrument"];
+ },
+
+ get profile()
+ {
+ return this._profile;
+ },
+
+ set profile(profile)
+ {
+ this._profile = profile;
+ },
+
+ toggleTimeDisplay: function(event)
+ {
+ this.showTimeAsPercentNavigationItem.activated = !this.showTimeAsPercentNavigationItem.activated;
+ },
+
+ displayProfile: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ get recordingTitle()
+ {
+ return WebInspector.UIString("Recording\u2026");
+ },
+
+ // Private
+
+ _profileFinishedRecording: function()
+ {
+ this._hideRecordingMessage();
+ this.displayProfile();
+ },
+
+ _showRecordingMessage: function()
+ {
+ this._recordingMessageContainer = this.element.appendChild(document.createElement("div"));
+ this._recordingMessageContainer.className = "recording-profile-view";
+ this._recordingMessageContainer.appendChild(new WebInspector.IndeterminateProgressSpinner().element);
+ this._recordingMessageContainer.appendChild(document.createElement("span")).textContent = this.recordingTitle;
+ },
+
+ _hideRecordingMessage: function()
+ {
+ if (this._recordingMessageContainer)
+ this._recordingMessageContainer.remove();
+ }
+};
+
+WebInspector.LegacyProfileView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfilerObserverjsfromrev163137trunkSourceWebInspectorUIUserInterfaceProfilerObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/ProfilerObserver.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.LegacyProfilerObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.LegacyProfilerObserver.prototype = {
+ constructor: WebInspector.LegacyProfilerObserver,
+
+ // Events defined by the "Profiler" domain.
+
+ resetProfiles: function()
+ {
+ // FIXME: Implement this.
+ },
+
+ addProfileHeader: function(profile)
+ {
+ WebInspector.legacyProfileManager.addJavaScriptProfile(profile);
+ },
+
+ addHeapSnapshotChunk: function(uid, chunk)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ },
+
+ finishHeapSnapshot: function(uid)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ },
+
+ setRecordingProfile: function(isProfiling)
+ {
+ WebInspector.legacyProfileManager.setRecordingJavaScriptProfile(isProfiling);
+ },
+
+ reportHeapSnapshotProgress: function(done, total)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ }
+
+};
+
+WebInspector.LegacyProfilerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyTopDownProfileDataGridTreejsfromrev163137trunkSourceWebInspectorUIUserInterfaceTopDownProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js (from rev 163137, trunk/Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js) (0 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North 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. ``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
+ * 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.LegacyTopDownProfileDataGridNode = function(profileNode, owningTree)
+{
+ var hasChildren = (profileNode.children && profileNode.children.length);
+
+ WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, hasChildren);
+
+ this._remainingChildren = profileNode.children;
+}
+
+WebInspector.LegacyTopDownProfileDataGridNode.prototype = {
+ _sharedPopulate: function()
+ {
+ var children = this._remainingChildren;
+ var childrenLength = children.length;
+
+ for (var i = 0; i < childrenLength; ++i)
+ this.appendChild(new WebInspector.LegacyTopDownProfileDataGridNode(children[i], this.tree, false, this.showTimeAsPercent));
+
+ this._remainingChildren = null;
+ },
+
+ _exclude: function(aCallUID)
+ {
+ if (this._remainingChildren)
+ this._populate();
+
+ this._save();
+
+ var children = this.children;
+ var index = this.children.length;
+
+ while (index--)
+ children[index]._exclude(aCallUID);
+
+ var child = this.childrenByCallUID[aCallUID];
+
+ if (child)
+ this._merge(child, true);
+ }
+}
+
+WebInspector.LegacyTopDownProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
+
+WebInspector.LegacyTopDownProfileDataGridTree = function(profileNode)
+{
+ WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
+
+ this._remainingChildren = profileNode.children;
+
+ WebInspector.LegacyTopDownProfileDataGridNode.prototype._populate.call(this);
+}
+
+WebInspector.LegacyTopDownProfileDataGridTree.prototype = {
+ focus: function(profileDataGrideNode)
+ {
+ if (!profileDataGrideNode)
+ return;
+
+ this._save();
+ profileDataGrideNode.savePosition();
+
+ this.children = [profileDataGrideNode];
+ this.totalTime = profileDataGrideNode.totalTime;
+ },
+
+ exclude: function(profileDataGrideNode)
+ {
+ if (!profileDataGrideNode)
+ return;
+
+ this._save();
+
+ var excludedCallUID = profileDataGrideNode.callUID;
+
+ WebInspector.LegacyTopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);
+
+ if (this.lastComparator)
+ this.sort(this.lastComparator, true);
+ },
+
+ restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.children[0].restorePosition();
+
+ WebInspector.LegacyProfileDataGridTree.prototype.restore.call(this);
+ },
+
+ _merge: WebInspector.LegacyTopDownProfileDataGridNode.prototype._merge,
+
+ _sharedPopulate: WebInspector.LegacyTopDownProfileDataGridNode.prototype._sharedPopulate
+}
+
+WebInspector.LegacyTopDownProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -95,8 +95,8 @@
</span><span class="cx"> <link rel="stylesheet" href="NetworkTimelineOverviewGraph.css">
</span><span class="cx"> <link rel="stylesheet" href="LayoutTimelineOverviewGraph.css">
</span><span class="cx"> <link rel="stylesheet" href="ScriptTimelineOverviewGraph.css">
</span><del>- <link rel="stylesheet" href="ProfileView.css">
- <link rel="stylesheet" href="JavaScriptProfileView.css">
</del><ins>+ <link rel="stylesheet" href="LegacyProfileView.css">
+ <link rel="stylesheet" href="LegacyJavaScriptProfileView.css">
</ins><span class="cx"> <link rel="stylesheet" href="CSSStyleDetailsSidebarPanel.css">
</span><span class="cx"> <link rel="stylesheet" href="DOMTreeDataGrid.css">
</span><span class="cx"> <link rel="stylesheet" href="LayerTreeSidebarPanel.css">
</span><span class="lines">@@ -168,21 +168,20 @@
</span><span class="cx"> <script src="RemoteObject.js"></script>
</span><span class="cx"> <script src="InspectorObserver.js"></script>
</span><span class="cx"> <script src="PageObserver.js"></script>
</span><del>- <script src="CanvasObserver.js"></script>
</del><span class="cx"> <script src="ConsoleObserver.js"></script>
</span><span class="cx"> <script src="NetworkObserver.js"></script>
</span><span class="cx"> <script src="CSSObserver.js"></script>
</span><span class="cx"> <script src="DOMObserver.js"></script>
</span><span class="cx"> <script src="DebuggerObserver.js"></script>
</span><span class="cx"> <script src="DatabaseObserver.js"></script>
</span><del>- <script src="ProfilerObserver.js"></script>
</del><ins>+ <script src="LegacyProfilerObserver.js"></script>
</ins><span class="cx"> <script src="LayerTreeObserver.js"></script>
</span><span class="cx"> <script src="RuntimeObserver.js"></script>
</span><span class="cx"> <script src="ImageUtilities.js"></script>
</span><span class="cx"> <script src="DataGrid.js"></script>
</span><del>- <script src="ProfileDataGridTree.js"></script>
- <script src="BottomUpProfileDataGridTree.js"></script>
- <script src="TopDownProfileDataGridTree.js"></script>
</del><ins>+ <script src="LegacyProfileDataGridTree.js"></script>
+ <script src="LegacyBottomUpProfileDataGridTree.js"></script>
+ <script src="LegacyTopDownProfileDataGridTree.js"></script>
</ins><span class="cx"> <script src="CookieStorageObject.js"></script>
</span><span class="cx"> <script src="DatabaseObject.js"></script>
</span><span class="cx"> <script src="DatabaseTableObject.js"></script>
</span><span class="lines">@@ -373,17 +372,13 @@
</span><span class="cx"> <script src="NetworkTimelineOverviewGraph.js"></script>
</span><span class="cx"> <script src="LayoutTimelineOverviewGraph.js"></script>
</span><span class="cx"> <script src="ScriptTimelineOverviewGraph.js"></script>
</span><del>- <script src="ProfileManager.js"></script>
- <script src="ProfileType.js"></script>
- <script src="ProfileView.js"></script>
- <script src="JavaScriptProfileType.js"></script>
- <script src="JavaScriptProfileView.js"></script>
- <script src="CanvasDataGridNode.js"></script>
- <script src="CanvasProfileType.js"></script>
- <script src="CanvasProfileView.js"></script>
- <script src="ProfileObject.js"></script>
- <script src="JavaScriptProfileObject.js"></script>
- <script src="CanvasProfileObject.js"></script>
</del><ins>+ <script src="LegacyProfileManager.js"></script>
+ <script src="LegacyProfileType.js"></script>
+ <script src="LegacyProfileView.js"></script>
+ <script src="LegacyJavaScriptProfileType.js"></script>
+ <script src="LegacyJavaScriptProfileView.js"></script>
+ <script src="LegacyProfileObject.js"></script>
+ <script src="LegacyJavaScriptProfileObject.js"></script>
</ins><span class="cx"> <script src="DebuggerSidebarPanel.js"></script>
</span><span class="cx"> <script src="BreakpointTreeElement.js"></script>
</span><span class="cx"> <script src="BreakpointAction.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -60,8 +60,6 @@
</span><span class="cx"> InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
</span><span class="cx"> if (InspectorBackend.registerPageDispatcher)
</span><span class="cx"> InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
</span><del>- if (InspectorBackend.registerCanvasDispatcher)
- InspectorBackend.registerCanvasDispatcher(new WebInspector.CanvasObserver);
</del><span class="cx"> if (InspectorBackend.registerConsoleDispatcher)
</span><span class="cx"> InspectorBackend.registerConsoleDispatcher(new WebInspector.ConsoleObserver);
</span><span class="cx"> if (InspectorBackend.registerNetworkDispatcher)
</span><span class="lines">@@ -79,7 +77,7 @@
</span><span class="cx"> if (InspectorBackend.registerTimelineDispatcher)
</span><span class="cx"> InspectorBackend.registerTimelineDispatcher(new WebInspector.TimelineObserver);
</span><span class="cx"> if (InspectorBackend.registerProfilerDispatcher)
</span><del>- InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerObserver);
</del><ins>+ InspectorBackend.registerProfilerDispatcher(new WebInspector.LegacyProfilerObserver);
</ins><span class="cx"> if (InspectorBackend.registerCSSDispatcher)
</span><span class="cx"> InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
</span><span class="cx"> if (InspectorBackend.registerLayerTreeDispatcher)
</span><span class="lines">@@ -111,7 +109,7 @@
</span><span class="cx"> this.runtimeManager = new WebInspector.RuntimeManager;
</span><span class="cx"> this.applicationCacheManager = new WebInspector.ApplicationCacheManager;
</span><span class="cx"> this.timelineManager = new WebInspector.TimelineManager;
</span><del>- this.profileManager = new WebInspector.ProfileManager;
</del><ins>+ this.legacyProfileManager = new WebInspector.LegacyProfileManager;
</ins><span class="cx"> this.debuggerManager = new WebInspector.DebuggerManager;
</span><span class="cx"> this.sourceMapManager = new WebInspector.SourceMapManager;
</span><span class="cx"> this.layerTreeManager = new WebInspector.LayerTreeManager;
</span><span class="lines">@@ -482,7 +480,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> var parsedURL = parseURL(url);
</span><del>- if (parsedURL.scheme === WebInspector.ProfileType.ProfileScheme) {
</del><ins>+ if (parsedURL.scheme === WebInspector.LegacyProfileType.ProfileScheme) {
</ins><span class="cx"> var profileType = parsedURL.host.toUpperCase();
</span><span class="cx"> var profileTitle = parsedURL.path;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,400 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North 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. ``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
- * 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.ProfileDataGridNode = function(profileView, profileNode, owningTree, hasChildren)
-{
- this.profileView = profileView;
- this.profileNode = profileNode;
-
- WebInspector.DataGridNode.call(this, null, hasChildren);
-
- this.addEventListener("populate", this._populate, this);
-
- this.tree = owningTree;
-
- this.childrenByCallUID = {};
- this.lastComparator = null;
-
- this.callUID = profileNode.callUID;
- this.selfTime = profileNode.selfTime;
- this.totalTime = profileNode.totalTime;
- this.functionName = profileNode.functionName;
- this.numberOfCalls = profileNode.numberOfCalls;
- this.url = profileNode.url;
-}
-
-WebInspector.ProfileDataGridNode.prototype = {
- get data()
- {
- function formatMilliseconds(time)
- {
- return Number.secondsToString(time / 1000, true);
- }
-
- var data = {};
-
- data["function"] = this.functionName;
- data["calls"] = this.numberOfCalls;
-
- if (this.profileView.showTimeAsPercent.value) {
- data["self"] = WebInspector.UIString("%.2f %%").format(this.selfPercent);
- data["total"] = WebInspector.UIString("%.2f %%").format(this.totalPercent);
- data["average"] = WebInspector.UIString("%.2f %%").format(this.averagePercent);
- } else {
- data["self"] = formatMilliseconds(this.selfTime);
- data["total"] = formatMilliseconds(this.totalTime);
- data["average"] = formatMilliseconds(this.averageTime);
- }
-
- return data;
- },
-
- createCell: function(columnIdentifier)
- {
- var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
-
- if (columnIdentifier === "self" && this._searchMatchedSelfColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "total" && this._searchMatchedTotalColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "average" && this._searchMatchedAverageColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "calls" && this._searchMatchedCallsColumn)
- cell.classList.add("highlight");
-
- if (columnIdentifier !== "function")
- return cell;
-
- if (this.profileNode._searchMatchedFunctionColumn)
- cell.classList.add("highlight");
-
- if (this.profileNode.url) {
- // FIXME(62725): profileNode should reference a debugger location.
- var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
- var urlElement = this._linkifyLocation(this.profileNode.url, lineNumber, "profile-node-file");
- urlElement.style.maxWidth = "75%";
- cell.insertBefore(urlElement, cell.firstChild);
- }
-
- return cell;
- },
-
- select: function(supressSelectedEvent)
- {
- WebInspector.DataGridNode.prototype.select.call(this, supressSelectedEvent);
- this.profileView._dataGridNodeSelected(this);
- },
-
- deselect: function(supressDeselectedEvent)
- {
- WebInspector.DataGridNode.prototype.deselect.call(this, supressDeselectedEvent);
- this.profileView._dataGridNodeDeselected(this);
- },
-
- sort: function(/*Function*/ comparator, /*Boolean*/ force)
- {
- var gridNodeGroups = [[this]];
-
- for (var gridNodeGroupIndex = 0; gridNodeGroupIndex < gridNodeGroups.length; ++gridNodeGroupIndex) {
- var gridNodes = gridNodeGroups[gridNodeGroupIndex];
- var count = gridNodes.length;
-
- for (var index = 0; index < count; ++index) {
- var gridNode = gridNodes[index];
-
- // If the grid node is collapsed, then don't sort children (save operation for later).
- // If the grid node has the same sorting as previously, then there is no point in sorting it again.
- if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {
- if (gridNode.children.length)
- gridNode.shouldRefreshChildren = true;
- continue;
- }
-
- gridNode.lastComparator = comparator;
-
- var children = gridNode.children;
- var childCount = children.length;
-
- if (childCount) {
- children.sort(comparator);
-
- for (var childIndex = 0; childIndex < childCount; ++childIndex)
- children[childIndex]._recalculateSiblings(childIndex);
-
- gridNodeGroups.push(children);
- }
- }
- }
- },
-
- insertChild: function(/*ProfileDataGridNode*/ profileDataGridNode, index)
- {
- WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
-
- this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;
- },
-
- removeChild: function(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
-
- delete this.childrenByCallUID[profileDataGridNode.callUID];
- },
-
- removeChildren: function(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- WebInspector.DataGridNode.prototype.removeChildren.call(this);
-
- this.childrenByCallUID = {};
- },
-
- findChild: function(/*Node*/ node)
- {
- if (!node)
- return null;
- return this.childrenByCallUID[node.callUID];
- },
-
- get averageTime()
- {
- return this.selfTime / Math.max(1, this.numberOfCalls);
- },
-
- get averagePercent()
- {
- return this.averageTime / this.tree.totalTime * 100.0;
- },
-
- get selfPercent()
- {
- return this.selfTime / this.tree.totalTime * 100.0;
- },
-
- get totalPercent()
- {
- return this.totalTime / this.tree.totalTime * 100.0;
- },
-
- get _parent()
- {
- return this.parent !== this.dataGrid ? this.parent : this.tree;
- },
-
- _populate: function(event)
- {
- this._sharedPopulate();
-
- if (this._parent) {
- var currentComparator = this._parent.lastComparator;
-
- if (currentComparator)
- this.sort(currentComparator, true);
- }
-
- if (this.removeEventListener)
- this.removeEventListener("populate", this._populate, this);
- },
-
- // When focusing and collapsing we modify lots of nodes in the tree.
- // This allows us to restore them all to their original state when we revert.
- _save: function()
- {
- if (this._savedChildren)
- return;
-
- this._savedSelfTime = this.selfTime;
- this._savedTotalTime = this.totalTime;
- this._savedNumberOfCalls = this.numberOfCalls;
-
- this._savedChildren = this.children.slice();
- },
-
- // When focusing and collapsing we modify lots of nodes in the tree.
- // This allows us to restore them all to their original state when we revert.
- _restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.selfTime = this._savedSelfTime;
- this.totalTime = this._savedTotalTime;
- this.numberOfCalls = this._savedNumberOfCalls;
-
- this.removeChildren();
-
- var children = this._savedChildren;
- var count = children.length;
-
- for (var index = 0; index < count; ++index) {
- children[index]._restore();
- this.appendChild(children[index]);
- }
- },
-
- _merge: function(child, shouldAbsorb)
- {
- this.selfTime += child.selfTime;
-
- if (!shouldAbsorb) {
- this.totalTime += child.totalTime;
- this.numberOfCalls += child.numberOfCalls;
- }
-
- var children = this.children.slice();
-
- this.removeChildren();
-
- var count = children.length;
-
- for (var index = 0; index < count; ++index) {
- if (!shouldAbsorb || children[index] !== child)
- this.appendChild(children[index]);
- }
-
- children = child.children.slice();
- count = children.length;
-
- for (var index = 0; index < count; ++index) {
- var orphanedChild = children[index],
- existingChild = this.childrenByCallUID[orphanedChild.callUID];
-
- if (existingChild)
- existingChild._merge(orphanedChild, false);
- else
- this.appendChild(orphanedChild);
- }
- },
-
- _linkifyLocation: function(url, lineNumber, className)
- {
- // FIXME: CPUProfileNode's need columnNumbers.
- return WebInspector.linkifyLocation(url, lineNumber, 0, className);
- }
-}
-
-WebInspector.ProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
-
-WebInspector.ProfileDataGridTree = function(profileView, profileNode)
-{
- this.tree = this;
- this.children = [];
-
- this.profileView = profileView;
-
- this.totalTime = profileNode.totalTime;
- this.lastComparator = null;
-
- this.childrenByCallUID = {};
-}
-
-WebInspector.ProfileDataGridTree.prototype = {
- get expanded()
- {
- return true;
- },
-
- appendChild: function(child)
- {
- this.insertChild(child, this.children.length);
- },
-
- insertChild: function(child, index)
- {
- this.children.splice(index, 0, child);
- this.childrenByCallUID[child.callUID] = child;
- },
-
- removeChildren: function()
- {
- this.children = [];
- this.childrenByCallUID = {};
- },
-
- findChild: WebInspector.ProfileDataGridNode.prototype.findChild,
- sort: WebInspector.ProfileDataGridNode.prototype.sort,
-
- _save: function()
- {
- if (this._savedChildren)
- return;
-
- this._savedTotalTime = this.totalTime;
- this._savedChildren = this.children.slice();
- },
-
- restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.children = this._savedChildren;
- this.totalTime = this._savedTotalTime;
-
- var children = this.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- children[index]._restore();
-
- this._savedChildren = null;
- }
-}
-
-WebInspector.ProfileDataGridTree.propertyComparators = [{}, {}];
-
-WebInspector.ProfileDataGridTree.propertyComparator = function(/*String*/ property, /*Boolean*/ isAscending)
-{
- var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
-
- if (!comparator) {
- if (isAscending) {
- comparator = function(lhs, rhs)
- {
- if (lhs[property] < rhs[property])
- return -1;
-
- if (lhs[property] > rhs[property])
- return 1;
-
- return 0;
- };
- } else {
- comparator = function(lhs, rhs)
- {
- if (lhs[property] > rhs[property])
- return -1;
-
- if (lhs[property] < rhs[property])
- return 1;
-
- return 0;
- };
- }
-
- this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
- }
-
- return comparator;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,226 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.ProfileManager = function()
-{
- WebInspector.Object.call(this);
-
- this._javaScriptProfileType = new WebInspector.JavaScriptProfileType;
- this._canvasProfileType = new WebInspector.CanvasProfileType;
-
- if (window.ProfilerAgent) {
- ProfilerAgent.enable();
- ProfilerAgent.getProfileHeaders();
- }
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
- this.initialize();
-};
-
-WebInspector.ProfileManager.Event = {
- ProfileWasAdded: "profile-manager-profile-was-added",
- ProfileWasUpdated: "profile-manager-profile-was-updated",
- ProfilingStarted: "profile-manager-profiling-started",
- ProfilingEnded: "profile-manager-profiling-ended",
- ProfilingInterrupted: "profile-manager-profiling-interrupted",
- Cleared: "profile-manager-cleared"
-};
-
-WebInspector.ProfileManager.UserInitiatedProfileName = "org.webkit.profiles.user-initiated";
-
-WebInspector.ProfileManager.prototype = {
- constructor: WebInspector.ProfileManager,
-
- // Public
-
- initialize: function()
- {
- this._checkForInterruptions();
-
- this._recordingJavaScriptProfile = null;
- this._recordingCanvasProfile = null;
-
- this._isProfiling = false;
-
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.Cleared);
- },
-
- isProfilingJavaScript: function()
- {
- return this._javaScriptProfileType.isRecordingProfile();
- },
-
- startProfilingJavaScript: function()
- {
- this._javaScriptProfileType.startRecordingProfile();
- },
-
- stopProfilingJavaScript: function()
- {
- this._javaScriptProfileType.stopRecordingProfile();
- },
-
- isProfilingCanvas: function()
- {
- return this._canvasProfileType.isRecordingProfile();
- },
-
- startProfilingCanvas: function()
- {
- this._canvasProfileType.startRecordingProfile();
-
- var id = this._canvasProfileType.nextProfileId();
- this._recordingCanvasProfile = new WebInspector.CanvasProfileObject(WebInspector.UIString("Canvas Profile %d").format(id), id, true);
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasAdded, {profile: this._recordingCanvasProfile});
-
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingStarted);
- },
-
- stopProfilingCanvas: function()
- {
- function canvasProfilingStopped(error, profile)
- {
- if (error)
- return;
-
- console.assert(this._recordingCanvasProfile);
-
- this._recordingCanvasProfile.data = profile.data;
- this._recordingCanvasProfile.recording = false;
-
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasUpdated, {profile: this._recordingCanvasProfile});
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingEnded, {profile: this._recordingCanvasProfile});
-
- this._recordingCanvasProfile = null;
- }
-
- this._canvasProfileType.stopRecordingProfile(canvasProfilingStopped.bind(this));
- },
-
- profileWasStartedFromConsole: function(title)
- {
- this.setRecordingJavaScriptProfile(true, true);
-
- if (title.indexOf(WebInspector.ProfileManager.UserInitiatedProfileName) === -1) {
- this._recordingJavaScriptProfile.title = title;
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
- }
- },
-
- profileWasEndedFromConsole: function()
- {
- this.setRecordingJavaScriptProfile(false, true);
- },
-
- addJavaScriptProfile: function(profile)
- {
- console.assert(this._recordingJavaScriptProfile);
- if (!this._recordingJavaScriptProfile)
- return;
-
- this._recordingJavaScriptProfile.type = profile.typeId;
- this._recordingJavaScriptProfile.title = profile.title;
- this._recordingJavaScriptProfile.id = profile.uid;
- this._recordingJavaScriptProfile.recording = false;
-
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
-
- // We want to reset _recordingJavaScriptProfile so that we can identify
- // interruptions, but we also want to keep track of the last profile
- // we've recorded so that we can provide it as data to the ProfilingEnded event
- // we'll dispatch in setRecordingJavaScriptProfile().
- this._lastJavaScriptProfileAdded = this._recordingJavaScriptProfile;
- this._recordingJavaScriptProfile = null;
- },
-
- setRecordingJavaScriptProfile: function(isProfiling, fromConsole)
- {
- if (this._isProfiling === isProfiling)
- return;
-
- this._isProfiling = isProfiling;
-
- // We've interrupted the current JS profile due to a page reload. Return
- // now and _attemptToResumeProfiling will pick things up after the reload.
- if (!isProfiling && !!this._recordingJavaScriptProfile)
- return;
-
- if (isProfiling && !this._recordingJavaScriptProfile)
- this._recordingJavaScriptProfile = new WebInspector.JavaScriptProfileObject(WebInspector.ProfileManager.UserInitiatedProfileName, -1, true);
-
- if (isProfiling) {
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasAdded, {profile: this._recordingJavaScriptProfile});
- if (!fromConsole)
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingStarted);
- } else {
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingEnded, {
- profile: this._lastJavaScriptProfileAdded,
- fromConsole: fromConsole
- });
- this._lastJavaScriptProfileAdded = null;
- }
- },
-
- // Private
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- var oldMainResource = event.data.oldMainResource;
- var newMainResource = event.target.mainResource;
- if (oldMainResource.url !== newMainResource.url)
- this.initialize();
- else
- this._attemptToResumeProfiling();
- },
-
- _checkForInterruptions: function()
- {
- if (this._recordingJavaScriptProfile) {
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
- this._javaScriptProfileType.setRecordingProfile(false);
- } else if (this._recordingCanvasProfile) {
- this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCanvasProfile});
- this._canvasProfileType.setRecordingProfile(false);
- }
- },
-
- _attemptToResumeProfiling: function()
- {
- this._checkForInterruptions();
-
- if (this._recordingJavaScriptProfile)
- this.startProfilingJavaScript();
- else if (this._recordingCanvasProfile)
- this.startProfilingCanvas();
- }
-};
-
-WebInspector.ProfileManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileObject.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileObject.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileObject.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,93 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.ProfileObject = function(type, title, id, isRecording)
-{
- WebInspector.Object.call(this);
-
- console.assert(type);
- console.assert(title);
- console.assert(id);
-
- this._type = type;
- this._title = title;
- this._id = id;
- this._isRecording = isRecording || false;
-};
-
-WebInspector.ProfileObject.Event = {
- FinshedRecording: "profile-object-finished-recording"
-};
-
-WebInspector.ProfileObject.prototype = {
- constructor: WebInspector.ProfileObject,
-
- get type()
- {
- return this._type;
- },
-
- set type(type)
- {
- this._type = type;
- },
-
- get title()
- {
- return this._title;
- },
-
- set title(title)
- {
- this._title = title;
- },
-
- get id()
- {
- return this._id;
- },
-
- set id(id)
- {
- this._id = id;
- },
-
- get recording()
- {
- return this._isRecording;
- },
-
- set recording(flag)
- {
- if (this._isRecording === flag)
- return;
-
- this._isRecording = flag;
- if (!flag)
- this.dispatchEventToListeners(WebInspector.ProfileObject.Event.FinshedRecording);
- }
-};
-
-WebInspector.ProfileObject.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileTypejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileType.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileType.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileType.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 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. ``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
- * 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.ProfileType = function(id, name)
-{
- this._id = id;
- this._name = name;
-}
-
-WebInspector.ProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
-WebInspector.ProfileType.ProfileScheme = "webkit-profile";
-
-WebInspector.ProfileType.prototype = {
- get buttonTooltip()
- {
- return "";
- },
-
- get id()
- {
- return this._id;
- },
-
- get treeItemTitle()
- {
- return this._name;
- },
-
- get name()
- {
- return this._name;
- },
-
- buttonClicked: function()
- {
- },
-
- viewForProfile: function(profile)
- {
- if (!profile._profileView)
- profile._profileView = this.createView(profile);
- return profile._profileView;
- },
-
- reset: function()
- {
- },
-
- get description()
- {
- return "";
- },
-
- // Must be implemented by subclasses.
- createView: function(profile)
- {
- throw new Error("Needs implemented.");
- },
-
- // Must be implemented by subclasses.
- createSidebarTreeElementForProfile: function(profile)
- {
- throw new Error("Needs implemented.");
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileView.css (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileView.css        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileView.css        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.
- */
-
-.recording-profile-view {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-
- display: -webkit-flex;
- -webkit-flex-flow: row nowrap;
- -webkit-justify-content: center;
- -webkit-align-content: center;
- -webkit-align-items: center;
-
- background-color: rgb(232, 232, 232);
-}
-
-.recording-profile-view > .indeterminate-progress-spinner {
- position: static;
- margin: 0;
-}
-
-.recording-profile-view > span {
- font-family: 'Lucida Grande', Helvetica, sans-serif;
- font-size: 14px;
-
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
- color: rgb(60, 60, 60);
-
- padding-left: 10px;
-
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileView.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileView.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileView.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,109 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.ProfileView = function(profile, settingId)
-{
- WebInspector.ContentView.call(this, profile);
-
- this._profile = profile;
-
- this.element.classList.add("profile-view");
-
- this.showTimeAsPercent = new WebInspector.Setting(settingId, true);
- this.showTimeAsPercentNavigationItem = new WebInspector.ActivateButtonNavigationItem("selector-profiler-show-time-as-percent-navigation-item", WebInspector.UIString("Show times as percentages"), WebInspector.UIString("Show times as absolute times"), "Images/Percent.svg", 16, 16);
- this.showTimeAsPercentNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleTimeDisplay, this);
- this.showTimeAsPercentNavigationItem.activated = this.showTimeAsPercent.value;
-
- if (profile.recording) {
- this._showRecordingMessage();
- profile.addEventListener(WebInspector.ProfileObject.Event.FinshedRecording, this._profileFinishedRecording, this);
- } else
- this.displayProfile();
-};
-
-WebInspector.ProfileView.prototype = {
- constructor: WebInspector.ProfileView,
-
- // Public
-
- get navigationItems()
- {
- return [this.showTimeAsPercentNavigationItem];
- },
-
- get allowedNavigationSidebarPanels()
- {
- return ["instrument"];
- },
-
- get profile()
- {
- return this._profile;
- },
-
- set profile(profile)
- {
- this._profile = profile;
- },
-
- toggleTimeDisplay: function(event)
- {
- this.showTimeAsPercentNavigationItem.activated = !this.showTimeAsPercentNavigationItem.activated;
- },
-
- displayProfile: function()
- {
- // Implemented by subclasses.
- },
-
- get recordingTitle()
- {
- return WebInspector.UIString("Recording\u2026");
- },
-
- // Private
-
- _profileFinishedRecording: function()
- {
- this._hideRecordingMessage();
- this.displayProfile();
- },
-
- _showRecordingMessage: function()
- {
- this._recordingMessageContainer = this.element.appendChild(document.createElement("div"));
- this._recordingMessageContainer.className = "recording-profile-view";
- this._recordingMessageContainer.appendChild(new WebInspector.IndeterminateProgressSpinner().element);
- this._recordingMessageContainer.appendChild(document.createElement("span")).textContent = this.recordingTitle;
- },
-
- _hideRecordingMessage: function()
- {
- if (this._recordingMessageContainer)
- this._recordingMessageContainer.remove();
- }
-};
-
-WebInspector.ProfileView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfilerObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfilerObserver.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfilerObserver.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfilerObserver.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.ProfilerObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.ProfilerObserver.prototype = {
- constructor: WebInspector.ProfilerObserver,
-
- // Events defined by the "Profiler" domain.
-
- resetProfiles: function()
- {
- // FIXME: Implement this.
- },
-
- addProfileHeader: function(profile)
- {
- WebInspector.profileManager.addJavaScriptProfile(profile);
- },
-
- addHeapSnapshotChunk: function(uid, chunk)
- {
- // FIXME: Implement this (we need heap snapshots).
- },
-
- finishHeapSnapshot: function(uid)
- {
- // FIXME: Implement this (we need heap snapshots).
- },
-
- setRecordingProfile: function(isProfiling)
- {
- WebInspector.profileManager.setRecordingJavaScriptProfile(isProfiling);
- },
-
- reportHeapSnapshotProgress: function(done, total)
- {
- // FIXME: Implement this (we need heap snapshots).
- }
-
-};
-
-WebInspector.ProfilerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTopDownProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js (163137 => 163138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js        2014-01-31 01:08:54 UTC (rev 163137)
+++ trunk/Source/WebInspectorUI/UserInterface/TopDownProfileDataGridTree.js        2014-01-31 01:34:19 UTC (rev 163138)
</span><span class="lines">@@ -1,121 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North 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. ``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
- * 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.TopDownProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*TopDownProfileDataGridTree*/ owningTree)
-{
- var hasChildren = (profileNode.children && profileNode.children.length);
-
- WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, hasChildren);
-
- this._remainingChildren = profileNode.children;
-}
-
-WebInspector.TopDownProfileDataGridNode.prototype = {
- _sharedPopulate: function()
- {
- var children = this._remainingChildren;
- var childrenLength = children.length;
-
- for (var i = 0; i < childrenLength; ++i)
- this.appendChild(new WebInspector.TopDownProfileDataGridNode(this.profileView, children[i], this.tree));
-
- this._remainingChildren = null;
- },
-
- _exclude: function(aCallUID)
- {
- if (this._remainingChildren)
- this._populate();
-
- this._save();
-
- var children = this.children;
- var index = this.children.length;
-
- while (index--)
- children[index]._exclude(aCallUID);
-
- var child = this.childrenByCallUID[aCallUID];
-
- if (child)
- this._merge(child, true);
- }
-}
-
-WebInspector.TopDownProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;
-
-WebInspector.TopDownProfileDataGridTree = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode)
-{
- WebInspector.ProfileDataGridTree.call(this, profileView, profileNode);
-
- this._remainingChildren = profileNode.children;
-
- WebInspector.TopDownProfileDataGridNode.prototype._populate.call(this);
-}
-
-WebInspector.TopDownProfileDataGridTree.prototype = {
- focus: function(/*ProfileDataGridNode*/ profileDataGrideNode)
- {
- if (!profileDataGrideNode)
- return;
-
- this._save();
- profileDataGrideNode.savePosition();
-
- this.children = [profileDataGrideNode];
- this.totalTime = profileDataGrideNode.totalTime;
- },
-
- exclude: function(/*ProfileDataGridNode*/ profileDataGrideNode)
- {
- if (!profileDataGrideNode)
- return;
-
- this._save();
-
- var excludedCallUID = profileDataGrideNode.callUID;
-
- WebInspector.TopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);
-
- if (this.lastComparator)
- this.sort(this.lastComparator, true);
- },
-
- restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.children[0].restorePosition();
-
- WebInspector.ProfileDataGridTree.prototype.restore.call(this);
- },
-
- _merge: WebInspector.TopDownProfileDataGridNode.prototype._merge,
-
- _sharedPopulate: WebInspector.TopDownProfileDataGridNode.prototype._sharedPopulate
-}
-
-WebInspector.TopDownProfileDataGridTree.prototype.__proto__ = WebInspector.ProfileDataGridTree.prototype;
</del></span></pre>
</div>
</div>
</body>
</html>