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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 return WebInspector.UIString("CPU PROFILES"); | 673 return WebInspector.UIString("CPU PROFILES"); |
674 }, | 674 }, |
675 | 675 |
676 get description() | 676 get description() |
677 { | 677 { |
678 return WebInspector.UIString("CPU profiles show where the execution time
is spent in your page's JavaScript functions."); | 678 return WebInspector.UIString("CPU profiles show where the execution time
is spent in your page's JavaScript functions."); |
679 }, | 679 }, |
680 | 680 |
681 /** | 681 /** |
682 * @param {string} id | 682 * @param {string} id |
683 * @param {!DebuggerAgent.Location} scriptLocation | 683 * @param {!WebInspector.DebuggerModel.Location} scriptLocation |
684 * @param {string=} title | 684 * @param {string=} title |
685 */ | 685 */ |
686 consoleProfileStarted: function(id, scriptLocation, title) | 686 consoleProfileStarted: function(id, scriptLocation, title) |
687 { | 687 { |
688 var resolvedTitle = title; | 688 var resolvedTitle = title; |
689 if (!resolvedTitle) { | 689 if (!resolvedTitle) { |
690 resolvedTitle = WebInspector.UIString("Profile %s", this._nextAnonym
ousConsoleProfileNumber++); | 690 resolvedTitle = WebInspector.UIString("Profile %s", this._nextAnonym
ousConsoleProfileNumber++); |
691 this._anonymousConsoleProfileIdToTitle[id] = resolvedTitle; | 691 this._anonymousConsoleProfileIdToTitle[id] = resolvedTitle; |
692 } | 692 } |
693 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
e, scriptLocation, WebInspector.UIString("Profile '%s' started.", resolvedTitle)
); | 693 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
e, scriptLocation, WebInspector.UIString("Profile '%s' started.", resolvedTitle)
); |
694 }, | 694 }, |
695 | 695 |
696 /** | 696 /** |
697 * @param {string} protocolId | 697 * @param {string} protocolId |
698 * @param {!DebuggerAgent.Location} scriptLocation | 698 * @param {!WebInspector.DebuggerModel.Location} scriptLocation |
699 * @param {!ProfilerAgent.CPUProfile} cpuProfile | 699 * @param {!ProfilerAgent.CPUProfile} cpuProfile |
700 * @param {string=} title | 700 * @param {string=} title |
701 */ | 701 */ |
702 consoleProfileFinished: function(protocolId, scriptLocation, cpuProfile, tit
le) | 702 consoleProfileFinished: function(protocolId, scriptLocation, cpuProfile, tit
le) |
703 { | 703 { |
704 var resolvedTitle = title; | 704 var resolvedTitle = title; |
705 if (typeof title === "undefined") { | 705 if (typeof title === "undefined") { |
706 resolvedTitle = this._anonymousConsoleProfileIdToTitle[protocolId]; | 706 resolvedTitle = this._anonymousConsoleProfileIdToTitle[protocolId]; |
707 delete this._anonymousConsoleProfileIdToTitle[protocolId]; | 707 delete this._anonymousConsoleProfileIdToTitle[protocolId]; |
708 } | 708 } |
709 | 709 |
710 var profile = new WebInspector.CPUProfileHeader(this, resolvedTitle); | 710 var profile = new WebInspector.CPUProfileHeader(this, resolvedTitle); |
711 profile.setProtocolProfile(cpuProfile); | 711 profile.setProtocolProfile(cpuProfile); |
712 this.addProfile(profile); | 712 this.addProfile(profile); |
713 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
eEnd, scriptLocation, WebInspector.UIString("Profile '%s' finished.", resolvedTi
tle)); | 713 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
eEnd, scriptLocation, WebInspector.UIString("Profile '%s' finished.", resolvedTi
tle)); |
714 }, | 714 }, |
715 | 715 |
716 /** | 716 /** |
717 * @param {string} type | 717 * @param {string} type |
718 * @param {!DebuggerAgent.Location} scriptLocation | 718 * @param {!WebInspector.DebuggerModel.Location} scriptLocation |
719 * @param {string} messageText | 719 * @param {string} messageText |
720 */ | 720 */ |
721 _addMessageToConsole: function(type, scriptLocation, messageText) | 721 _addMessageToConsole: function(type, scriptLocation, messageText) |
722 { | 722 { |
723 var script = WebInspector.debuggerModel.scriptForId(scriptLocation.scrip
tId); | 723 var script = scriptLocation.script(); |
724 var message = new WebInspector.ConsoleMessage( | 724 var message = new WebInspector.ConsoleMessage( |
725 WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, | 725 WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, |
726 WebInspector.ConsoleMessage.MessageLevel.Debug, | 726 WebInspector.ConsoleMessage.MessageLevel.Debug, |
727 messageText, | 727 messageText, |
728 type, | 728 type, |
729 undefined, | 729 undefined, |
730 undefined, | 730 undefined, |
731 undefined, | 731 undefined, |
732 undefined, | 732 undefined, |
733 undefined, | 733 undefined, |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 | 1385 |
1386 /** | 1386 /** |
1387 * @param {number} entryIndex | 1387 * @param {number} entryIndex |
1388 * @return {!string} | 1388 * @return {!string} |
1389 */ | 1389 */ |
1390 textColor: function(entryIndex) | 1390 textColor: function(entryIndex) |
1391 { | 1391 { |
1392 return "#333"; | 1392 return "#333"; |
1393 } | 1393 } |
1394 } | 1394 } |
OLD | NEW |