Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: Source/devtools/front_end/CPUProfileView.js

Issue 147923011: Remove unnecessary _profileTypesByIdMap map (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 this.addProfile(profile); 727 this.addProfile(profile);
728 728
729 var messageElement = document.createElement("span"); 729 var messageElement = document.createElement("span");
730 messageElement.createTextChild("Profile '"); 730 messageElement.createTextChild("Profile '");
731 var a = messageElement.createChild("span", "link"); 731 var a = messageElement.createChild("span", "link");
732 a.title = resolvedTitle; 732 a.title = resolvedTitle;
733 a.textContent = resolvedTitle; 733 a.textContent = resolvedTitle;
734 a.addEventListener("click", onClick.bind(this), true); 734 a.addEventListener("click", onClick.bind(this), true);
735 function onClick(event) 735 function onClick(event)
736 { 736 {
737 WebInspector.showPanel("profiles").showProfile(WebInspector.CPUProfi leType.TypeId, id); 737 var profile = WebInspector.ProfileTypeRegistry.instance.cpuProfileTy pe.getProfile(id);
738 if (profile)
739 WebInspector.showPanel("profiles").showProfile(profile);
738 } 740 }
739 messageElement.createTextChild("' finished."); 741 messageElement.createTextChild("' finished.");
740 742
741 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil eEnd, scriptLocation, messageElement); 743 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil eEnd, scriptLocation, messageElement);
742 }, 744 },
743 745
744 /** 746 /**
745 * @param {string} type 747 * @param {string} type
746 * @param {!DebuggerAgent.Location} scriptLocation 748 * @param {!DebuggerAgent.Location} scriptLocation
747 * @param {!Node} messageElement 749 * @param {!Node} messageElement
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 { 804 {
803 if (!this._profileBeingRecorded) 805 if (!this._profileBeingRecorded)
804 return; 806 return;
805 this._profileBeingRecorded.setProtocolProfile(profile); 807 this._profileBeingRecorded.setProtocolProfile(profile);
806 808
807 var title = WebInspector.UIString("Profile %d", this._profileBeingRe corded.uid); 809 var title = WebInspector.UIString("Profile %d", this._profileBeingRe corded.uid);
808 this._profileBeingRecorded.title = title; 810 this._profileBeingRecorded.title = title;
809 this._profileBeingRecorded.sidebarElement.mainTitle = title; 811 this._profileBeingRecorded.sidebarElement.mainTitle = title;
810 var recordedProfile = this._profileBeingRecorded; 812 var recordedProfile = this._profileBeingRecorded;
811 this._profileBeingRecorded = null; 813 this._profileBeingRecorded = null;
812 WebInspector.panels.profiles._showProfile(recordedProfile); 814 WebInspector.panels.profiles.showProfile(recordedProfile);
813 } 815 }
814 ProfilerAgent.stop(didStopProfiling.bind(this)); 816 ProfilerAgent.stop(didStopProfiling.bind(this));
815 }, 817 },
816 818
817 /** 819 /**
818 * @override 820 * @override
819 * @param {string} title 821 * @param {string} title
820 * @return {!WebInspector.ProfileHeader} 822 * @return {!WebInspector.ProfileHeader}
821 */ 823 */
822 createProfileLoadedFromFile: function(title) 824 createProfileLoadedFromFile: function(title)
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 /** 1249 /**
1248 * @param {number} entryIndex 1250 * @param {number} entryIndex
1249 * @return {!Object} 1251 * @return {!Object}
1250 */ 1252 */
1251 entryData: function(entryIndex) 1253 entryData: function(entryIndex)
1252 { 1254 {
1253 return this._timelineData.entryNodes[entryIndex]; 1255 return this._timelineData.entryNodes[entryIndex];
1254 } 1256 }
1255 } 1257 }
1256 1258
OLDNEW
« no previous file with comments | « LayoutTests/inspector/profiler/profiler-test.js ('k') | Source/devtools/front_end/HeapSnapshotView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698