Title: [93389] trunk
Revision
93389
Author
[email protected]
Date
2011-08-19 01:42:03 -0700 (Fri, 19 Aug 2011)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93388 => 93389)


--- trunk/LayoutTests/ChangeLog	2011-08-19 07:54:35 UTC (rev 93388)
+++ trunk/LayoutTests/ChangeLog	2011-08-19 08:42:03 UTC (rev 93389)
@@ -1,3 +1,16 @@
+2011-08-19  Ilya Tikhonovsky  <[email protected]>
+
+        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.
+
+        * inspector/debugger/debugger-set-breakpoint-regex.html:
+
 2011-08-18  Shawn Singh  <[email protected]>
 
         Computing screen-space transform for LayerChromium and CCLayerImpl

Modified: trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html (93388 => 93389)


--- trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html	2011-08-19 07:54:35 UTC (rev 93388)
+++ trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html	2011-08-19 08:42:03 UTC (rev 93389)
@@ -18,9 +18,7 @@
     InspectorTest.runDebuggerTestSuite([
         function testSetNoneOfURLAndRegex(next)
         {
-            var url = ""
-            var urlRegex = "debugger-set-breakpoint.*";
-            DebuggerAgent.setBreakpointByUrl(undefined, undefined, 1, step2);
+            DebuggerAgent.setBreakpointByUrl.invoke({lineNumber: 1}, step2);
 
             function step2(result)
             {
@@ -44,11 +42,7 @@
 
         function testSetByRegex(next)
         {
-            var url = ""
-            var urlRegex = "debugger-set-breakpoint.*";
-            var columnNumber = undefined;
-            var condition = undefined;
-            DebuggerAgent.setBreakpointByUrl(url, urlRegex, 8, columnNumber, condition, step2);
+            DebuggerAgent.setBreakpointByUrl.invoke({urlRegex: "debugger-set-breakpoint.*", lineNumber:8}, step2);
 
             function step2(result)
             {

Modified: trunk/Source/WebCore/ChangeLog (93388 => 93389)


--- trunk/Source/WebCore/ChangeLog	2011-08-19 07:54:35 UTC (rev 93388)
+++ trunk/Source/WebCore/ChangeLog	2011-08-19 08:42:03 UTC (rev 93389)
@@ -1,3 +1,17 @@
+2011-08-19  Ilya Tikhonovsky  <[email protected]>
+
+        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.
+
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/front-end/RemoteObject.js:
+
 2011-08-19  Zoltan Horvath  <[email protected]>
 
         [Qt] Build fix after r93384.

Modified: trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm (93388 => 93389)


--- trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm	2011-08-19 07:54:35 UTC (rev 93388)
+++ trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm	2011-08-19 08:42:03 UTC (rev 93389)
@@ -786,8 +786,16 @@
         if (!window[agentName])
             window[agentName] = {};
         window[agentName][domainAndFunction[1]] = this.sendMessageToBackend.bind(this, requestString);
+        window[agentName][domainAndFunction[1]]["invoke"] = this._invoke.bind(this, requestString)
     },
 
+    _invoke: function(requestString, args, callback)
+    {
+        var request = JSON.parse(requestString);
+        request.params = args;
+        this.sendMessageObjectToBackend(request, callback);
+    },
+
     sendMessageToBackend: function()
     {
         var args = Array.prototype.slice.call(arguments);
@@ -831,18 +839,18 @@
                 return;
             }
         }
-        request.id = this._wrap(callback || function() {});
 
-        if (window.dumpInspectorProtocolMessages)
-            console.log("frontend: " + JSON.stringify(request));
-
-        ++this._pendingResponsesCount;
-        this.sendMessageObjectToBackend(request);
+        this.sendMessageObjectToBackend(request, callback);
     },
 
-    sendMessageObjectToBackend: function(messageObject)
+    sendMessageObjectToBackend: function(messageObject, callback)
     {
+        messageObject.id = this._wrap(callback || function() {});
         var message = JSON.stringify(messageObject);
+        if (window.dumpInspectorProtocolMessages)
+            console.log("frontend: " + message);
+
+        ++this._pendingResponsesCount;
         InspectorFrontendHost.sendMessageToBackend(message);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/RemoteObject.js (93388 => 93389)


--- trunk/Source/WebCore/inspector/front-end/RemoteObject.js	2011-08-19 07:54:35 UTC (rev 93388)
+++ trunk/Source/WebCore/inspector/front-end/RemoteObject.js	2011-08-19 08:42:03 UTC (rev 93389)
@@ -160,7 +160,7 @@
             return;
         }
 
-        RuntimeAgent.evaluate(value, undefined, false, true, evaluatedCallback.bind(this));
+        RuntimeAgent.evaluate.invoke({_expression_:value, doNotPauseOnExceptions:true}, evaluatedCallback.bind(this));
 
         function evaluatedCallback(error, result, wasThrown)
         {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to