Changeset 96575 in webkit


Ignore:
Timestamp:
Oct 4, 2011 1:37:04 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: add DebuggerPresentationModel and ConsoleView to compilation.
https://bugs.webkit.org/show_bug.cgi?id=69269

Reviewed by Yury Semikhatsky.

  • inspector/compile-front-end.sh:
  • inspector/front-end/BreakpointManager.js:

(WebInspector.BreakpointManager.prototype.uiSourceCodeAdded):

  • inspector/front-end/ConsoleView.js:

(WebInspector.ConsoleView.prototype._consoleCleared):
(WebInspector.ConsoleView.prototype._completions.evaluated.getCompletions):
(WebInspector.ConsoleView.prototype._completions.evaluated):
(WebInspector.ConsoleView.prototype._messagesClicked):

  • inspector/front-end/ContentProviders.js:

(WebInspector.StaticContentProvider.prototype.requestContent):
(WebInspector.StaticContentProvider.prototype.searchInContent):

  • inspector/front-end/ContextMenu.js:
  • inspector/front-end/DebuggerPresentationModel.js:

(WebInspector.DebuggerPresentationModel.prototype._addScript):
(WebInspector.DebuggerPresentationModel.prototype._consoleMessageAdded):
(WebInspector.DebuggerPresentationModel.prototype._debuggerPaused):
(WebInspector.DebuggerPresentationModel.prototype._rawSourceCodeForScriptWithURL):
(WebInspector.DebuggerPresentationModel.prototype._rawSourceCodeForScript):
(WebInspector.DebuggerPresentationModel.prototype._scriptForRawSourceCode):
(WebInspector.DebuggerPresentationModel.prototype._createRawSourceCodeId):
(WebInspector.DebuggerPresentationModelResourceBinding.prototype.canSetContent):
(WebInspector.DebuggerPresentationModelResourceBinding.prototype.setContent):

  • inspector/front-end/HelpScreen.js:
  • inspector/front-end/JavaScriptContextManager.js:

(WebInspector.FrameEvaluationContext.prototype.get displayName):

  • inspector/front-end/KeyboardShortcut.js:

(WebInspector.KeyboardShortcut):

  • inspector/front-end/Resource.js:

(WebInspector.Resource.displayName):

  • inspector/front-end/ScriptFormatter.js:

(WebInspector.ScriptFormatter.prototype._didFormatContent):

  • inspector/front-end/ShortcutsScreen.js:
  • inspector/front-end/StatusBarButton.js:
  • inspector/front-end/TextPrompt.js:
  • inspector/front-end/externs.js:

(WebInspector.populateHrefContextMenu):
(WebInspector.useLowerCaseMenuTitles):
(WebInspector.ScriptsPanel.this.evaluateInSelectedCallFrame):
(WebInspector.ScriptsPanel.this.getSelectedCallFrameVariables):
(WebInspector.ScriptsPanel):

  • inspector/front-end/inspector.js:
  • inspector/front-end/utilities.js:
Location:
trunk/Source/WebCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96571 r96575  
     12011-10-03  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: add DebuggerPresentationModel and ConsoleView to compilation.
     4        https://bugs.webkit.org/show_bug.cgi?id=69269
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/compile-front-end.sh:
     9        * inspector/front-end/BreakpointManager.js:
     10        (WebInspector.BreakpointManager.prototype.uiSourceCodeAdded):
     11        * inspector/front-end/ConsoleView.js:
     12        (WebInspector.ConsoleView.prototype._consoleCleared):
     13        (WebInspector.ConsoleView.prototype._completions.evaluated.getCompletions):
     14        (WebInspector.ConsoleView.prototype._completions.evaluated):
     15        (WebInspector.ConsoleView.prototype._messagesClicked):
     16        * inspector/front-end/ContentProviders.js:
     17        (WebInspector.StaticContentProvider.prototype.requestContent):
     18        (WebInspector.StaticContentProvider.prototype.searchInContent):
     19        * inspector/front-end/ContextMenu.js:
     20        * inspector/front-end/DebuggerPresentationModel.js:
     21        (WebInspector.DebuggerPresentationModel.prototype._addScript):
     22        (WebInspector.DebuggerPresentationModel.prototype._consoleMessageAdded):
     23        (WebInspector.DebuggerPresentationModel.prototype._debuggerPaused):
     24        (WebInspector.DebuggerPresentationModel.prototype._rawSourceCodeForScriptWithURL):
     25        (WebInspector.DebuggerPresentationModel.prototype._rawSourceCodeForScript):
     26        (WebInspector.DebuggerPresentationModel.prototype._scriptForRawSourceCode):
     27        (WebInspector.DebuggerPresentationModel.prototype._createRawSourceCodeId):
     28        (WebInspector.DebuggerPresentationModelResourceBinding.prototype.canSetContent):
     29        (WebInspector.DebuggerPresentationModelResourceBinding.prototype.setContent):
     30        * inspector/front-end/HelpScreen.js:
     31        * inspector/front-end/JavaScriptContextManager.js:
     32        (WebInspector.FrameEvaluationContext.prototype.get displayName):
     33        * inspector/front-end/KeyboardShortcut.js:
     34        (WebInspector.KeyboardShortcut):
     35        * inspector/front-end/Resource.js:
     36        (WebInspector.Resource.displayName):
     37        * inspector/front-end/ScriptFormatter.js:
     38        (WebInspector.ScriptFormatter.prototype._didFormatContent):
     39        * inspector/front-end/ShortcutsScreen.js:
     40        * inspector/front-end/StatusBarButton.js:
     41        * inspector/front-end/TextPrompt.js:
     42        * inspector/front-end/externs.js:
     43        (WebInspector.populateHrefContextMenu):
     44        (WebInspector.useLowerCaseMenuTitles):
     45        (WebInspector.ScriptsPanel.this.evaluateInSelectedCallFrame):
     46        (WebInspector.ScriptsPanel.this.getSelectedCallFrameVariables):
     47        (WebInspector.ScriptsPanel):
     48        * inspector/front-end/inspector.js:
     49        * inspector/front-end/utilities.js:
     50
    1512011-10-03  Ryosuke Niwa  <rniwa@webkit.org>
    252
  • trunk/Source/WebCore/inspector/compile-front-end.sh

    r96499 r96575  
    4545        --js Source/WebCore/inspector/front-end/Settings.js \
    4646        --js Source/WebCore/inspector/front-end/UserMetrics.js \
    47     --module jsmodule_sdk:9:jsmodule_common,jsmodule_host \
     47    --module jsmodule_sdk:16:jsmodule_common,jsmodule_host \
     48        --js Source/WebCore/inspector/front-end/ConsoleModel.js \
     49        --js Source/WebCore/inspector/front-end/ContentProviders.js \
     50        --js Source/WebCore/inspector/front-end/CookieParser.js \
     51        --js Source/WebCore/inspector/front-end/BreakpointManager.js \
    4852        --js Source/WebCore/inspector/front-end/DOMAgent.js \
    4953        --js Source/WebCore/inspector/front-end/DebuggerModel.js \
     54        --js Source/WebCore/inspector/front-end/DebuggerPresentationModel.js \
    5055        --js Source/WebCore/inspector/front-end/Script.js \
     56        --js Source/WebCore/inspector/front-end/ScriptFormatter.js \
     57        --js Source/WebCore/inspector/front-end/RawSourceCode.js \
    5158        --js Source/WebCore/inspector/front-end/RemoteObject.js \
    5259        --js Source/WebCore/inspector/front-end/ResourceCategory.js \
    53         --js Source/WebCore/inspector/front-end/CookieParser.js \
    54         --js Source/WebCore/inspector/front-end/ConsoleModel.js \
     60        --js Source/WebCore/inspector/front-end/ResourceTreeModel.js \
    5561        --js Source/WebCore/inspector/front-end/Resource.js \
    5662        --js Source/WebCore/inspector/front-end/NetworkManager.js \
    57     --module jsmodule_misc:11:jsmodule_sdk \
     63        --js Source/WebCore/inspector/front-end/UISourceCode.js \
     64    --module jsmodule_misc:16:jsmodule_sdk \
    5865        --js Source/WebCore/inspector/front-end/Checkbox.js \
    5966        --js Source/WebCore/inspector/front-end/ContextMenu.js \
    6067        --js Source/WebCore/inspector/front-end/ConsoleMessage.js \
     68        --js Source/WebCore/inspector/front-end/ConsoleView.js \
     69        --js Source/WebCore/inspector/front-end/HelpScreen.js \
    6170        --js Source/WebCore/inspector/front-end/KeyboardShortcut.js \
     71        --js Source/WebCore/inspector/front-end/JavaScriptContextManager.js \
    6272        --js Source/WebCore/inspector/front-end/View.js \
    6373        --js Source/WebCore/inspector/front-end/Placard.js \
    6474        --js Source/WebCore/inspector/front-end/Popover.js \
    6575        --js Source/WebCore/inspector/front-end/SoftContextMenu.js \
     76        --js Source/WebCore/inspector/front-end/ShortcutsScreen.js \
     77        --js Source/WebCore/inspector/front-end/StatusBarButton.js \
    6678        --js Source/WebCore/inspector/front-end/TabbedPane.js \
    6779        --js Source/WebCore/inspector/front-end/TextPrompt.js \
  • trunk/Source/WebCore/inspector/front-end/BreakpointManager.js

    r96097 r96575  
    6060            this._materializeBreakpoint(breakpoint);
    6161            if (breakpoint._debuggerLocation)
    62                 this._breakpointDebuggerLocationChanged(breakpoint, breakpoint._debuggerLocation);
     62                this._breakpointDebuggerLocationChanged(breakpoint);
    6363        }
    6464    },
  • trunk/Source/WebCore/inspector/front-end/ConsoleView.js

    r96519 r96575  
    3333 * @extends {WebInspector.View}
    3434 * @constructor
     35 * @param {boolean} hideContextSelector
    3536 */
    36 WebInspector.ConsoleView = function()
     37WebInspector.ConsoleView = function(hideContextSelector)
    3738{
    3839    WebInspector.View.call(this);
     40
    3941    this.element.id = "console-view";
    40 
    4142    this.messages = [];
    4243
     
    4849    this._contextSelectElement.className = "status-bar-item";
    4950
    50     if (WebInspector.WorkerManager.isWorkerFrontend())
     51    if (hideContextSelector)
    5152        this._contextSelectElement.addStyleClass("hidden");
    5253
     
    325326        this.topGroup.messagesElement.removeChildren();
    326327
    327         delete this.commandSincePreviousMessage;
    328         delete this.previousMessage;
    329 
    330328        this.dispatchEventToListeners(WebInspector.ConsoleView.Events.ConsoleCleared);
    331329    },
     
    355353        }
    356354
    357         if (parseInt(expressionString) == expressionString) {
     355        if (parseInt(expressionString, 10) == expressionString) {
    358356            // User is entering float value, do not suggest anything.
    359357            completionsReadyCallback([]);
     
    377375                var object;
    378376                if (primitiveType === "string")
    379                     object = new String();
     377                    object = new String("");
    380378                else if (primitiveType === "number")
    381                     object = new Number();
     379                    object = new Number(0);
    382380                else if (primitiveType === "boolean")
    383                     object = new Boolean();
     381                    object = new Boolean(false);
    384382                else
    385383                    object = this;
     
    500498    _messagesClicked: function(event)
    501499    {
    502         var link = event.target.enclosingNodeOrSelfWithNodeName("a");
    503         if (!link || !link.representedNode) {
    504             if (!this.prompt.isCaretInsidePrompt() && window.getSelection().isCollapsed)
    505                 this.prompt.moveCaretToEndOfPrompt();
    506             return;
    507         }
    508 
    509         WebInspector.updateFocusedNode(link.representedNode.id);
    510         event.stopPropagation();
    511         event.preventDefault();
     500        if (!this.prompt.isCaretInsidePrompt() && window.getSelection().isCollapsed)
     501            this.prompt.moveCaretToEndOfPrompt();
    512502    },
    513503
     
    573563    evalInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptions, returnByValue, callback)
    574564    {
    575         if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
     565        if (WebInspector.panels.scripts.paused) {
    576566            WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, objectGroup, includeCommandLineAPI, returnByValue, callback);
    577567            return;
     
    643633WebInspector.ConsoleView.prototype.__proto__ = WebInspector.View.prototype;
    644634
     635/**
     636 * @constructor
     637 */
    645638WebInspector.ConsoleCommand = function(command)
    646639{
     
    698691}
    699692
     693/**
     694 * @extends {WebInspector.ConsoleMessageImpl}
     695 * @constructor
     696 */
    700697WebInspector.ConsoleCommandResult = function(result, wasThrown, originatingCommand)
    701698{
     
    716713WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessageImpl.prototype;
    717714
     715/**
     716 * @constructor
     717 */
    718718WebInspector.ConsoleGroup = function(parentGroup)
    719719{
  • trunk/Source/WebCore/inspector/front-end/ContentProviders.js

    r96491 r96575  
    187187WebInspector.ResourceContentProvider.prototype.__proto__ = WebInspector.ContentProvider.prototype;
    188188
    189 
     189/**
     190 * @constructor
     191 * @implements {WebInspector.ContentProvider}
     192 */
    190193WebInspector.StaticContentProvider = function(mimeType, content)
    191194{
     
    198201    {
    199202        callback(this._mimeType, this._content);
     203    },
     204
     205    searchInContent: function(query, callback)
     206    {
     207        callback([]);
    200208    }
    201209}
  • trunk/Source/WebCore/inspector/front-end/ContextMenu.js

    r93701 r96575  
    5151    },
    5252
     53    /**
     54     * @param {boolean=} disabled
     55     */
    5356    appendItem: function(label, handler, disabled)
    5457    {
     
    5861    },
    5962
     63    /**
     64     * @param {boolean=} disabled
     65     */
    6066    appendCheckboxItem: function(label, handler, checked, disabled)
    6167    {
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r96519 r96575  
    3131/**
    3232 * @constructor
     33 * @extends {WebInspector.Object}
    3334 */
    3435WebInspector.DebuggerPresentationModel = function()
     
    105106    _addScript: function(script)
    106107    {
    107         var rawSourceCodeId = this._createRawSourceCodeId(script.sourceURL, script.scriptId);
     108        var rawSourceCodeId = this._createRawSourceCodeId(script);
    108109        var rawSourceCode = this._rawSourceCode[rawSourceCodeId];
    109110        if (rawSourceCode) {
     
    250251            return;
    251252
    252         var rawSourceCode = this._rawSourceCodeForScript(message.url);
     253        var rawSourceCode = this._rawSourceCodeForScriptWithURL(message.url);
    253254        if (!rawSourceCode)
    254255            return;
     
    356357            var script = WebInspector.debuggerModel.scriptForSourceID(callFrame.location.scriptId);
    357358            if (script)
    358                 rawSourceCode = this._rawSourceCodeForScript(script.sourceURL, script.scriptId);
     359                rawSourceCode = this._rawSourceCodeForScript(script);
    359360            this._presentationCallFrames.push(new WebInspector.PresentationCallFrame(callFrame, i, this, rawSourceCode));
    360361        }
     
    384385    },
    385386
    386     _rawSourceCodeForScript: function(sourceURL, scriptId)
    387     {
    388         if (!sourceURL) {
    389             var script = WebInspector.debuggerModel.scriptForSourceID(scriptId);
    390             if (!script)
    391                 return;
    392             sourceURL = script.sourceURL;
    393         }
    394         return this._rawSourceCode[this._createRawSourceCodeId(sourceURL, scriptId)];
     387    _rawSourceCodeForScriptWithURL: function(sourceURL)
     388    {
     389        return this._rawSourceCode[sourceURL];
     390    },
     391
     392    _rawSourceCodeForScript: function(script)
     393    {
     394        return this._rawSourceCode[this._createRawSourceCodeId(script)];
    395395    },
    396396
     
    399399        function filter(script)
    400400        {
    401             return this._createRawSourceCodeId(script.sourceURL, script.scriptId) === rawSourceCode.id;
     401            return this._createRawSourceCodeId(script) === rawSourceCode.id;
    402402        }
    403403        return WebInspector.debuggerModel.queryScripts(filter.bind(this))[0];
    404404    },
    405405
    406     _createRawSourceCodeId: function(sourceURL, scriptId)
    407     {
    408         return sourceURL || scriptId;
     406    _createRawSourceCodeId: function(script)
     407    {
     408        return script.sourceURL || script.scriptId;
    409409    },
    410410
     
    519519/**
    520520 * @constructor
    521  * @extends {WebInspector.ResourceDomainModelBinding}
     521 * @implements {WebInspector.ResourceDomainModelBinding}
    522522 */
    523523WebInspector.DebuggerPresentationModelResourceBinding = function(model)
     
    530530    canSetContent: function(resource)
    531531    {
    532         var rawSourceCode = this._presentationModel._rawSourceCodeForScript(resource.url)
     532        var rawSourceCode = this._presentationModel._rawSourceCodeForScriptWithURL(resource.url)
    533533        if (!rawSourceCode)
    534534            return false;
     
    541541            return;
    542542
    543         var rawSourceCode = this._presentationModel._rawSourceCodeForScript(resource.url);
     543        var rawSourceCode = this._presentationModel._rawSourceCodeForScriptWithURL(resource.url);
    544544        if (!rawSourceCode) {
    545545            userCallback("Resource is not editable");
  • trunk/Source/WebCore/inspector/front-end/HelpScreen.js

    r90387 r96575  
    2929 */
    3030
     31/**
     32 * @constructor
     33 */
    3134WebInspector.HelpScreen = function(title)
    3235{
  • trunk/Source/WebCore/inspector/front-end/JavaScriptContextManager.js

    r92476 r96575  
    2929 */
    3030
     31/**
     32 * @constructor
     33 * @extends {WebInspector.Object}
     34 */
    3135WebInspector.JavaScriptContextManager = function(resourceTreeModel, consoleView)
    3236{
     
    6973WebInspector.JavaScriptContextManager.prototype.__proto__ = WebInspector.Object.prototype;
    7074
     75/**
     76 * @constructor
     77 * @extends {WebInspector.Object}
     78 */
    7179WebInspector.FrameEvaluationContext = function(frame)
    7280{
     
    101109            return "<top frame>";
    102110        var name = this._frame.name || "";
    103         var subtitle = new WebInspector.Resource(null, this._frame.url).displayName;
     111        var subtitle = WebInspector.Resource.displayName(this._frame.url);
    104112        if (subtitle) {
    105113            if (!name)
  • trunk/Source/WebCore/inspector/front-end/KeyboardShortcut.js

    r93701 r96575  
    3333WebInspector.KeyboardShortcut = function()
    3434{
    35 };
     35}
    3636
    3737/**
     
    132132}
    133133
     134/**
     135 * @param {number=} modifiers
     136 */
    134137WebInspector.KeyboardShortcut.shortcutToString = function(key, modifiers)
    135138{
  • trunk/Source/WebCore/inspector/front-end/Resource.js

    r96499 r96575  
    7070 * @extends {WebInspector.Object}
    7171 *
    72  * @param {NetworkAgent.RequestId} requestId
     72 * @param {?NetworkAgent.RequestId} requestId
    7373 * @param {string} url
    7474 * @param {?string} frameId
     
    9494}
    9595
     96WebInspector.Resource.displayName = function(url)
     97{
     98    return new WebInspector.Resource(null, url, null, null).displayName;
     99}
     100
    96101// Keep these in sync with WebCore::InspectorResource::Type
    97102WebInspector.Resource.Type = {
     
    165170    WebInspector.Resource._domainModelBindings[type] = binding;
    166171}
    167 
    168172
    169173WebInspector.Resource._resourceRevisionRegistry = function()
     
    837841    },
    838842
     843    /**
     844     * @param {string} newContent
     845     * @param {Date=} timestamp
     846     * @param {boolean=} restoringHistory
     847     */
    839848    addRevision: function(newContent, timestamp, restoringHistory)
    840849    {
  • trunk/Source/WebCore/inspector/front-end/ScriptFormatter.js

    r93706 r96575  
    6868        var originalContent = task.data.content;
    6969        var formattedContent = event.data.content;
    70         var mapping = event.data.mapping;
     70        var mapping = event.data["mapping"];
    7171        var sourceMapping = new WebInspector.FormattedSourceMapping(originalContent.lineEndings(), formattedContent.lineEndings(), mapping);
    7272        task.callback(formattedContent, sourceMapping);
  • trunk/Source/WebCore/inspector/front-end/ShortcutsScreen.js

    r94754 r96575  
    2929 */
    3030
     31/**
     32 * @constructor
     33 */
    3134WebInspector.ShortcutsScreen = function()
    3235{
     
    9194        parent.appendChild(table);
    9295    }
    93 };
     96}
    9497
    9598WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen();
    9699
     100/**
     101 * @constructor
     102 */
    97103WebInspector.ShortcutsSection = function(name)
    98104{
     
    163169        return this._lines.length + 2; // add some space for header
    164170    }
    165 };
     171}
  • trunk/Source/WebCore/inspector/front-end/StatusBarButton.js

    r94754 r96575  
    2929 */
    3030
     31/**
     32 * @extends {WebInspector.Object}
     33 * @constructor
     34 * @param {Array.<string>=} states
     35 */
    3136WebInspector.StatusBarButton = function(title, className, states)
    3237{
  • trunk/Source/WebCore/inspector/front-end/TextPrompt.js

    r93701 r96575  
    2929/**
    3030 * @constructor
     31 * @param {boolean=} omitHistory
    3132 */
    3233WebInspector.TextPrompt = function(element, completions, stopCharacters, omitHistory)
  • trunk/Source/WebCore/inspector/front-end/externs.js

    r96499 r96575  
    112112{
    113113}
     114
     115/**
     116 * @param {WebInspector.ContextMenu} contextMenu
     117 * @param {Node} contextNode
     118 * @param {Event} event
     119 */
     120WebInspector.populateHrefContextMenu = function(contextMenu, contextNode, event)
     121{
     122}
     123
     124/**
     125 * @return {boolean}
     126 */
     127WebInspector.useLowerCaseMenuTitles = function()
     128{
     129}
     130
     131WebInspector.panels = {};
     132
     133/**
     134 * @constructor
     135 */
     136WebInspector.ScriptsPanel = function()
     137{
     138    /** @param {...*} var_args */     
     139    this.evaluateInSelectedCallFrame = function(var_args) {}
     140    /** @param {...*} var_args */     
     141    this.getSelectedCallFrameVariables = function(var_args) {}
     142    this.paused = false;
     143}
     144
     145/**
     146 * @type {?WebInspector.ScriptsPanel}
     147 */
     148WebInspector.panels.scripts = null;
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r96519 r96575  
    511511
    512512    this.drawer = new WebInspector.Drawer();
    513     this.consoleView = new WebInspector.ConsoleView();
     513    this.consoleView = new WebInspector.ConsoleView(WebInspector.WorkerManager.isWorkerFrontend());
    514514
    515515    this.networkManager = new WebInspector.NetworkManager();
  • trunk/Source/WebCore/inspector/front-end/utilities.js

    r96499 r96575  
    251251}
    252252
     253/**
     254 * @param {string=} className
     255 */
    253256Element.prototype.createChild = function(elementName, className)
    254257{
Note: See TracChangeset for help on using the changeset viewer.