Changeset 125922 in webkit


Ignore:
Timestamp:
Aug 17, 2012 11:57:24 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: make profiles panel a lazily loaded module.
https://bugs.webkit.org/show_bug.cgi?id=94351

Reviewed by Yury Semikhatsky.

Source/WebCore:

Moving files from .html to importScript.

  • WebCore.gypi:
  • inspector/front-end/CPUProfileView.js:

(WebInspector.CPUProfileHeader.prototype.createView):

  • inspector/front-end/CSSSelectorProfileView.js:

(WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
(WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile):
(WebInspector.CSSSelectorProfileType.prototype._stopRecordingProfile):
(WebInspector.CSSProfileHeader.prototype.createView):

  • inspector/front-end/HeapSnapshotDataGrids.js:

(WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.revealInDominatorsView):
(WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.else.revealInSummaryView):
(WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu):

  • inspector/front-end/HeapSnapshotView.js:

(WebInspector.HeapSnapshotView.prototype._profiles):
(WebInspector.HeapSnapshotView.prototype.populateContextMenu):
(WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
(WebInspector.HeapProfileHeader.prototype.createView):

  • inspector/front-end/InspectorFrontendAPI.js:

(InspectorFrontendAPI.isProfilingJavaScript):
(InspectorFrontendAPI.startProfilingJavaScript):
(InspectorFrontendAPI.stopProfilingJavaScript):

  • inspector/front-end/NativeMemorySnapshotView.js:

(WebInspector.NativeMemoryProfileHeader.prototype.createView):

  • inspector/front-end/ProfilesPanel.js:

(WebInspector.ProfileType.prototype.buttonClicked):
(WebInspector.ProfileHeader.prototype.view):
(WebInspector.ProfileHeader.prototype.createView):
(WebInspector.ProfilesPanel.prototype.toggleRecordButton):
(WebInspector.ProfilesPanel.prototype.showProfileForURL):
(WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu.didReceiveHeapObjectId):
(WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu):
(WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
(WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):

  • inspector/front-end/externs.js:
  • inspector/front-end/inspector.html:
  • inspector/front-end/inspector.js:

(WebInspector._panelDescriptors):
(WebInspector._toggleSearchingForNode):
(WebInspector._profilesLinkifier):
(WebInspector._requestZoom.set InspectorFrontendHost):
(WebInspector._requestZoom):
(WebInspector.documentClick.followLink):
(WebInspector.documentClick):

Source/WebKit/chromium:

  • WebKit.gyp:
Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html

    r117234 r125922  
    1414function test()
    1515{
     16    WebInspector.showPanel("profiles");
    1617    ProfilerAgent.takeHeapSnapshot(step0);
    1718
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html

    r124591 r125922  
    1212    }
    1313
     14    WebInspector.showPanel("profiles");
    1415    var source = InspectorTest.createHeapSnapshotMockRaw();
    1516    var sourceStringified = JSON.stringify(source);
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-show-ranges.html

    r116847 r125922  
    77function test()
    88{
     9    WebInspector.showPanel("profiles");
     10
    911    var instanceCount = 50;
    1012    function createHeapSnapshot()
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-summary-shown-node-count-preserved-when-sorting.html

    r114271 r125922  
    77function test()
    88{
     9    WebInspector.showPanel("profiles");
     10
    911    var instanceCount = 25;
    1012    function createHeapSnapshot()
  • trunk/Source/WebCore/ChangeLog

    r125920 r125922  
     12012-08-17  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: make profiles panel a lazily loaded module.
     4        https://bugs.webkit.org/show_bug.cgi?id=94351
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        Moving files from .html to importScript.
     9
     10        * WebCore.gypi:
     11        * inspector/front-end/CPUProfileView.js:
     12        (WebInspector.CPUProfileHeader.prototype.createView):
     13        * inspector/front-end/CSSSelectorProfileView.js:
     14        (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
     15        (WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile):
     16        (WebInspector.CSSSelectorProfileType.prototype._stopRecordingProfile):
     17        (WebInspector.CSSProfileHeader.prototype.createView):
     18        * inspector/front-end/HeapSnapshotDataGrids.js:
     19        (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.revealInDominatorsView):
     20        (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.else.revealInSummaryView):
     21        (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu):
     22        * inspector/front-end/HeapSnapshotView.js:
     23        (WebInspector.HeapSnapshotView.prototype._profiles):
     24        (WebInspector.HeapSnapshotView.prototype.populateContextMenu):
     25        (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
     26        (WebInspector.HeapProfileHeader.prototype.createView):
     27        * inspector/front-end/InspectorFrontendAPI.js:
     28        (InspectorFrontendAPI.isProfilingJavaScript):
     29        (InspectorFrontendAPI.startProfilingJavaScript):
     30        (InspectorFrontendAPI.stopProfilingJavaScript):
     31        * inspector/front-end/NativeMemorySnapshotView.js:
     32        (WebInspector.NativeMemoryProfileHeader.prototype.createView):
     33        * inspector/front-end/ProfilesPanel.js:
     34        (WebInspector.ProfileType.prototype.buttonClicked):
     35        (WebInspector.ProfileHeader.prototype.view):
     36        (WebInspector.ProfileHeader.prototype.createView):
     37        (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
     38        (WebInspector.ProfilesPanel.prototype.showProfileForURL):
     39        (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu.didReceiveHeapObjectId):
     40        (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu):
     41        (WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
     42        (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):
     43        * inspector/front-end/externs.js:
     44        * inspector/front-end/inspector.html:
     45        * inspector/front-end/inspector.js:
     46        (WebInspector._panelDescriptors):
     47        (WebInspector._toggleSearchingForNode):
     48        (WebInspector._profilesLinkifier):
     49        (WebInspector._requestZoom.set InspectorFrontendHost):
     50        (WebInspector._requestZoom):
     51        (WebInspector.documentClick.followLink):
     52        (WebInspector.documentClick):
     53
    1542012-08-17  Dominic Mazzoni  <dmazzoni@google.com>
    255
  • trunk/Source/WebCore/WebCore.gypi

    r125897 r125922  
    62566256            'inspector/front-end/AdvancedSearchController.js',
    62576257            'inspector/front-end/ApplicationCacheModel.js',
    6258             'inspector/front-end/BottomUpProfileDataGridTree.js',
    62596258            'inspector/front-end/BreakpointManager.js',
    62606259            'inspector/front-end/BreakpointsSidebarPane.js',
     
    62736272            'inspector/front-end/CookieParser.js',
    62746273            'inspector/front-end/CookiesTable.js',
    6275             'inspector/front-end/CPUProfileView.js',
    62766274            'inspector/front-end/CSSCompletions.js',
    62776275            'inspector/front-end/CSSKeywordCompletions.js',
    6278             'inspector/front-end/CSSSelectorProfileView.js',
    62796276            'inspector/front-end/CSSStyleModel.js',
    62806277            'inspector/front-end/Database.js',
     
    63076304            'inspector/front-end/HAREntry.js',
    63086305            'inspector/front-end/HandlerRegistry.js',
    6309             'inspector/front-end/HeapSnapshot.js',
    6310             'inspector/front-end/HeapSnapshotDataGrids.js',
    6311             'inspector/front-end/HeapSnapshotGridNodes.js',
    6312             'inspector/front-end/HeapSnapshotLoader.js',
    6313             'inspector/front-end/HeapSnapshotProxy.js',
    6314             'inspector/front-end/HeapSnapshotView.js',
    63156306            'inspector/front-end/HeapSnapshotWorker.js',
    6316             'inspector/front-end/HeapSnapshotWorkerDispatcher.js',
    63176307            'inspector/front-end/HelpScreen.js',
    63186308            'inspector/front-end/ImageView.js',
     
    63306320            'inspector/front-end/KeyboardShortcut.js',
    63316321            'inspector/front-end/Linkifier.js',
    6332             'inspector/front-end/NativeMemorySnapshotView.js',
    63336322            'inspector/front-end/NavigatorOverlayController.js',
    63346323            'inspector/front-end/NavigatorView.js',
     
    63466335            'inspector/front-end/Popover.js',
    63476336            'inspector/front-end/PresentationConsoleMessageHelper.js',
    6348             'inspector/front-end/ProfileDataGridTree.js',
    6349             'inspector/front-end/ProfileLauncherView.js',
    6350             'inspector/front-end/ProfilesPanel.js',
    63516337            'inspector/front-end/ProgressBar.js',
    63526338            'inspector/front-end/PropertiesSection.js',
     
    64096395            'inspector/front-end/TimelineManager.js',
    64106396            'inspector/front-end/Toolbar.js',
    6411             'inspector/front-end/TopDownProfileDataGridTree.js',
    64126397            'inspector/front-end/treeoutline.js',
    64136398            'inspector/front-end/UISourceCode.js',
     
    64826467            'inspector/front-end/TimelinePanel.js',
    64836468        ],
     6469
     6470        'webinspector_profiles_js_files': [
     6471            'inspector/front-end/BottomUpProfileDataGridTree.js',
     6472            'inspector/front-end/CPUProfileView.js',
     6473            'inspector/front-end/CSSSelectorProfileView.js',
     6474            'inspector/front-end/HeapSnapshot.js',
     6475            'inspector/front-end/HeapSnapshotDataGrids.js',
     6476            'inspector/front-end/HeapSnapshotGridNodes.js',
     6477            'inspector/front-end/HeapSnapshotLoader.js',
     6478            'inspector/front-end/HeapSnapshotProxy.js',
     6479            'inspector/front-end/HeapSnapshotView.js',
     6480            'inspector/front-end/HeapSnapshotWorkerDispatcher.js',
     6481            'inspector/front-end/NativeMemorySnapshotView.js',
     6482            'inspector/front-end/ProfileDataGridTree.js',
     6483            'inspector/front-end/ProfilesPanel.js',
     6484            'inspector/front-end/ProfileLauncherView.js',
     6485            'inspector/front-end/TopDownProfileDataGridTree.js',
     6486        ],
     6487
    64846488        'webinspector_audits_js_files': [
    64856489            'inspector/front-end/AuditCategories.js',
     
    64986502            'inspector/front-end/cm/xml.js',
    64996503        ],
     6504
    65006505        'webinspector_modules_js_files': [
    65016506            '<@(webinspector_elements_js_files)',
    65026507            '<@(webinspector_resources_js_files)',
    65036508            '<@(webinspector_timeline_js_files)',
     6509            '<@(webinspector_profiles_js_files)',
    65046510            '<@(webinspector_audits_js_files)',
    65056511            '<@(webinspector_codemirror_js_files)',
  • trunk/Source/WebCore/inspector/front-end/CPUProfileView.js

    r125863 r125922  
    651651    /**
    652652     * @override
     653     * @param {WebInspector.ProfilesPanel} profilesPanel
    653654     */
    654     createView: function()
     655    createView: function(profilesPanel)
    655656    {
    656657        return new WebInspector.CPUProfileView(this);
  • trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js

    r118503 r125922  
    287287    /**
    288288     * @override
     289     * @param {WebInspector.ProfilesPanel} profilesPanel
    289290     * @return {boolean}
    290291     */
    291     buttonClicked: function()
     292    buttonClicked: function(profilesPanel)
    292293    {
    293294        if (this._recording) {
    294             this._stopRecordingProfile();
     295            this._stopRecordingProfile(profilesPanel);
    295296            return false;
    296297        } else {
    297             this._startRecordingProfile();
     298            this._startRecordingProfile(profilesPanel);
    298299            return true;
    299300        }
     
    320321    },
    321322
    322     _startRecordingProfile: function()
     323    /**
     324     * @param {WebInspector.ProfilesPanel} profilesPanel
     325     */
     326    _startRecordingProfile: function(profilesPanel)
    323327    {
    324328        this._recording = true;
    325329        CSSAgent.startSelectorProfiler();
    326         WebInspector.panels.profiles.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, true);
    327     },
    328 
    329     _stopRecordingProfile: function()
     330        profilesPanel.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, true);
     331    },
     332
     333    /**
     334     * @param {WebInspector.ProfilesPanel} profilesPanel
     335     */
     336    _stopRecordingProfile: function(profilesPanel)
    330337    {
    331338        /**
     
    341348            var title = WebInspector.UIString("Profile %d", uid) + String.sprintf(" (%s)", Number.secondsToString(profile.totalTime / 1000));
    342349            var profileHeader = new WebInspector.CSSProfileHeader(this, title, uid, profile);
    343             WebInspector.panels.profiles.addProfileHeader(profileHeader);
    344             WebInspector.panels.profiles.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, false);
     350            profilesPanel.addProfileHeader(profileHeader);
     351            profilesPanel.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, false);
    345352        }
    346353
     
    389396    /**
    390397     * @override
    391      */
    392     createView: function()
     398     * @param {WebInspector.ProfilesPanel} profilesPanel
     399     */
     400    createView: function(profilesPanel)
    393401    {
    394402        var profile = /** @type {CSSAgent.SelectorProfile} */this._protocolData;
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js

    r121240 r125922  
    9898
    9999    /**
     100     * @param {WebInspector.ProfilesPanel} profilesPanel
    100101     * @param {WebInspector.ContextMenu} contextMenu
    101      */
    102     populateContextMenu: function(contextMenu, event)
     102     * @param {Event} event
     103     */
     104    populateContextMenu: function(profilesPanel, contextMenu, event)
    103105    {
    104106        var td = event.target.enclosingNodeOrSelfWithNodeName("td");
     
    109111            function revealInDominatorsView()
    110112            {
    111                 WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Dominators");
     113                profilesPanel.showObject(node.snapshotNodeId, "Dominators");
    112114            }
    113115            contextMenu.appendItem(WebInspector.UIString("Reveal in Dominators View"), revealInDominatorsView.bind(this));
     
    115117            function revealInSummaryView()
    116118            {
    117                 WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Summary");
     119                profilesPanel.showObject(node.snapshotNodeId, "Summary");
    118120            }
    119121            contextMenu.appendItem(WebInspector.UIString("Reveal in Summary View"), revealInSummaryView.bind(this));
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js

    r124591 r125922  
    3232 * @constructor
    3333 * @extends {WebInspector.View}
     34 * @param {WebInspector.ProfilesPanel} parent
    3435 */
    3536WebInspector.HeapSnapshotView = function(parent, profile)
     
    408409    _profiles: function()
    409410    {
    410         return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
     411        return this.parent.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
    411412    },
    412413
     
    421422    /**
    422423     * @param {WebInspector.ContextMenu} contextMenu
     424     * @param {Event} event
    423425     */
    424426    populateContextMenu: function(contextMenu, event)
    425427    {
    426         this.dataGrid.populateContextMenu(contextMenu, event);
     428        this.dataGrid.populateContextMenu(this.parent, contextMenu, event);
    427429    },
    428430
     
    721723WebInspector.HeapSnapshotView.prototype.__proto__ = WebInspector.View.prototype;
    722724
    723 WebInspector.settings.showHeapSnapshotObjectsHiddenProperties = WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
    724 
    725725/**
    726726 * @constructor
     
    742742    /**
    743743     * @override
     744     * @param {WebInspector.ProfilesPanel} profilesPanel
    744745     * @return {boolean}
    745746     */
    746     buttonClicked: function()
    747     {
    748         WebInspector.panels.profiles.takeHeapSnapshot();
     747    buttonClicked: function(profilesPanel)
     748    {
     749        profilesPanel.takeHeapSnapshot();
    749750        return false;
    750751    },
     
    847848    /**
    848849     * @override
    849      */
    850     createView: function()
    851     {
    852         return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, this);
     850     * @param {WebInspector.ProfilesPanel} profilesPanel
     851     */
     852    createView: function(profilesPanel)
     853    {
     854        return new WebInspector.HeapSnapshotView(profilesPanel, this);
    853855    },
    854856
  • trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js

    r125871 r125922  
    5858    isProfilingJavaScript: function()
    5959    {
    60         return WebInspector.CPUProfileType.instance && WebInspector.CPUProfileType.instance.isRecordingProfile();
     60        return WebInspector.panels.profiles && WebInspector.CPUProfileType.instance && WebInspector.CPUProfileType.instance.isRecordingProfile();
    6161    },
    6262
    6363    startProfilingJavaScript: function()
    6464    {
    65         WebInspector.panels.profiles.enableProfiler();
    66         WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
     65        WebInspector.showPanel("profiles").enableProfiler();
    6766        if (WebInspector.CPUProfileType.instance)
    6867            WebInspector.CPUProfileType.instance.startRecordingProfile();
     
    7170    stopProfilingJavaScript: function()
    7271    {
     72        WebInspector.showPanel("profiles");
    7373        if (WebInspector.CPUProfileType.instance)
    7474            WebInspector.CPUProfileType.instance.stopRecordingProfile();
    75         WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
    7675    },
    7776
  • trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js

    r124332 r125922  
    8383    /**
    8484     * @override
     85     * @param {WebInspector.ProfilesPanel} profilesPanel
    8586     * @return {boolean}
    8687     */
    87     buttonClicked: function()
    88     {
    89         var profilesPanel = WebInspector.panels.profiles;
     88    buttonClicked: function(profilesPanel)
     89    {
    9090        var profileHeader = new WebInspector.NativeMemoryProfileHeader(this, WebInspector.UIString("Snapshot %d", this._nextProfileUid), this._nextProfileUid);
    9191        ++this._nextProfileUid;
     
    179179    /**
    180180     * @override
    181      */
    182     createView: function()
     181     * @param {WebInspector.ProfilesPanel} profilesPanel
     182     */
     183    createView: function(profilesPanel)
    183184    {
    184185        return new WebInspector.NativeMemorySnapshotView(this);
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r125871 r125922  
    3939}
    4040
    41 WebInspector.ProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
    42 
    4341WebInspector.ProfileType.prototype = {
    4442    get buttonTooltip()
     
    6361
    6462    /**
     63     * @param {WebInspector.ProfilesPanel} profilesPanel
    6564     * @return {boolean}
    6665     */
    67     buttonClicked: function()
     66    buttonClicked: function(profilesPanel)
    6867    {
    6968        return false;
     
    9897    }
    9998}
    100 
    101 WebInspector.registerLinkifierPlugin(function(title)
    102 {
    103     var profileStringMatches = WebInspector.ProfileType.URLRegExp.exec(title);
    104     if (profileStringMatches)
    105         title = WebInspector.panels.profiles.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
    106     return title;
    107 });
    10899
    109100/**
     
    150141    {
    151142        if (!this._view)
    152             this._view = this.createView();
     143            this._view = this.createView(WebInspector.ProfilesPanel._instance);
    153144        return this._view;
    154145    },
    155146
    156     createView: function()
     147    /**
     148     * @param {WebInspector.ProfilesPanel} profilesPanel
     149     */
     150    createView: function(profilesPanel)
    157151    {
    158152        throw new Error("Not implemented.");
     
    194188{
    195189    WebInspector.Panel.call(this, "profiles");
     190    WebInspector.ProfilesPanel._instance = this;
    196191    this.registerRequiredCSS("panelEnablerView.css");
    197192    this.registerRequiredCSS("heapProfiler.css");
     
    302297    toggleRecordButton: function()
    303298    {
    304         var isProfiling = this._selectedProfileType.buttonClicked();
     299        var isProfiling = this._selectedProfileType.buttonClicked(this);
    305300        this.recordButton.toggled = isProfiling;
    306301        this.recordButton.title = this._selectedProfileType.buttonTooltip;
     
    701696    showProfileForURL: function(url)
    702697    {
    703         var match = url.match(WebInspector.ProfileType.URLRegExp);
     698        var match = url.match(WebInspector.ProfileURLRegExp);
    704699        if (!match)
    705700            return;
     
    11051100    populateContextMenu: function(section, contextMenu)
    11061101    {
    1107         if (WebInspector.inspectorView.currentPanel() !== WebInspector.panels.profiles)
     1102        if (WebInspector.inspectorView.currentPanel() !== WebInspector.ProfilesPanel._instance)
    11081103            return;
    11091104
     
    11121107            return;
    11131108
    1114         var heapProfiles = WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
     1109        var heapProfiles = WebInspector.ProfilesPanel._instance.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
    11151110        if (!heapProfiles.length)
    11161111            return;
     
    11231118        function didReceiveHeapObjectId(viewName, error, result)
    11241119        {
    1125             if (WebInspector.inspectorView.currentPanel() !== WebInspector.panels.profiles)
     1120            if (WebInspector.inspectorView.currentPanel() !== WebInspector.ProfilesPanel._instance)
    11261121                return;
    11271122            if (!error)
    1128                 WebInspector.panels.profiles.showObject(result, viewName);
     1123                WebInspector.ProfilesPanel._instance.showObject(result, viewName);
    11291124        }
    11301125
     
    12661261        if (profile.canSaveToFile())
    12671262            contextMenu.appendItem(WebInspector.UIString("Save profile\u2026"), profile.saveToFile.bind(profile));
    1268         contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), WebInspector.panels.profiles._fileSelectorElement.click.bind(WebInspector.panels.profiles._fileSelectorElement));
     1263        // FIXME: use context menu provider
     1264        var profilesPanel = WebInspector.ProfilesPanel._instance;
     1265        contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), profilesPanel._fileSelectorElement.click.bind(profilesPanel._fileSelectorElement));
    12691266        contextMenu.appendItem(WebInspector.UIString("Delete profile"), this.ondelete.bind(this));
    12701267        contextMenu.show(event);
     
    12891286    {
    12901287        if (this.children.length > 0)
    1291             WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile);
     1288            WebInspector.ProfilesPanel._instance.showProfile(this.children[this.children.length - 1].profile);
    12921289    }
    12931290}
     
    13201317
    13211318WebInspector.ProfilesSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
     1319
     1320importScript("ProfileDataGridTree.js");
     1321importScript("BottomUpProfileDataGridTree.js");
     1322importScript("CPUProfileView.js");
     1323importScript("CSSSelectorProfileView.js");
     1324importScript("HeapSnapshot.js");
     1325importScript("HeapSnapshotDataGrids.js");
     1326importScript("HeapSnapshotGridNodes.js");
     1327importScript("HeapSnapshotLoader.js");
     1328importScript("HeapSnapshotProxy.js");
     1329importScript("HeapSnapshotView.js");
     1330importScript("HeapSnapshotWorkerDispatcher.js");
     1331importScript("NativeMemorySnapshotView.js");
     1332importScript("ProfileLauncherView.js");
     1333importScript("TopDownProfileDataGridTree.js");
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r125201 r125922  
    4343    exposeDisableCache: false,
    4444    applicationTitle: "Web Inspector - %s",
    45     showHeapSnapshotObjectsHiddenProperties: false,
    4645    showDockToRight: false,
    4746    exposeFileSystemInspection: false
     
    102101    this.geolocationOverride = this.createSetting("geolocationOverride", "");
    103102    this.deviceOrientationOverride = this.createSetting("deviceOrientationOverride", "");
     103    this.showHeapSnapshotObjectsHiddenProperties = this.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
    104104
    105105    // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
  • trunk/Source/WebCore/inspector/front-end/externs.js

    r125863 r125922  
    247247/** @constructor */
    248248WebInspector.CodeMirrorTextEditor = function(url, delegate) { }
     249
     250WebInspector.ProfileURLRegExp = "";
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r125897 r125922  
    122122    <script type="text/javascript" src="RevisionHistoryView.js"></script>
    123123    <script type="text/javascript" src="ScriptsNavigator.js"></script>
    124     <script type="text/javascript" src="ProfilesPanel.js"></script>
    125124    <script type="text/javascript" src="ConsolePanel.js"></script>
    126125    <script type="text/javascript" src="ExtensionAPI.js"></script>
     
    151150    <script type="text/javascript" src="FontView.js"></script>
    152151    <script type="text/javascript" src="ImageView.js"></script>
    153     <script type="text/javascript" src="ProfileLauncherView.js"></script>
    154     <script type="text/javascript" src="ProfileDataGridTree.js"></script>
    155     <script type="text/javascript" src="BottomUpProfileDataGridTree.js"></script>
    156     <script type="text/javascript" src="TopDownProfileDataGridTree.js"></script>
    157     <script type="text/javascript" src="CPUProfileView.js"></script>
    158     <script type="text/javascript" src="CSSSelectorProfileView.js"></script>
    159     <script type="text/javascript" src="HeapSnapshot.js"></script>
    160     <script type="text/javascript" src="HeapSnapshotProxy.js"></script>
    161     <script type="text/javascript" src="HeapSnapshotWorkerDispatcher.js"></script>
    162     <script type="text/javascript" src="HeapSnapshotGridNodes.js"></script>
    163     <script type="text/javascript" src="HeapSnapshotLoader.js"></script>
    164     <script type="text/javascript" src="HeapSnapshotDataGrids.js"></script>
    165     <script type="text/javascript" src="HeapSnapshotView.js"></script>
    166     <script type="text/javascript" src="NativeMemorySnapshotView.js"></script>
    167152    <script type="text/javascript" src="DebuggerModel.js"></script>
    168153    <script type="text/javascript" src="SourceMapping.js"></script>
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r125897 r125922  
    4343        var scripts = new WebInspector.PanelDescriptor("scripts", WebInspector.UIString("Sources"), undefined, undefined, new WebInspector.ScriptsPanel());
    4444        var timeline = new WebInspector.PanelDescriptor("timeline", WebInspector.UIString("Timeline"), "TimelinePanel", "TimelinePanel.js");
    45         var profiles = new WebInspector.PanelDescriptor("profiles", WebInspector.UIString("Profiles"), undefined, undefined, new WebInspector.ProfilesPanel());
     45        var profiles = new WebInspector.PanelDescriptor("profiles", WebInspector.UIString("Profiles"), "ProfilesPanel", "ProfilesPanel.js");
    4646        var audits = new WebInspector.PanelDescriptor("audits", WebInspector.UIString("Audits"), "AuditsPanel", "AuditsPanel.js");
    4747        var console = new WebInspector.PanelDescriptor("console", WebInspector.UIString("Console"), "ConsolePanel");
     
    385385        }
    386386        WebInspector.domAgent.setInspectModeEnabled(enabled, callback.bind(this));
     387    },
     388
     389    _profilesLinkifier: function(title)
     390    {
     391        var profileStringMatches = WebInspector.ProfileURLRegExp.exec(title);
     392        if (profileStringMatches) {
     393            var profilesPanel = /** @ type {WebInspector.ProfilesPanel} */ WebInspector.panel("profiles");
     394            title = WebInspector.ProfilesPanel._instance.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
     395        }
     396        return title;
    387397    }
    388398}
     
    528538
    529539    this.addMainEventListeners(document);
     540    WebInspector.registerLinkifierPlugin(this._profilesLinkifier.bind(this));
    530541
    531542    window.addEventListener("resize", this.windowResize.bind(this), true);
     
    672683            return;
    673684
    674         const profileMatch = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
     685        const profileMatch = WebInspector.ProfileURLRegExp.exec(anchor.href);
    675686        if (profileMatch) {
    676687            WebInspector.showProfileForURL(anchor.href);
     
    10771088    this.resourceTreeModel.frontendReused();
    10781089}
     1090
     1091WebInspector.ProfileURLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
  • trunk/Source/WebKit/chromium/ChangeLog

    r125909 r125922  
     12012-08-17  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: make profiles panel a lazily loaded module.
     4        https://bugs.webkit.org/show_bug.cgi?id=94351
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * WebKit.gyp:
     9
    1102012-08-17  Keishi Hattori  <keishi@webkit.org>
    211
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r125897 r125922  
    877877                                     'concatenated_devtools_resources_js',
    878878                                     'concatenated_devtools_timeline_js',
     879                                     'concatenated_devtools_profiles_js',
    879880                                     'concatenated_devtools_audits_js',
    880881                                     'concatenated_devtools_codemirror_js',
     
    962963                                     'concatenated_devtools_resources_js',
    963964                                     'concatenated_devtools_timeline_js',
     965                                     'concatenated_devtools_profiles_js',
    964966                                     'concatenated_devtools_audits_js',
    965967                                     'concatenated_devtools_codemirror_js',
     
    983985                    '<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js',
    984986                    '<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js',
     987                    '<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js',
    985988                    '<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js',
    986989                    '<(PRODUCT_DIR)/resources/inspector/CodeMirrorTextEditor.js',
     
    11541157                },
    11551158                {
     1159                    'target_name': 'concatenated_devtools_profiles_js',
     1160                    'type': 'none',
     1161                    'actions': [{
     1162                        'action_name': 'concatenate_devtools_profiles_js',
     1163                        'script_name': 'scripts/inline_js_imports.py',
     1164                        'input_file': '../../WebCore/inspector/front-end/ProfilesPanel.js',
     1165                        'inputs': [
     1166                            '<@(_script_name)',
     1167                            '<@(webinspector_profiles_js_files)',
     1168                        ],
     1169                        'search_path': '../../WebCore/inspector/front-end',
     1170                        'outputs': ['<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js'],
     1171                        'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
     1172                    }],
     1173                },
     1174                {
    11561175                    'target_name': 'concatenated_devtools_audits_js',
    11571176                    'type': 'none',
Note: See TracChangeset for help on using the changeset viewer.