Changeset 118503 in webkit
- Timestamp:
- May 25, 2012 2:44:42 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118501 r118503 1 2012-05-25 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: make some profiler methods private 4 https://bugs.webkit.org/show_bug.cgi?id=87479 5 6 Reviewed by Vsevolod Vlasov. 7 8 - Removed unused methods. 9 - Renamed private methods so that their names start with underscore. 10 - ProfileLauncherView methods are called directly from ProfilesPanel instead 11 of sending events. 12 13 * inspector/front-end/CPUProfileView.js: 14 * inspector/front-end/CSSSelectorProfileView.js: 15 (WebInspector.CSSSelectorProfileType.prototype.buttonClicked): 16 (WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile): 17 (WebInspector.CSSSelectorProfileType.prototype.createTemporaryProfile): 18 * inspector/front-end/ProfileLauncherView.js: 19 (WebInspector.ProfileLauncherView.prototype.profileStarted): 20 (WebInspector.ProfileLauncherView.prototype.profileFinished): 21 * inspector/front-end/ProfilesPanel.js: 22 (WebInspector.ProfileType.prototype.createProfile): 23 (WebInspector.ProfilesPanel.prototype.toggleRecordButton): 24 (WebInspector.ProfilesPanel.prototype._reset): 25 (WebInspector.ProfilesPanel.prototype._populateProfiles.populateCallback.var): 26 (WebInspector.ProfilesPanel.prototype._populateProfiles.populateCallback): 27 (WebInspector.ProfilesPanel.prototype._populateProfiles): 28 (WebInspector.ProfilesPanel.prototype.setRecordingProfile): 29 (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot.done): 30 (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot): 31 1 32 2012-05-25 Keishi Hattori <keishi@webkit.org> 2 33 -
trunk/Source/WebCore/inspector/front-end/CPUProfileView.js
r117582 r118503 113 113 }, 114 114 115 get profile()116 {117 return this._profile;118 },119 120 set profile(profile)121 {122 this._profile = profile;123 },124 125 115 get bottomUpProfileDataGridTree() 126 116 { -
trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js
r117581 r118503 292 292 { 293 293 if (this._recording) { 294 this. stopRecordingProfile();294 this._stopRecordingProfile(); 295 295 return false; 296 296 } else { 297 this. startRecordingProfile();297 this._startRecordingProfile(); 298 298 return true; 299 299 } … … 315 315 }, 316 316 317 isRecordingProfile: function()318 {319 return this._recording;320 },321 322 317 setRecordingProfile: function(isProfiling) 323 318 { … … 325 320 }, 326 321 327 startRecordingProfile: function()322 _startRecordingProfile: function() 328 323 { 329 324 this._recording = true; … … 332 327 }, 333 328 334 stopRecordingProfile: function()329 _stopRecordingProfile: function() 335 330 { 336 331 /** … … 363 358 title = title || WebInspector.UIString("Recording\u2026"); 364 359 return new WebInspector.CSSProfileHeader(this, title); 365 },366 367 /**368 * @override369 * @param {CSSAgent.SelectorProfile} profile370 * @return {WebInspector.ProfileHeader}371 */372 createProfile: function(profile)373 {374 throw new Error("Unreachable");375 360 } 376 361 } -
trunk/Source/WebCore/inspector/front-end/ProfileLauncherView.js
r117581 r118503 63 63 64 64 WebInspector.ProfileLauncherView.prototype = { 65 setUpEventListeners: function()66 {67 this._panel.addEventListener(WebInspector.ProfilesPanel.EventTypes.ProfileStarted, this._onProfileStarted, this);68 this._panel.addEventListener(WebInspector.ProfilesPanel.EventTypes.ProfileFinished, this._onProfileFinished, this);69 },70 71 65 /** 72 66 * @param {WebInspector.ProfileType} profileType … … 116 110 }, 117 111 118 _onProfileStarted: function(event)112 profileStarted: function() 119 113 { 120 114 this._isProfiling = true; … … 122 116 }, 123 117 124 _onProfileFinished: function(event)118 profileFinished: function() 125 119 { 126 120 this._isProfiling = false; -
trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js
r117940 r118503 89 89 }, 90 90 91 // Must be implemented by subclasses.92 91 /** 93 92 * @param {ProfilerAgent.ProfileHeader} profile … … 96 95 createProfile: function(profile) 97 96 { 98 throw new Error("N eeds implemented.");97 throw new Error("Not supported for " + this._name + " profiles."); 99 98 } 100 99 } … … 236 235 this._launcherView.addEventListener(WebInspector.ProfileLauncherView.EventTypes.ProfileTypeSelected, this._onProfileTypeSelected, this); 237 236 this._reset(); 238 this._launcherView.setUpEventListeners();239 237 240 238 this._registerProfileType(new WebInspector.CPUProfileType()); … … 253 251 254 252 WebInspector.ObjectPropertiesSection.addContextMenuProvider(new WebInspector.RevealInHeapSnapshotContextMenuProvider()); 255 }256 257 WebInspector.ProfilesPanel.EventTypes = {258 ProfileStarted: "profile-started",259 ProfileFinished: "profile-finished"260 253 } 261 254 … … 310 303 { 311 304 var isProfiling = this._selectedProfileType.buttonClicked(); 312 this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished); 305 if (isProfiling) 306 this._launcherView.profileStarted(); 307 else 308 this._launcherView.profileFinished(); 313 309 }, 314 310 … … 383 379 384 380 this.removeAllListeners(); 385 this._launcherView.setUpEventListeners();386 381 387 382 this._updateInterface(); … … 640 635 if (temporaryProfile) 641 636 this._removeProfileHeader(temporaryProfile); 642 },643 644 /**645 * @param {ProfilerAgent.ProfileHeader} profile646 */647 hasProfile: function(profile)648 {649 return !!this._profilesIdMap[this._makeKey(profile.uid, profile.typeId)];650 637 }, 651 638 … … 1003 990 for (var i = 0; i < profileHeadersLength; ++i) { 1004 991 var profileHeader = profileHeaders[i]; 1005 if (!this.hasProfile(profileHeader)) { 1006 var profileType = this.getProfileType(profileHeader.typeId); 1007 this.addProfileHeader(profileType.createProfile(profileHeader)); 1008 } 992 var profileType = this.getProfileType(profileHeader.typeId); 993 this.addProfileHeader(profileType.createProfile(profileHeader)); 1009 994 } 1010 995 } … … 1041 1026 this.recordButton.toggled = isProfiling; 1042 1027 this.recordButton.title = profileTypeObject.buttonTooltip; 1043 this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished); 1028 if (isProfiling) 1029 this._launcherView.profileStarted(); 1030 else 1031 this._launcherView.profileFinished(); 1044 1032 }, 1045 1033 … … 1051 1039 this.addProfileHeader(profileTypeObject.createTemporaryProfile()); 1052 1040 } 1053 this. dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileStarted);1041 this._launcherView.profileStarted(); 1054 1042 function done() { 1055 this. dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileFinished);1043 this._launcherView.profileFinished(); 1056 1044 } 1057 1045 ProfilerAgent.takeHeapSnapshot(done.bind(this));
Note: See TracChangeset
for help on using the changeset viewer.