Title: [116855] trunk/Source/WebCore
- Revision
- 116855
- Author
- [email protected]
- Date
- 2012-05-12 06:54:27 -0700 (Sat, 12 May 2012)
Log Message
Web Inspector: move recording button state control out of addProfileHeader.
https://bugs.webkit.org/show_bug.cgi?id=86293
Reviewed by Yury Semikhatsky.
* inspector/front-end/CSSSelectorProfileView.js:
(WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
* inspector/front-end/ProfileView.js:
(WebInspector.CPUProfileType.prototype.buttonClicked):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfileType.prototype.buttonClicked):
(WebInspector.ProfilesPanel.prototype.toggleRecordButton):
(WebInspector.ProfilesPanel.prototype.addProfileHeader):
(WebInspector.ProfilesPanel.prototype.setRecordingProfile):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot.done):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (116854 => 116855)
--- trunk/Source/WebCore/ChangeLog 2012-05-12 13:39:09 UTC (rev 116854)
+++ trunk/Source/WebCore/ChangeLog 2012-05-12 13:54:27 UTC (rev 116855)
@@ -1,3 +1,24 @@
+2012-05-12 Ilya Tikhonovsky <[email protected]>
+
+ Web Inspector: move recording button state control out of addProfileHeader.
+ https://bugs.webkit.org/show_bug.cgi?id=86293
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/CSSSelectorProfileView.js:
+ (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ * inspector/front-end/ProfileView.js:
+ (WebInspector.CPUProfileType.prototype.buttonClicked):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfileType.prototype.buttonClicked):
+ (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
+ (WebInspector.ProfilesPanel.prototype.addProfileHeader):
+ (WebInspector.ProfilesPanel.prototype.setRecordingProfile):
+ (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot.done):
+ (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
+
2012-05-12 Eugene Klyuchnikov <[email protected]>
Web Inspector: Turn HelpScreen to be View.
Modified: trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js (116854 => 116855)
--- trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js 2012-05-12 13:39:09 UTC (rev 116854)
+++ trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js 2012-05-12 13:54:27 UTC (rev 116855)
@@ -283,12 +283,19 @@
return this._recording ? WebInspector.UIString("Stop CSS selector profiling.") : WebInspector.UIString("Start CSS selector profiling.");
},
+ /**
+ * @override
+ * @return {boolean}
+ */
buttonClicked: function()
{
- if (this._recording)
+ if (this._recording) {
this.stopRecordingProfile();
- else
+ return false;
+ } else {
this.startRecordingProfile();
+ return true;
+ }
},
get treeItemTitle()
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js (116854 => 116855)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js 2012-05-12 13:39:09 UTC (rev 116854)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js 2012-05-12 13:54:27 UTC (rev 116855)
@@ -727,9 +727,14 @@
return WebInspector.UIString("Take heap snapshot.");
},
+ /**
+ * @override
+ * @return {boolean}
+ */
buttonClicked: function()
{
WebInspector.panels.profiles.takeHeapSnapshot();
+ return false;
},
get treeItemTitle()
Modified: trunk/Source/WebCore/inspector/front-end/ProfileView.js (116854 => 116855)
--- trunk/Source/WebCore/inspector/front-end/ProfileView.js 2012-05-12 13:39:09 UTC (rev 116854)
+++ trunk/Source/WebCore/inspector/front-end/ProfileView.js 2012-05-12 13:54:27 UTC (rev 116855)
@@ -564,14 +564,20 @@
return this._recording ? WebInspector.UIString("Stop CPU profiling.") : WebInspector.UIString("Start CPU profiling.");
},
+ /**
+ * @override
+ * @return {boolean}
+ */
buttonClicked: function()
{
if (this._recording) {
this.stopRecordingProfile();
WebInspector.networkManager.enableResourceTracking();
+ return false;
} else {
WebInspector.networkManager.disableResourceTracking();
this.startRecordingProfile();
+ return true;
}
},
Modified: trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js (116854 => 116855)
--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js 2012-05-12 13:39:09 UTC (rev 116854)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js 2012-05-12 13:54:27 UTC (rev 116855)
@@ -57,8 +57,12 @@
return this._name;
},
+ /**
+ * @return {boolean}
+ */
buttonClicked: function()
{
+ return false;
},
viewForProfile: function(profile)
@@ -280,7 +284,8 @@
toggleRecordButton: function()
{
- this._selectedProfileType.buttonClicked();
+ var isProfiling = this._selectedProfileType.buttonClicked();
+ this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
},
wasShown: function()
@@ -491,14 +496,7 @@
if (!this.visibleView)
this.showProfile(profile);
this.dispatchEventToListeners("profile added");
- this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
- this.recordButton.toggled = false;
- } else {
- this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileStarted);
- this.recordButton.toggled = true;
}
-
- this.recordButton.title = this._selectedProfileType.buttonTooltip;
},
/**
@@ -1005,6 +1003,9 @@
this.addProfileHeader(temporaryProfile);
else
this._removeTemporaryProfile(profileType);
+ this.recordButton.toggled = isProfiling;
+ this.recordButton.title = profileTypeObject.buttonTooltip;
+ this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
},
takeHeapSnapshot: function()
@@ -1014,7 +1015,11 @@
var profileTypeObject = this.getProfileType(WebInspector.HeapSnapshotProfileType.TypeId);
this.addProfileHeader(profileTypeObject.createTemporaryProfile());
}
- ProfilerAgent.takeHeapSnapshot();
+ this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileStarted);
+ function done() {
+ this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
+ }
+ ProfilerAgent.takeHeapSnapshot(done.bind(this));
WebInspector.userMetrics.ProfilesHeapProfileTaken.record();
},
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes