Changeset 117581 in webkit


Ignore:
Timestamp:
May 18, 2012 6:30:40 AM (12 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: remove unnecessary indirection from profile types
https://bugs.webkit.org/show_bug.cgi?id=86845

Reviewed by Pavel Feldman.

Source/WebCore:

Introduced CSSProfileHeader and CPUProfileHeader, moved view creation from
the type to corresponding profile headers. Removed some inderection and
private fields assigned in random places. Added type annotations.

  • inspector/front-end/CPUProfileView.js:

(WebInspector.CPUProfileType.prototype.createTemporaryProfile):
(WebInspector.CPUProfileType.prototype.createProfile):
(WebInspector.CPUProfileHeader):
(WebInspector.CPUProfileHeader.prototype.createSidebarTreeElement):
(WebInspector.CPUProfileHeader.prototype.createView):

  • inspector/front-end/CSSSelectorProfileView.js:

(WebInspector.CSSSelectorProfileType.prototype.stopRecordingProfile):
(WebInspector.CSSSelectorProfileType.prototype.createTemporaryProfile):
(WebInspector.CSSSelectorProfileType.prototype.createProfile):
(WebInspector.CSSProfileHeader):
(WebInspector.CSSProfileHeader.prototype.createSidebarTreeElement):
(WebInspector.CSSProfileHeader.prototype.createView):

  • inspector/front-end/HeapSnapshotView.js:

(WebInspector.HeapSnapshotProfileType.prototype.createTemporaryProfile):
(WebInspector.HeapSnapshotProfileType.prototype.createProfile):
(WebInspector.HeapProfileHeader):
(WebInspector.HeapProfileHeader.prototype.createSidebarTreeElement):
(WebInspector.HeapProfileHeader.prototype.createView):
(WebInspector.HeapProfileHeader.prototype.load):
(WebInspector.HeapProfileHeader.prototype.saveToFile):

  • inspector/front-end/ProfileLauncherView.js:

(WebInspector.ProfileLauncherView):
(WebInspector.ProfileLauncherView.prototype.addProfileType):
(WebInspector.ProfileLauncherView.prototype._profileTypeChanged):

  • inspector/front-end/ProfilesPanel.js:

(WebInspector.ProfileType):
(WebInspector.ProfileHeader):
(WebInspector.ProfileHeader.prototype.profileType):
(WebInspector.ProfileHeader.prototype.createSidebarTreeElement):
(WebInspector.ProfileHeader.prototype.existingView):
(WebInspector.ProfileHeader.prototype.view):
(WebInspector.ProfileHeader.prototype.createView):
(WebInspector.ProfilesPanel.prototype._reset):
(WebInspector.ProfilesPanel.prototype.addProfileHeader):
(WebInspector.ProfilesPanel.prototype._removeProfileHeader):
(WebInspector.ProfilesPanel.prototype.showProfile):
(WebInspector.ProfilesPanel.prototype.getProfiles):
(WebInspector.ProfilesPanel.prototype.findTemporaryProfile):
(WebInspector.ProfilesPanel.prototype._searchableViews):

  • inspector/front-end/View.js:

(WebInspector.View._assert):

LayoutTests:

  • inspector/profiler/heap-snapshot-test.js:

(initialize_HeapSnapshotTest):

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117580 r117581  
     12012-05-18  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: remove unnecessary indirection from profile types
     4        https://bugs.webkit.org/show_bug.cgi?id=86845
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/profiler/heap-snapshot-test.js:
     9        (initialize_HeapSnapshotTest):
     10
    1112012-05-18  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
    212
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js

    r117234 r117581  
    514514    var uid = InspectorTest._nextUid++;
    515515    var snapshot = generator();
    516     var profile = new WebInspector.HeapProfileHeader(UserInitiatedProfileName + "." + uid, uid, snapshot.maxJSObjectId);
     516    var profileType = WebInspector.panels.profiles.getProfileType(WebInspector.HeapSnapshotProfileType.TypeId);
     517    var profile = profileType.createProfile({
     518        title: UserInitiatedProfileName + "." + uid,
     519        uid: uid,
     520        maxJSObjectId: snapshot.maxJSObjectId
     521    });
    517522    delete snapshot.maxJSObjectId;
    518523    function pushGeneratedSnapshot(typeId, uid)
     
    526531    InspectorTest.override(ProfilerAgent, "getProfile", pushGeneratedSnapshot);
    527532    InspectorTest._takeAndOpenSnapshotCallback = callback;
    528     var profileType = WebInspector.panels.profiles.getProfileType(profile.typeId);
    529     profile = profileType.createProfile(profile);
    530533    WebInspector.panels.profiles.addProfileHeader(profile);
    531534    WebInspector.panels.profiles.showProfile(profile);
  • trunk/Source/WebCore/ChangeLog

    r117579 r117581  
     12012-05-18  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: remove unnecessary indirection from profile types
     4        https://bugs.webkit.org/show_bug.cgi?id=86845
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Introduced CSSProfileHeader and CPUProfileHeader, moved view creation from
     9        the type to corresponding profile headers. Removed some inderection and
     10        private fields assigned in random places. Added type annotations.
     11
     12        * inspector/front-end/CPUProfileView.js:
     13        (WebInspector.CPUProfileType.prototype.createTemporaryProfile):
     14        (WebInspector.CPUProfileType.prototype.createProfile):
     15        (WebInspector.CPUProfileHeader):
     16        (WebInspector.CPUProfileHeader.prototype.createSidebarTreeElement):
     17        (WebInspector.CPUProfileHeader.prototype.createView):
     18        * inspector/front-end/CSSSelectorProfileView.js:
     19        (WebInspector.CSSSelectorProfileType.prototype.stopRecordingProfile):
     20        (WebInspector.CSSSelectorProfileType.prototype.createTemporaryProfile):
     21        (WebInspector.CSSSelectorProfileType.prototype.createProfile):
     22        (WebInspector.CSSProfileHeader):
     23        (WebInspector.CSSProfileHeader.prototype.createSidebarTreeElement):
     24        (WebInspector.CSSProfileHeader.prototype.createView):
     25        * inspector/front-end/HeapSnapshotView.js:
     26        (WebInspector.HeapSnapshotProfileType.prototype.createTemporaryProfile):
     27        (WebInspector.HeapSnapshotProfileType.prototype.createProfile):
     28        (WebInspector.HeapProfileHeader):
     29        (WebInspector.HeapProfileHeader.prototype.createSidebarTreeElement):
     30        (WebInspector.HeapProfileHeader.prototype.createView):
     31        (WebInspector.HeapProfileHeader.prototype.load):
     32        (WebInspector.HeapProfileHeader.prototype.saveToFile):
     33        * inspector/front-end/ProfileLauncherView.js:
     34        (WebInspector.ProfileLauncherView):
     35        (WebInspector.ProfileLauncherView.prototype.addProfileType):
     36        (WebInspector.ProfileLauncherView.prototype._profileTypeChanged):
     37        * inspector/front-end/ProfilesPanel.js:
     38        (WebInspector.ProfileType):
     39        (WebInspector.ProfileHeader):
     40        (WebInspector.ProfileHeader.prototype.profileType):
     41        (WebInspector.ProfileHeader.prototype.createSidebarTreeElement):
     42        (WebInspector.ProfileHeader.prototype.existingView):
     43        (WebInspector.ProfileHeader.prototype.view):
     44        (WebInspector.ProfileHeader.prototype.createView):
     45        (WebInspector.ProfilesPanel.prototype._reset):
     46        (WebInspector.ProfilesPanel.prototype.addProfileHeader):
     47        (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
     48        (WebInspector.ProfilesPanel.prototype.showProfile):
     49        (WebInspector.ProfilesPanel.prototype.getProfiles):
     50        (WebInspector.ProfilesPanel.prototype.findTemporaryProfile):
     51        (WebInspector.ProfilesPanel.prototype._searchableViews):
     52        * inspector/front-end/View.js:
     53        (WebInspector.View._assert):
     54
    1552012-05-18  Kentaro Hara  <haraken@chromium.org>
    256
  • trunk/Source/WebCore/inspector/front-end/CPUProfileView.js

    r117272 r117581  
    101101    this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.DefaultFormatter(30));
    102102
    103     ProfilerAgent.getProfile(this.profile.typeId, this.profile.uid, profileCallback.bind(this));
     103    ProfilerAgent.getProfile(this.profile.profileType().id, this.profile.uid, profileCallback.bind(this));
    104104}
    105105
     
    613613    },
    614614
    615     createSidebarTreeElementForProfile: function(profile)
    616     {
    617         return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
    618     },
    619 
    620     createView: function(profile)
    621     {
    622         return new WebInspector.CPUProfileView(profile);
    623     },
    624 
    625615    /**
    626616     * @override
     
    631621    {
    632622        title = title || WebInspector.UIString("Recording\u2026");
    633         return new WebInspector.ProfileHeader(WebInspector.CPUProfileType.TypeId, title);
     623        return new WebInspector.CPUProfileHeader(this, title);
    634624    },
    635625
     
    641631    createProfile: function(profile)
    642632    {
    643         return new WebInspector.ProfileHeader(profile.typeId, profile.title, profile.uid);
     633        return new WebInspector.CPUProfileHeader(this, profile.title, profile.uid);
    644634    }
    645635}
    646636
    647637WebInspector.CPUProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
     638
     639/**
     640 * @constructor
     641 * @extends {WebInspector.ProfileHeader}
     642 * @param {WebInspector.CPUProfileType} type
     643 * @param {string} title
     644 * @param {number=} uid
     645 */
     646WebInspector.CPUProfileHeader = function(type, title, uid)
     647{
     648    WebInspector.ProfileHeader.call(this, type, title, uid);
     649}
     650
     651WebInspector.CPUProfileHeader.prototype = {
     652    /**
     653     * @override
     654     */
     655    createSidebarTreeElement: function()
     656    {
     657        return new WebInspector.ProfileSidebarTreeElement(this, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
     658    },
     659
     660    /**
     661     * @override
     662     */
     663    createView: function()
     664    {
     665        return new WebInspector.CPUProfileView(this);
     666    }
     667}
     668
     669WebInspector.CPUProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype;
  • trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js

    r116855 r117581  
    2828 * @extends WebInspector.DataGridNode
    2929 * @param {WebInspector.CSSSelectorProfileView} profileView
     30 * @param {CSSAgent.SelectorProfile} data
    3031 */
    3132WebInspector.CSSSelectorDataGridNode = function(profileView, data)
     
    333334    stopRecordingProfile: function()
    334335    {
     336        /**
     337         * @param {?Protocol.Error} error
     338         * @param {CSSAgent.SelectorProfile} profile
     339         */
    335340        function callback(error, profile)
    336341        {
     
    338343                return;
    339344
    340             profile.uid = this._profileUid++;
    341             profile.title = WebInspector.UIString("Profile %d", profile.uid) + String.sprintf(" (%s)", Number.secondsToString(profile.totalTime / 1000));
    342             profile.typeId = WebInspector.CSSSelectorProfileType.TypeId;
    343             WebInspector.panels.profiles.addProfileHeader(profile);
     345            var uid = this._profileUid++;
     346            var title = WebInspector.UIString("Profile %d", uid) + String.sprintf(" (%s)", Number.secondsToString(profile.totalTime / 1000));
     347            var profileHeader = new WebInspector.CSSProfileHeader(this, title, uid, profile);
     348            WebInspector.panels.profiles.addProfileHeader(profileHeader);
    344349            WebInspector.panels.profiles.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, false);
    345350        }
     
    347352        this._recording = false;
    348353        CSSAgent.stopSelectorProfiler(callback.bind(this));
    349     },
    350 
    351     createSidebarTreeElementForProfile: function(profile)
    352     {
    353         return new WebInspector.ProfileSidebarTreeElement(profile, profile.title, "profile-sidebar-tree-item");
    354     },
    355 
    356     createView: function(profile)
    357     {
    358         return new WebInspector.CSSSelectorProfileView(profile);
    359354    },
    360355
     
    367362    {
    368363        title = title || WebInspector.UIString("Recording\u2026");
    369         return new WebInspector.ProfileHeader(WebInspector.CSSSelectorProfileType.TypeId, title);
     364        return new WebInspector.CSSProfileHeader(this, title);
    370365    },
    371366
    372367    /**
    373368     * @override
    374      * @param {ProfilerAgent.ProfileHeader} profile
     369     * @param {CSSAgent.SelectorProfile} profile
    375370     * @return {WebInspector.ProfileHeader}
    376371     */
    377372    createProfile: function(profile)
    378373    {
    379         return new WebInspector.ProfileHeader(profile.typeId, profile.title, profile.uid);
     374        throw new Error("Unreachable");
    380375    }
    381376}
    382377
    383378WebInspector.CSSSelectorProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
     379
     380
     381/**
     382 * @constructor
     383 * @extends {WebInspector.ProfileHeader}
     384 * @param {WebInspector.CSSSelectorProfileType} type
     385 * @param {string} title
     386 * @param {number=} uid
     387 * @param {CSSAgent.SelectorProfile=} protocolData
     388 */
     389WebInspector.CSSProfileHeader = function(type, title, uid, protocolData)
     390{
     391    WebInspector.ProfileHeader.call(this, type, title, uid);
     392    this._protocolData = protocolData;
     393}
     394
     395WebInspector.CSSProfileHeader.prototype = {
     396    /**
     397     * @override
     398     */
     399    createSidebarTreeElement: function()
     400    {
     401        return new WebInspector.ProfileSidebarTreeElement(this, this.title, "profile-sidebar-tree-item");
     402    },
     403
     404    /**
     405     * @override
     406     */
     407    createView: function()
     408    {
     409        var profile = /** @type {CSSAgent.SelectorProfile} */this._protocolData;
     410        return new WebInspector.CSSSelectorProfileView(profile);
     411    }
     412}
     413
     414WebInspector.CSSProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype;
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js

    r117272 r117581  
    757757    },
    758758
    759     createSidebarTreeElementForProfile: function(profile)
    760     {
    761         return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item");
    762     },
    763 
    764     createView: function(profile)
    765     {
    766         return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, profile);
    767     },
    768 
    769759    /**
    770760     * @override
     
    775765    {
    776766        title = title || WebInspector.UIString("Snapshotting\u2026");
    777         return new WebInspector.HeapProfileHeader(title);
     767        return new WebInspector.HeapProfileHeader(this, title);
    778768    },
    779769
     
    785775    createProfile: function(profile)
    786776    {
    787         return new WebInspector.HeapProfileHeader(profile.title, profile.uid, profile.maxJSObjectId || 0);
     777        return new WebInspector.HeapProfileHeader(this, profile.title, profile.uid, profile.maxJSObjectId || 0);
    788778    }
    789779}
     
    794784 * @constructor
    795785 * @extends {WebInspector.ProfileHeader}
     786 * @param {WebInspector.HeapSnapshotProfileType} type
    796787 * @param {string} title
    797788 * @param {number=} uid
    798789 * @param {number=} maxJSObjectId
    799790 */
    800 WebInspector.HeapProfileHeader = function(title, uid, maxJSObjectId)
     791WebInspector.HeapProfileHeader = function(type, title, uid, maxJSObjectId)
    801792{
    802     WebInspector.ProfileHeader.call(this, WebInspector.HeapSnapshotProfileType.TypeId, title, uid);
     793    WebInspector.ProfileHeader.call(this, type, title, uid);
    803794    this.maxJSObjectId = maxJSObjectId;
    804795    /**
     
    814805
    815806WebInspector.HeapProfileHeader.prototype = {
     807    /**
     808     * @override
     809     */
     810    createSidebarTreeElement: function()
     811    {
     812        return new WebInspector.ProfileSidebarTreeElement(this, WebInspector.UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item");
     813    },
     814
     815    /**
     816     * @override
     817     */
     818    createView: function()
     819    {
     820        return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, this);
     821    },
     822
    816823    snapshotProxy: function()
    817824    {
     
    836843            this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026");
    837844            this.sidebarElement.wait = true;
    838             ProfilerAgent.getProfile(this.typeId, this.uid);
     845            ProfilerAgent.getProfile(this.profileType().id, this.uid);
    839846        }
    840847    },
     
    930937            WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, startSavingSnapshot, this);
    931938            WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._saveStatusUpdate, this);
    932             ProfilerAgent.getProfile(this.typeId, this.uid);
     939            ProfilerAgent.getProfile(this.profileType().id, this.uid);
    933940        }
    934941
  • trunk/Source/WebCore/inspector/front-end/ProfileLauncherView.js

    r103765 r117581  
    3939    this._panel = profilesPanel;
    4040    this._profileRunning = false;
    41     this._optionIdPrefix = "profile-type-";
    4241
    4342    this.element.addStyleClass("profile-launcher-view");
     
    5352    this._profileTypeSelectorForm = this._contentElement.createChild("form");
    5453    this._contentElement.createChild("div", "flexible-space");
    55 
    56     this._boundProfileTypeChangeListener = this._profileTypeChanged.bind(this);
    5754
    5855    this._controlButton = this._contentElement.createChild("button", "control-profiling");
     
    7269    },
    7370
     71    /**
     72     * @param {WebInspector.ProfileType} profileType
     73     */
    7474    addProfileType: function(profileType)
    7575    {
     
    8181        optionElement.type = "radio";
    8282        optionElement.name = "profile-type";
    83         var optionId = this._optionIdPrefix + profileType.id;
    84         optionElement.id = optionId;
    8583        if (checked) {
    8684            optionElement.checked = checked;
    8785            this.dispatchEventToListeners(WebInspector.ProfileLauncherView.EventTypes.ProfileTypeSelected, profileType);
    8886        }
    89         optionElement.addEventListener("change", this._boundProfileTypeChangeListener, false);
     87        optionElement.addEventListener("change", this._profileTypeChanged.bind(this, profileType), false);
    9088        var descriptionElement = labelElement.createChild("p");
    9189        descriptionElement.textContent = profileType.description;
     
    110108    },
    111109
    112     _profileTypeChanged: function(event)
     110    /**
     111     * @param {WebInspector.ProfileType} profileType
     112     */
     113    _profileTypeChanged: function(profileType, event)
    113114    {
    114         var selectedProfileType = this._panel.getProfileType(event.target.id.substring(this._optionIdPrefix.length));
    115         this.dispatchEventToListeners(WebInspector.ProfileLauncherView.EventTypes.ProfileTypeSelected, selectedProfileType);
     115        this.dispatchEventToListeners(WebInspector.ProfileLauncherView.EventTypes.ProfileTypeSelected, profileType);
    116116    },
    117117
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r117234 r117581  
    3333    this._id = id;
    3434    this._name = name;
     35    /**
     36     * @type {WebInspector.SidebarSectionTreeElement}
     37     */
     38    this.treeElement = null;
    3539}
    3640
     
    6670    },
    6771
    68     viewForProfile: function(profile)
    69     {
    70         if (!profile._profileView)
    71             profile._profileView = this.createView(profile);
    72         return profile._profileView;
    73     },
    74 
    7572    reset: function()
    7673    {
     
    8077    {
    8178        return "";
    82     },
    83 
    84     // Must be implemented by subclasses.
    85     createView: function(profile)
    86     {
    87         throw new Error("Needs implemented.");
    88     },
    89 
    90     // Must be implemented by subclasses.
    91     createSidebarTreeElementForProfile: function(profile)
    92     {
    93         throw new Error("Needs implemented.");
    9479    },
    9580
     
    125110/**
    126111 * @constructor
    127  * @param {string} profileType
     112 * @param {WebInspector.ProfileType} profileType
    128113 * @param {string} title
    129114 * @param {number=} uid
     
    131116WebInspector.ProfileHeader = function(profileType, title, uid)
    132117{
    133     this.typeId = profileType,
     118    this._profileType = profileType;
    134119    this.title = title;
    135120    if (uid === undefined) {
     
    144129
    145130WebInspector.ProfileHeader.prototype = {
     131    profileType: function()
     132    {
     133        return this._profileType;
     134    },
     135
     136    /**
     137     * Must be implemented by subclasses.
     138     * @return {WebInspector.ProfileSidebarTreeElement}
     139     */
     140    createSidebarTreeElement: function()
     141    {
     142        throw new Error("Needs implemented.");
     143    },
     144
     145    existingView: function()
     146    {
     147        return this._view;
     148    },
     149
     150    view: function()
     151    {
     152        if (!this._view)
     153            this._view = this.createView();
     154        return this._view;
     155    },
     156
     157    createView: function()
     158    {
     159        throw new Error("Not implemented.");
     160    },
     161
    146162    /**
    147163     * @param {Function} callback
     
    335351
    336352        for (var i = 0; i < this._profiles.length; ++i) {
    337             var view = this._profiles[i]._profileView;
     353            var view = this._profiles[i].existingView();
    338354            if (view) {
    339355                view.detach();
     
    341357                    view.dispose();
    342358            }
    343 
    344             delete this._profiles[i]._profileView;
    345359        }
    346360        delete this.visibleView;
     
    444458    addProfileHeader: function(profile)
    445459    {
    446         this._removeTemporaryProfile(profile.typeId);
    447 
    448         var typeId = profile.typeId;
    449         var profileType = this.getProfileType(typeId);
     460        this._removeTemporaryProfile(profile.profileType().id);
     461
     462        var profileType = profile.profileType();
     463        var typeId = profileType.id;
    450464        var sidebarParent = profileType.treeElement;
    451465        sidebarParent.hidden = false;
     
    453467        var alternateTitle;
    454468
    455         profile.__profilesPanelProfileType = profileType;
    456469        this._profiles.push(profile);
    457470        this._profilesIdMap[this._makeKey(profile.uid, typeId)] = profile;
     
    493506        }
    494507
    495         var profileTreeElement = profileType.createSidebarTreeElementForProfile(profile);
     508        var profileTreeElement = profile.createSidebarTreeElement();
    496509        profile.sidebarElement = profileTreeElement;
    497510        profileTreeElement.small = small;
     
    513526    _removeProfileHeader: function(profile)
    514527    {
    515         var typeId = profile.typeId;
    516         var profileType = this.getProfileType(typeId);
    517         var sidebarParent = profileType.treeElement;
     528        var sidebarParent = profile.profileType().treeElement;
    518529
    519530        for (var i = 0; i < this._profiles.length; ++i) {
     
    524535            }
    525536        }
    526         delete this._profilesIdMap[this._makeKey(profile.uid, typeId)];
    527 
    528         var profileTitleKey = this._makeTitleKey(profile.title, typeId);
     537        delete this._profilesIdMap[this._makeKey(profile.uid, profile.profileType().id)];
     538
     539        var profileTitleKey = this._makeTitleKey(profile.title, profile.profileType().id);
    529540        delete this._profileGroups[profileTitleKey];
    530541
     
    532543
    533544        if (!profile.isTemporary)
    534             ProfilerAgent.removeProfile(profile.typeId, profile.uid);
     545            ProfilerAgent.removeProfile(profile.profileType().id, profile.uid);
    535546
    536547        // No other item will be selected if there aren't any other profiles, so
     
    550561        this.closeVisibleView();
    551562
    552         var view = profile.__profilesPanelProfileType.viewForProfile(profile);
     563        var view = profile.view();
    553564
    554565        view.show(this.profileViews);
     
    578589        for (var i = 0; i < profilesCount; ++i) {
    579590            var profile = this._profiles[i];
    580             if (!profile.isTemporary && profile.typeId === typeId)
     591            if (!profile.isTemporary && profile.profileType().id === typeId)
    581592                result.push(profile);
    582593        }
     
    596607            if (profile.maxJSObjectId >= snapshotObjectId) {
    597608                this.showProfile(profile);
    598                 profile._profileView.changeView(viewName, function() {
    599                     profile._profileView.dataGrid.highlightObjectByHeapSnapshotId(snapshotObjectId);
     609                profile.view().changeView(viewName, function() {
     610                    profile.view().dataGrid.highlightObjectByHeapSnapshotId(snapshotObjectId);
    600611                });
    601612                break;
     
    612623        var profilesCount = this._profiles.length;
    613624        for (var i = 0; i < profilesCount; ++i)
    614             if (this._profiles[i].typeId === typeId && this._profiles[i].isTemporary)
     625            if (this._profiles[i].profileType().id === typeId && this._profiles[i].isTemporary)
    615626                return this._profiles[i];
    616627        return null;
     
    628639
    629640    /**
    630      * @param {WebInspector.ProfileHeader} profile
     641     * @param {ProfilerAgent.ProfileHeader} profile
    631642     */
    632643    hasProfile: function(profile)
     
    877888        for (var i = 0; i < profilesLength; ++i) {
    878889            var profile = this._profiles[i];
    879             var view = profile.__profilesPanelProfileType.viewForProfile(profile);
     890            var view = profile.view();
    880891            if (!view.performSearch || view === visibleView)
    881892                continue;
     
    977988            return;
    978989
     990        /**
     991         * @param {?string} error
     992         * @param {Array.<ProfilerAgent.ProfileHeader>} profileHeaders
     993         */
    979994        function populateCallback(error, profileHeaders) {
    980995            if (error)
  • trunk/Source/WebCore/inspector/front-end/View.js

    r114740 r117581  
    397397    if (!condition) {
    398398        console.trace();
     399        console.error("assert: " + new Error().stack);
    399400        throw new Error(message);
    400401    }
Note: See TracChangeset for help on using the changeset viewer.