RESOLVED FIXED 21412
Refactor user initiated profile count to be more stable
https://bugs.webkit.org/show_bug.cgi?id=21412
Summary Refactor user initiated profile count to be more stable
Kevin McCullough
Reported 2008-10-06 14:50:53 PDT
We increment the user initiated profile count in the Web Inspector's JS, but this causes problems as it's incremented every time we display the log message, and is only currently working by being very careful to clear messages and the count at the right time. We should move this into the InspectorController
Attachments
Proposed patch (7.25 KB, patch)
2008-10-06 14:55 PDT, Kevin McCullough
timothy: review-
New patch with changes (6.71 KB, patch)
2008-10-06 15:25 PDT, Kevin McCullough
timothy: review+
Kevin McCullough
Comment 1 2008-10-06 14:55:24 PDT
Created attachment 24126 [details] Proposed patch
Timothy Hatcher
Comment 2 2008-10-06 15:06:14 PDT
Comment on attachment 24126 [details] Proposed patch I am not sure m_startedProfileNumber is a good name. Maybe m_runningUserInitiatedProfileNumber, m_recordingUserInitiatedProfileNumber or m_activeUserInitiatedProfileNumber? 137 if (profile.title.indexOf(UserInitiatedProfileName) != 0) { Use !== here. 237 if (title.indexOf(UserInitiatedProfileName, 0) == 0) { Use === here. 238 title = WebInspector.UIString("Profile %d", title.substring(35)); Use UserInitiatedProfileName.length instead of the magic number. 380 if (this.profile.title.indexOf(UserInitiatedProfileName, 0) == 0) 381 this._profileNumber = this.profile.title.substring(35); Same applies here: === and no magic number. Also indexOf only takes 1 argument. 398 if (this.profile.title.indexOf(UserInitiatedProfileName, 0) == 0) The indexOf function only takes 1 argument and use ===. 443 console.log("followLink"); r=me to remove that console.log in a separate commit. r- for now.
Kevin McCullough
Comment 3 2008-10-06 15:25:22 PDT
Created attachment 24127 [details] New patch with changes
Oliver Hunt
Comment 4 2008-10-06 15:29:46 PDT
Comment on attachment 24127 [details] New patch with changes r=me
Timothy Hatcher
Comment 5 2008-10-06 15:42:20 PDT
Comment on attachment 24127 [details] New patch with changes nextUserInitiatedProfileNumber should be m_ nextUserInitiatedProfileNumber.
Kevin McCullough
Comment 6 2008-10-06 16:08:38 PDT
Committed revision 37349.
Note You need to log in before you can comment on or make changes to this bug.