Changeset 116959 in webkit


Ignore:
Timestamp:
May 14, 2012 10:12:11 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: do not update $0-$4 console variables for the objects from loaded from file heap snapshot.
https://bugs.webkit.org/show_bug.cgi?id=86371

When the user selects an object in HeapSnapshot we are updating $0 variable in console API.
But if the snapshot was loaded from file then we can't map object id for the selected obect
from the snapshot to the live objects in the inspected page.

Reviewed by Yury Semikhatsky.

  • inspector/front-end/HeapSnapshotView.js:

(WebInspector.HeapSnapshotView.prototype._inspectedObjectChanged):
(WebInspector.HeapSnapshotView.prototype._updateFilterOptions):
(WebInspector.HeapProfileHeader):
(WebInspector.HeapProfileHeader.prototype.canSaveToFile):
(WebInspector.HeapProfileHeader.prototype.saveToFile):

  • inspector/front-end/ProfilesPanel.js:

(WebInspector.ProfileHeader):
(WebInspector.ProfileHeader.prototype.loadFromFile):
(WebInspector.ProfileHeader.prototype.fromFile):
(WebInspector.ProfilesPanel.prototype._loadFromFile):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116957 r116959  
     12012-05-14  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: do not update $0-$4 console variables for the objects from loaded from file heap snapshot.
     4        https://bugs.webkit.org/show_bug.cgi?id=86371
     5
     6        When the user selects an object in HeapSnapshot we are updating $0 variable in console API.
     7        But if the snapshot was loaded from file then we can't map object id for the selected obect
     8        from the snapshot to the live objects in the inspected page.
     9
     10        Reviewed by Yury Semikhatsky.
     11
     12        * inspector/front-end/HeapSnapshotView.js:
     13        (WebInspector.HeapSnapshotView.prototype._inspectedObjectChanged):
     14        (WebInspector.HeapSnapshotView.prototype._updateFilterOptions):
     15        (WebInspector.HeapProfileHeader):
     16        (WebInspector.HeapProfileHeader.prototype.canSaveToFile):
     17        (WebInspector.HeapProfileHeader.prototype.saveToFile):
     18        * inspector/front-end/ProfilesPanel.js:
     19        (WebInspector.ProfileHeader):
     20        (WebInspector.ProfileHeader.prototype.loadFromFile):
     21        (WebInspector.ProfileHeader.prototype.fromFile):
     22        (WebInspector.ProfilesPanel.prototype._loadFromFile):
     23
    1242012-05-14  Andrey Kosyakov  <caseq@chromium.org>
    225
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js

    r116855 r116959  
    453453    {
    454454        var selectedNode = event.target.selectedNode;
    455         if (selectedNode instanceof WebInspector.HeapSnapshotGenericObjectNode)
     455        if (!this.profile.fromFile() && selectedNode instanceof WebInspector.HeapSnapshotGenericObjectNode)
    456456            ConsoleAgent.addInspectedHeapObject(selectedNode.snapshotNodeId);
    457457    },
     
    560560    _resolveObjectForPopover: function(element, showCallback, objectGroupName)
    561561    {
     562        if (this.profile.fromFile())
     563            return;
    562564        element.node.queryObjectContent(showCallback, objectGroupName);
    563565    },
     
    689691        }
    690692
    691         if (this.profile._fromFile)
     693        if (this.profile.fromFile())
    692694            return;
    693695        for (var i = this.filterSelectElement.length - 1, n = list.length; i < n; ++i) {
     
    794796    this.maxJSObjectId = maxJSObjectId;
    795797    this._loaded = false;
    796     this._fromFile = false;
    797798    this._totalNumberOfChunks = 0;
    798799}
     
    885886    canSaveToFile: function()
    886887    {
    887         return !this._fromFile && this._loaded && !this._savedChunksCount && WebInspector.fileManager.canAppend();
     888        return !this.fromFile() && this._loaded && !this._savedChunksCount && WebInspector.fileManager.canAppend();
    888889    },
    889890
     
    908909        }
    909910
    910         this._fileName = this._fileName || "Heap-" + new Date().toISO8601Compact() + ".json";
     911        this._fileName = this._fileName || "Heap-" + new Date().toISO8601Compact() + ".heapsnapshot";
    911912        WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.SavedURL, startSavingSnapshot, this);
    912913        WebInspector.fileManager.save(this._fileName, "", true);
     
    943944        }
    944945
    945         this._fromFile = true;
    946946        this.title = file.name;
    947947        this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026");
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r116857 r116959  
    140140        this.isTemporary = false;
    141141    }
     142    this._fromFile = false;
    142143}
    143144
     
    163164     * @param {File} file
    164165     */
    165     loadFromFile: function(file) { throw new Error("Needs implemented"); }
     166    loadFromFile: function(file) { throw new Error("Needs implemented"); },
     167
     168    /**
     169     * @return {boolean}
     170     */
     171    fromFile: function() { return this._fromFile; }
    166172}
    167173
     
    270276        this.addProfileHeader(temporaryProfile);
    271277
     278        temporaryProfile._fromFile = true;
    272279        temporaryProfile.loadFromFile(file);
    273280        this._createFileSelectorElement();
Note: See TracChangeset for help on using the changeset viewer.