| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 /** | 586 /** |
| 587 * @param {ProfilerAgent.CPUProfile} profile | 587 * @param {ProfilerAgent.CPUProfile} profile |
| 588 */ | 588 */ |
| 589 _injectIdleTimeNode: function(profile) | 589 _injectIdleTimeNode: function(profile) |
| 590 { | 590 { |
| 591 var idleTime = profile.idleTime; | 591 var idleTime = profile.idleTime; |
| 592 var nodes = profile.head.children; | 592 var nodes = profile.head.children; |
| 593 | 593 |
| 594 var programNode = {selfTime: 0}; | 594 var programNode = {selfTime: 0}; |
| 595 for (var i = nodes.length - 1; i >= 0; --i) { | 595 for (var i = nodes.length - 1; i >= 0; --i) { |
| 596 if (nodes[i].functionName === "(program)") { | 596 // TODO(alph): Remove (program) after corresponding V8 revision arri
ves. |
| 597 if (nodes[i].functionName === "(program)" || nodes[i].functionName =
== "(native)") { |
| 597 programNode = nodes[i]; | 598 programNode = nodes[i]; |
| 598 break; | 599 break; |
| 599 } | 600 } |
| 600 } | 601 } |
| 601 var programTime = programNode.selfTime; | 602 var programTime = programNode.selfTime; |
| 602 if (idleTime > programTime) | 603 if (idleTime > programTime) |
| 603 idleTime = programTime; | 604 idleTime = programTime; |
| 604 programTime = programTime - idleTime; | 605 programTime = programTime - idleTime; |
| 605 programNode.selfTime = programTime; | 606 programNode.selfTime = programTime; |
| 606 programNode.totalTime = programTime; | 607 programNode.totalTime = programTime; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 this.title = file.name; | 916 this.title = file.name; |
| 916 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); | 917 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); |
| 917 this.sidebarElement.wait = true; | 918 this.sidebarElement.wait = true; |
| 918 | 919 |
| 919 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this
); | 920 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this
); |
| 920 fileReader.start(this); | 921 fileReader.start(this); |
| 921 }, | 922 }, |
| 922 | 923 |
| 923 __proto__: WebInspector.ProfileHeader.prototype | 924 __proto__: WebInspector.ProfileHeader.prototype |
| 924 } | 925 } |
| OLD | NEW |