Changeset 135599 in webkit


Ignore:
Timestamp:
Nov 23, 2012 5:25:18 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Refine JsDoc in ProfilesPanel.js
https://bugs.webkit.org/show_bug.cgi?id=103042

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-23
Reviewed by Yury Semikhatsky.

I'm going to make profiler output typed.

This will require some amount of refactoring.

Before refactoring I would like to make things
unambiguous by adding JsDoc where they are missing.

  • inspector/front-end/ProfilesPanel.js:

(WebInspector.ProfilesPanel.prototype._onToggleProfiling):
Added to eliminate parameter type ambiguity.

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r135598 r135599  
     12012-11-23  Eugene Klyuchnikov  <eustas.bug@gmail.com>
     2
     3        Web Inspector: Refine JsDoc in ProfilesPanel.js
     4        https://bugs.webkit.org/show_bug.cgi?id=103042
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        I'm going to make profiler output typed.
     9
     10        This will require some amount of refactoring.
     11
     12        Before refactoring I would like to make things
     13        unambiguous by adding JsDoc where they are missing.
     14
     15        * inspector/front-end/ProfilesPanel.js:
     16        (WebInspector.ProfilesPanel.prototype._onToggleProfiling):
     17        Added to eliminate parameter type ambiguity.
     18
    1192012-11-23  Kent Tamura  <tkent@chromium.org>
    220
  • trunk/Source/WebCore/inspector/front-end/CPUProfileView.js

    r134550 r135599  
    631631 * @constructor
    632632 * @extends {WebInspector.ProfileHeader}
    633  * @param {WebInspector.CPUProfileType} type
     633 * @param {!WebInspector.CPUProfileType} type
    634634 * @param {string} title
    635635 * @param {number=} uid
  • trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js

    r133463 r135599  
    374374 * @constructor
    375375 * @extends {WebInspector.ProfileHeader}
    376  * @param {WebInspector.CSSSelectorProfileType} type
     376 * @param {!WebInspector.CSSSelectorProfileType} type
    377377 * @param {string} title
    378378 * @param {number=} uid
  • trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js

    r135591 r135599  
    277277 * @constructor
    278278 * @extends {WebInspector.ProfileHeader}
    279  * @param {WebInspector.CanvasProfileType} type
     279 * @param {!WebInspector.CanvasProfileType} type
    280280 * @param {string} title
    281281 * @param {number=} uid
  • trunk/Source/WebCore/inspector/front-end/FileUtils.js

    r131872 r135599  
    296296
    297297/**
    298  * @param {function(File)} callback
     298 * @param {function(!File)} callback
    299299 * @return {Node}
    300300 */
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js

    r130149 r135599  
    586586    },
    587587
    588     _filterSelectIndexChanged: function(profiles, profileIndex)
     588    filterSelectIndexChanged: function(profiles, profileIndex)
    589589    {
    590590        this._profileIndex = profileIndex;
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js

    r135586 r135599  
    387387    {
    388388        var profileIndex = this.filterSelectElement.selectedIndex - 1;
    389         this.dataGrid._filterSelectIndexChanged(this._profiles(), profileIndex);
     389        this.dataGrid.filterSelectIndexChanged(this._profiles(), profileIndex);
    390390
    391391        if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
     
    417417    },
    418418
     419    /**
     420     * @return {!Array.<!WebInspector.ProfileHeader>}
     421     */
    419422    _profiles: function()
    420423    {
     
    804807 * @constructor
    805808 * @extends {WebInspector.ProfileHeader}
    806  * @param {WebInspector.HeapSnapshotProfileType} type
     809 * @param {!WebInspector.HeapSnapshotProfileType} type
    807810 * @param {string} title
    808811 * @param {number=} uid
  • trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js

    r135158 r135599  
    260260 * @constructor
    261261 * @extends {WebInspector.ProfileHeader}
    262  * @param {WebInspector.NativeMemoryProfileType} type
     262 * @param {!WebInspector.NativeMemoryProfileType} type
    263263 * @param {string} title
    264264 * @param {number=} uid
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r135588 r135599  
    2828/**
    2929 * @constructor
     30 * @param {string} id
     31 * @param {string} name
    3032 */
    3133WebInspector.ProfileType = function(id, name)
     
    100102/**
    101103 * @constructor
    102  * @param {WebInspector.ProfileType} profileType
     104 * @param {!WebInspector.ProfileType} profileType
    103105 * @param {string} title
    104106 * @param {number=} uid
     
    119121
    120122WebInspector.ProfileHeader.prototype = {
     123    /**
     124     * @return {!WebInspector.ProfileType}
     125     */
    121126    profileType: function()
    122127    {
     
    133138    },
    134139
     140    /**
     141     * @return {?WebInspector.View}
     142     */
    135143    existingView: function()
    136144    {
     
    138146    },
    139147
     148    /**
     149     * @return {!WebInspector.View}
     150     */
    140151    view: function()
    141152    {
     
    147158    /**
    148159     * @param {WebInspector.ProfilesPanel} profilesPanel
     160     * @return {!WebInspector.View}
    149161     */
    150162    createView: function(profilesPanel)
     
    216228    if (Capabilities.profilerCausesRecompilation) {
    217229        this._statusBarButtons.push(this.enableToggleButton);
    218         this.enableToggleButton.addEventListener("click", this._toggleProfiling, this);
     230        this.enableToggleButton.addEventListener("click", this._onToggleProfiling, this);
    219231    }
    220232    this.recordButton = new WebInspector.StatusBarButton("", "record-profile-status-bar-item");
     
    269281    },
    270282
     283    /**
     284     * @param {!File} file
     285     */
    271286    _loadFromFile: function(file)
    272287    {
     
    333348    },
    334349
     350    /**
     351     * @param {WebInspector.Event} event
     352     */
    335353    _onProfileTypeSelected: function(event)
    336354    {
    337         this._selectedProfileType = event.data;
     355        this._selectedProfileType = /** @type {!WebInspector.ProfileType} */ (event.data);
    338356        this.recordButton.title = this._selectedProfileType.buttonTooltip;
    339357    },
     
    418436    },
    419437
     438    /**
     439     * @param {Event} event
     440     */
    420441    _handleContextMenuEvent: function(event)
    421442    {
     
    591612    /**
    592613     * @param {string} typeId
    593      * @return {Array.<WebInspector.ProfileHeader>}
     614     * @return {!Array.<!WebInspector.ProfileHeader>}
    594615     */
    595616    getProfiles: function(typeId)
     
    9821003    },
    9831004
    984     _toggleProfiling: function(optionalAlways)
     1005    /**
     1006     * @param {WebInspector.Event} event
     1007     */
     1008    _onToggleProfiling: function(event) {
     1009        this._toggleProfiling(true);
     1010    },
     1011
     1012    /**
     1013     * @param {boolean} always
     1014     */
     1015    _toggleProfiling: function(always)
    9851016    {
    9861017        if (this._profilerEnabled) {
     
    9881019            ProfilerAgent.disable(this._profilerWasDisabled.bind(this));
    9891020        } else {
    990             WebInspector.settings.profilerEnabled.set(!!optionalAlways);
     1021            WebInspector.settings.profilerEnabled.set(always);
    9911022            ProfilerAgent.enable(this._profilerWasEnabled.bind(this));
    9921023        }
     
    10191050    },
    10201051
     1052    /**
     1053     * @param {!WebInspector.Event} event
     1054     */
    10211055    sidebarResized: function(event)
    10221056    {
     
    11261160 * @constructor
    11271161 * @implements {ProfilerAgent.Dispatcher}
     1162 * @param {WebInspector.ProfilesPanel} profilesPanel
    11281163 */
    1129 WebInspector.ProfilerDispatcher = function(profiler)
     1164WebInspector.ProfilerDispatcher = function(profilesPanel)
    11301165{
    1131     this._profiler = profiler;
     1166    this._profilesPanel = profilesPanel;
    11321167}
    11331168
     
    11381173    addProfileHeader: function(profile)
    11391174    {
    1140         var profileType = this._profiler.getProfileType(profile.typeId);
    1141         this._profiler.addProfileHeader(profileType.createProfile(profile));
     1175        var profileType = this._profilesPanel.getProfileType(profile.typeId);
     1176        this._profilesPanel.addProfileHeader(profileType.createProfile(profile));
    11421177    },
    11431178
     
    11491184    addHeapSnapshotChunk: function(uid, chunk)
    11501185    {
    1151         this._profiler._addHeapSnapshotChunk(uid, chunk);
     1186        this._profilesPanel._addHeapSnapshotChunk(uid, chunk);
    11521187    },
    11531188
     
    11581193    finishHeapSnapshot: function(uid)
    11591194    {
    1160         this._profiler._finishHeapSnapshot(uid);
     1195        this._profilesPanel._finishHeapSnapshot(uid);
    11611196    },
    11621197
     
    11671202    setRecordingProfile: function(isProfiling)
    11681203    {
    1169         this._profiler.setRecordingProfile(WebInspector.CPUProfileType.TypeId, isProfiling);
     1204        this._profilesPanel.setRecordingProfile(WebInspector.CPUProfileType.TypeId, isProfiling);
    11701205    },
    11711206
     
    11751210    resetProfiles: function()
    11761211    {
    1177         this._profiler._reset();
     1212        this._profilesPanel._reset();
    11781213    },
    11791214
     
    11851220    reportHeapSnapshotProgress: function(done, total)
    11861221    {
    1187         this._profiler._reportHeapSnapshotProgress(done, total);
     1222        this._profilesPanel._reportHeapSnapshotProgress(done, total);
    11881223    }
    11891224}
     
    11921227 * @constructor
    11931228 * @extends {WebInspector.SidebarTreeElement}
     1229 * @param {!WebInspector.ProfileHeader} profile
     1230 * @param {string} titleFormat
     1231 * @param {string} className
    11941232 */
    11951233WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className)
     
    12481286    },
    12491287
     1288    /**
     1289     * @param {!Event} event
     1290     */
    12501291    handleContextMenuEvent: function(event)
    12511292    {
     
    12921333 * @constructor
    12931334 * @extends {WebInspector.SidebarTreeElement}
     1335 * @param {!WebInspector.ProfilesPanel} panel
    12941336 */
    12951337WebInspector.ProfilesSidebarTreeElement = function(panel)
Note: See TracChangeset for help on using the changeset viewer.