Changeset 93389 in webkit


Ignore:
Timestamp:
Aug 19, 2011 1:42:03 AM (13 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: backend js api: an ability to skip optional arguments in the middle of the argument list is required.
https://bugs.webkit.org/show_bug.cgi?id=66482

There are functions in the API with multiple optional arguments.
When we call it we have to specify an optional argument as 'undefined' if we want to pass non default value for the next one.
This can be solved with passing the arguments as an object.

Reviewed by Pavel Feldman.

Source/WebCore:

  • inspector/CodeGeneratorInspector.pm:
  • inspector/front-end/RemoteObject.js:

LayoutTests:

  • inspector/debugger/debugger-set-breakpoint-regex.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93387 r93389  
     12011-08-19  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: backend js api: an ability to skip optional arguments in the middle of the argument list is required.
     4        https://bugs.webkit.org/show_bug.cgi?id=66482
     5
     6        There are functions in the API with multiple optional arguments.
     7        When we call it we have to specify an optional argument as 'undefined' if we want to pass non default value for the next one.
     8        This can be solved with passing the arguments as an object.
     9
     10        Reviewed by Pavel Feldman.
     11
     12        * inspector/debugger/debugger-set-breakpoint-regex.html:
     13
    1142011-08-18  Shawn Singh  <shawnsingh@chromium.org>
    215
  • trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html

    r92371 r93389  
    1919        function testSetNoneOfURLAndRegex(next)
    2020        {
    21             var url = "debugger-set-breakpoint.js";
    22             var urlRegex = "debugger-set-breakpoint.*";
    23             DebuggerAgent.setBreakpointByUrl(undefined, undefined, 1, step2);
     21            DebuggerAgent.setBreakpointByUrl.invoke({lineNumber: 1}, step2);
    2422
    2523            function step2(result)
     
    4543        function testSetByRegex(next)
    4644        {
    47             var url = undefined;
    48             var urlRegex = "debugger-set-breakpoint.*";
    49             var columnNumber = undefined;
    50             var condition = undefined;
    51             DebuggerAgent.setBreakpointByUrl(url, urlRegex, 8, columnNumber, condition, step2);
     45            DebuggerAgent.setBreakpointByUrl.invoke({urlRegex: "debugger-set-breakpoint.*", lineNumber:8}, step2);
    5246
    5347            function step2(result)
  • trunk/Source/WebCore/ChangeLog

    r93388 r93389  
     12011-08-19  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: backend js api: an ability to skip optional arguments in the middle of the argument list is required.
     4        https://bugs.webkit.org/show_bug.cgi?id=66482
     5
     6        There are functions in the API with multiple optional arguments.
     7        When we call it we have to specify an optional argument as 'undefined' if we want to pass non default value for the next one.
     8        This can be solved with passing the arguments as an object.
     9
     10        Reviewed by Pavel Feldman.
     11
     12        * inspector/CodeGeneratorInspector.pm:
     13        * inspector/front-end/RemoteObject.js:
     14
    1152011-08-19  Zoltan Horvath  <zoltan@webkit.org>
    216
  • trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm

    r92104 r93389  
    787787            window[agentName] = {};
    788788        window[agentName][domainAndFunction[1]] = this.sendMessageToBackend.bind(this, requestString);
     789        window[agentName][domainAndFunction[1]]["invoke"] = this._invoke.bind(this, requestString)
     790    },
     791
     792    _invoke: function(requestString, args, callback)
     793    {
     794        var request = JSON.parse(requestString);
     795        request.params = args;
     796        this.sendMessageObjectToBackend(request, callback);
    789797    },
    790798
     
    832840            }
    833841        }
    834         request.id = this._wrap(callback || function() {});
    835 
     842
     843        this.sendMessageObjectToBackend(request, callback);
     844    },
     845
     846    sendMessageObjectToBackend: function(messageObject, callback)
     847    {
     848        messageObject.id = this._wrap(callback || function() {});
     849        var message = JSON.stringify(messageObject);
    836850        if (window.dumpInspectorProtocolMessages)
    837             console.log("frontend: " + JSON.stringify(request));
     851            console.log("frontend: " + message);
    838852
    839853        ++this._pendingResponsesCount;
    840         this.sendMessageObjectToBackend(request);
    841     },
    842 
    843     sendMessageObjectToBackend: function(messageObject)
    844     {
    845         var message = JSON.stringify(messageObject);
    846854        InspectorFrontendHost.sendMessageToBackend(message);
    847855    },
  • trunk/Source/WebCore/inspector/front-end/RemoteObject.js

    r92768 r93389  
    161161        }
    162162
    163         RuntimeAgent.evaluate(value, undefined, false, true, evaluatedCallback.bind(this));
     163        RuntimeAgent.evaluate.invoke({expression:value, doNotPauseOnExceptions:true}, evaluatedCallback.bind(this));
    164164
    165165        function evaluatedCallback(error, result, wasThrown)
Note: See TracChangeset for help on using the changeset viewer.