diff options
author | Ben Murdoch <benm@google.com> | 2011-05-13 16:23:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-16 11:35:02 +0100 |
commit | 65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch) | |
tree | f478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/inspector/front-end/ProfilesPanel.js | |
parent | 47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff) | |
download | external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2 |
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/inspector/front-end/ProfilesPanel.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/ProfilesPanel.js | 75 |
1 files changed, 56 insertions, 19 deletions
diff --git a/Source/WebCore/inspector/front-end/ProfilesPanel.js b/Source/WebCore/inspector/front-end/ProfilesPanel.js index bff5be7..2e0ab28 100644 --- a/Source/WebCore/inspector/front-end/ProfilesPanel.js +++ b/Source/WebCore/inspector/front-end/ProfilesPanel.js @@ -124,7 +124,7 @@ WebInspector.ProfilesPanel = function() this._profiles = []; this._profilerEnabled = Preferences.profilerAlwaysEnabled; this._reset(); - InspectorBackend.registerDomainDispatcher("Profiler", this); + InspectorBackend.registerDomainDispatcher("Profiler", new WebInspector.ProfilerDispatcher(this)); } WebInspector.ProfilesPanel.prototype = { @@ -162,7 +162,7 @@ WebInspector.ProfilesPanel.prototype = { this._populateProfiles(); }, - profilerWasEnabled: function() + _profilerWasEnabled: function() { if (this._profilerEnabled) return; @@ -174,7 +174,7 @@ WebInspector.ProfilesPanel.prototype = { this._populateProfiles(); }, - profilerWasDisabled: function() + _profilerWasDisabled: function() { if (!this._profilerEnabled) return; @@ -183,11 +183,6 @@ WebInspector.ProfilesPanel.prototype = { this._reset(); }, - resetProfiles: function() - { - this._reset(); - }, - _reset: function() { for (var i = 0; i < this._profiles.length; ++i) @@ -262,7 +257,7 @@ WebInspector.ProfilesPanel.prototype = { return escape(text) + '/' + escape(profileTypeId); }, - addProfileHeader: function(profile) + _addProfileHeader: function(profile) { var typeId = profile.typeId; var profileType = this.getProfileType(typeId); @@ -327,7 +322,7 @@ WebInspector.ProfilesPanel.prototype = { } }, - removeProfileHeader: function(profile) + _removeProfileHeader: function(profile) { var typeId = profile.typeId; var profileType = this.getProfileType(typeId); @@ -432,7 +427,7 @@ WebInspector.ProfilesPanel.prototype = { } }, - addHeapSnapshotChunk: function(uid, chunk) + _addHeapSnapshotChunk: function(uid, chunk) { var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)]; if (!profile || profile._loaded || !profile._is_loading) @@ -441,7 +436,7 @@ WebInspector.ProfilesPanel.prototype = { profile._json += chunk; }, - finishHeapSnapshot: function(uid) + _finishHeapSnapshot: function(uid) { var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)]; if (!profile || profile._loaded || !profile._is_loading) @@ -600,7 +595,7 @@ WebInspector.ProfilesPanel.prototype = { var profileHeadersLength = profileHeaders.length; for (var i = 0; i < profileHeadersLength; ++i) if (!this.hasProfile(profileHeaders[i])) - WebInspector.panels.profiles.addProfileHeader(profileHeaders[i]); + this._addProfileHeader(profileHeaders[i]); } InspectorBackend.getProfileHeaders(populateCallback.bind(this)); @@ -616,22 +611,22 @@ WebInspector.ProfilesPanel.prototype = { this.resize(); }, - setRecordingProfile: function(isProfiling) + _setRecordingProfile: function(isProfiling) { this.getProfileType(WebInspector.CPUProfileType.TypeId).setRecordingProfile(isProfiling); if (this.hasTemporaryProfile(WebInspector.CPUProfileType.TypeId) !== isProfiling) { if (!this._temporaryRecordingProfile) { this._temporaryRecordingProfile = { typeId: WebInspector.CPUProfileType.TypeId, - title: WebInspector.UIString("Recording"), + title: WebInspector.UIString("Recording…"), uid: -1, isTemporary: true }; } if (isProfiling) - this.addProfileHeader(this._temporaryRecordingProfile); + this._addProfileHeader(this._temporaryRecordingProfile); else - this.removeProfileHeader(this._temporaryRecordingProfile); + this._removeProfileHeader(this._temporaryRecordingProfile); } this.updateProfileTypeButtons(); } @@ -639,6 +634,49 @@ WebInspector.ProfilesPanel.prototype = { WebInspector.ProfilesPanel.prototype.__proto__ = WebInspector.Panel.prototype; + +WebInspector.ProfilerDispatcher = function(profiler) +{ + this._profiler = profiler; +} + +WebInspector.ProfilerDispatcher.prototype = { + profilerWasEnabled: function() + { + this._profiler._profilerWasEnabled(); + }, + + profilerWasDisabled: function() + { + this._profiler._profilerWasDisabled(); + }, + + resetProfiles: function() + { + this._profiler._reset(); + }, + + addProfileHeader: function(profile) + { + this._profiler._addProfileHeader(profile); + }, + + addHeapSnapshotChunk: function(uid, chunk) + { + this._profiler._addHeapSnapshotChunk(uid, chunk); + }, + + finishHeapSnapshot: function(uid) + { + this._profiler._finishHeapSnapshot(uid); + }, + + setRecordingProfile: function(isProfiling) + { + this._profiler._setRecordingProfile(isProfiling); + } +} + WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className) { this.profile = profile; @@ -660,7 +698,7 @@ WebInspector.ProfileSidebarTreeElement.prototype = { ondelete: function() { - this.treeOutline.panel.removeProfileHeader(this.profile); + this.treeOutline.panel._removeProfileHeader(this.profile); return true; }, @@ -720,4 +758,3 @@ WebInspector.ProfileGroupSidebarTreeElement.prototype = { } WebInspector.ProfileGroupSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype; - |