Web Inspector: Optional out arguments are not supported in the Web Inspector protocol...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 16:17:20 +0000 (16:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 16:17:20 +0000 (16:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77967

Patch by Peter Rybin <peter.rybin@gmail.com> on 2012-02-08
Reviewed by Yury Semikhatsky.

Condition for RefPtr-based types added. This is more-or-less a hack
and it's should be redone together with the switch to type-safe API.

* inspector/CodeGeneratorInspector.py:
(Generator.process_command):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/CodeGeneratorInspector.py

index 53c0ccf..45b8d4a 100644 (file)
@@ -1,3 +1,16 @@
+2012-02-08  Peter Rybin  <peter.rybin@gmail.com>
+
+        Web Inspector: Optional out arguments are not supported in the Web Inspector protocol, which breaks the implementation
+        https://bugs.webkit.org/show_bug.cgi?id=77967
+
+        Reviewed by Yury Semikhatsky.
+
+        Condition for RefPtr-based types added. This is more-or-less a hack
+        and it's should be redone together with the switch to type-safe API.
+
+        * inspector/CodeGeneratorInspector.py:
+        (Generator.process_command):
+
 2012-02-07  Yury Semikhatsky  <yurys@chromium.org>
 
         Web Inspector: inspected object wrapper should be released by InjectedScript when popover closes
index 9488c53..1bb5bdc 100755 (executable)
@@ -2682,8 +2682,9 @@ class Generator:
                 param = ", %sout_%s" % (raw_type.get_output_pass_model().get_argument_prefix(), json_return_name)
                 cook = "        result->set%s(\"%s\", out_%s);\n" % (setter_type, json_return_name, json_return_name)
                 if optional:
-                        # FIXME: support optional properly. Probably an additional output parameter should be in each case.
-                    if var_type.get_text() == "bool":
+                    # FIXME: support optional properly. Probably an additional output parameter should be in each case.
+                    # FIXME: refactor this condition; it's a hack now.
+                    if var_type.get_text() == "bool" or var_type.get_text().startswith("RefPtr<"):
                         cook = ("        if (out_%s)\n    " % json_return_name) + cook
                     else:
                         cook = "        // FIXME: support optional here.\n" + cook