Unreviewed, rolling out r104829.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2012 17:33:30 +0000 (17:33 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2012 17:33:30 +0000 (17:33 +0000)
http://trac.webkit.org/changeset/104829
https://bugs.webkit.org/show_bug.cgi?id=76188

it broke qt-minimal (Requested by loislo1 on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-12

* inspector/CodeGeneratorInspector.py:
(CodeGenerator):
(CodeGenerator.generate_type_builder):
(CodeGenerator.generate_type_builder.AdHocTypeContext):
(CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix):
(CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix.NameFix):
(CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix.NameFix.output_comment):
(CodeGenerator.generate_type_builder.AdHocTypeContext.call_generate_type_builder):
(CodeGenerator.register_use):
(RawTypesBinding):
(RawTypesBinding.get_code_generator):
(RawTypesBinding.get_in_c_type_text):
(RawTypesBinding.get_setter_value_expression_pattern):
(RawTypesBinding.reduce_to_raw_type):
(TypeData.__init__):
* inspector/InspectorValues.h:

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

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

index 92864f1139ced78841fcbab6dffcd134545e59cd..8167423be098c1bac6b990dbc74662647870472a 100644 (file)
@@ -1,3 +1,28 @@
+2012-01-12  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r104829.
+        http://trac.webkit.org/changeset/104829
+        https://bugs.webkit.org/show_bug.cgi?id=76188
+
+        it broke qt-minimal (Requested by loislo1 on #webkit).
+
+        * inspector/CodeGeneratorInspector.py:
+        (CodeGenerator):
+        (CodeGenerator.generate_type_builder):
+        (CodeGenerator.generate_type_builder.AdHocTypeContext):
+        (CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix):
+        (CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix.NameFix):
+        (CodeGenerator.generate_type_builder.AdHocTypeContext.get_type_name_fix.NameFix.output_comment):
+        (CodeGenerator.generate_type_builder.AdHocTypeContext.call_generate_type_builder):
+        (CodeGenerator.register_use):
+        (RawTypesBinding):
+        (RawTypesBinding.get_code_generator):
+        (RawTypesBinding.get_in_c_type_text):
+        (RawTypesBinding.get_setter_value_expression_pattern):
+        (RawTypesBinding.reduce_to_raw_type):
+        (TypeData.__init__):
+        * inspector/InspectorValues.h:
+
 2012-01-12  Pavel Podivilov  <podivilov@chromium.org>
 
         Web Inspector: [JSC] //@ sourceURL is not respected.
index bf3790324a075b39c2840357928d8960fd3fd897..1b2dcfc1f33486198528ca17e446277d8402ce40 100755 (executable)
@@ -898,115 +898,60 @@ class TypeBindings:
 
                 return PlainObjectBinding
         elif json_typable["type"] == "array":
+            if "items" in json_typable:
 
-            class ArrayBinding:
-                @staticmethod
-                def get_code_generator():
-
-                    class CodeGenerator:
-                        @staticmethod
-                        def generate_type_builder(writer, forward_listener):
-                            helper.write_doc(writer)
-                            class_name = fixed_type_name.class_name
-                            fixed_type_name.output_comment(writer)
-                            writer.newline("class ")
-                            writer.append(class_name)
-                            writer.append(" : public InspectorArray {\n")
-                            writer.newline("private:\n")
-                            writer.newline("    %s() { }\n" % fixed_type_name.class_name)
-                            writer.append("\n")
-                            writer.newline("public:\n")
-                            ad_hoc_type_writer = writer.insert_writer("    ")
-
-                            if "items" in json_typable:
-
-                                class AdHocTypeContext:
-                                    @staticmethod
-                                    def get_type_name_fix():
-                                        class NameFix:
-                                            class_name = "Item"
-
-                                            @staticmethod
-                                            def output_comment(writer):
-                                                pass
+                class CodeGenerator:
+                    @staticmethod
+                    def generate_type_builder(writer, forward_listener):
 
-                                        return NameFix
+                        class AdHocTypeContext:
+                            @staticmethod
+                            def get_type_name_fix():
+                                class NameFix:
+                                    class_name = fixed_type_name.class_name + "Item"
 
                                     @staticmethod
-                                    def call_generate_type_builder(code_generator):
-                                        code_generator.generate_type_builder(ad_hoc_type_writer, forward_listener)
-
-                                item_type_binding = resolve_param_type(json_typable["items"], context_domain_name, AdHocTypeContext)
-                            else:
-                                item_type_binding = RawTypeBinding(RawTypes.Any)
+                                    def output_comment(writer):
+                                        fixed_type_name.output_comment(writer)
+                                        writer.newline("// Named as an item of array.\n")
 
-                            for item_type_opt in MethodGenerateModes.get_modes(item_type_binding):
-                                writer.newline("    void addItem")
-                                writer.append("(%s value)\n" % item_type_opt.get_c_param_type_text(item_type_binding))
-                                writer.newline("    {\n")
-                                writer.newline("        this->push%s(%s);\n"
-                                    % (item_type_binding.reduce_to_raw_type().get_setter_name(),
-                                       item_type_opt.get_setter_value_expression(item_type_binding, "value")))
-                                writer.newline("    }\n")
-
-                            writer.append("\n")
-                            writer.newline("    static PassRefPtr<%s> create() {\n" % fixed_type_name.class_name)
-                            writer.newline("        return adoptRef(new %s());\n" % fixed_type_name.class_name)
-                            writer.newline("    }\n")
-
-                            code_generator = item_type_binding.get_code_generator()
-                            if code_generator:
-                                code_generator.register_use(forward_listener)
-
-                            writer.newline("};\n\n")
-
-                        @staticmethod
-                        def generate_forward_declaration(writer):
-                            class_name = fixed_type_name.class_name
-                            writer.newline("class ")
-                            writer.append(class_name)
-                            writer.append(";\n")
-
-                        @staticmethod
-                        def register_use(forward_listener):
-                            helper.add_to_forward_listener(forward_listener)
+                                return NameFix
 
-                    return CodeGenerator
+                            @staticmethod
+                            def call_generate_type_builder(code_generator):
+                                code_generator.generate_type_builder(writer, forward_listener)
 
-                @classmethod
-                def get_in_c_type_text(cls, optional):
-                    return "PassRefPtr<%s%s>" % (helper.full_name_prefix, fixed_type_name.class_name)
+                        resolve_param_type(json_typable["items"], context_domain_name, AdHocTypeContext)
 
-                @staticmethod
-                def get_setter_value_expression_pattern():
-                    return None
+                    @staticmethod
+                    def register_use(forward_listener):
+                        pass
 
-                @staticmethod
-                def reduce_to_raw_type():
-                    return RawTypes.Array
+                default_binding_code_generator = CodeGenerator
 
-            return ArrayBinding
+        else:
+            default_binding_code_generator = None
 
         raw_type = RawTypes.get(json_typable["type"])
 
-        return RawTypeBinding(raw_type)
-
-
-class RawTypeBinding:
-    def __init__(self, raw_type):
-        self.raw_type_ = raw_type
+        class RawTypesBinding:
+            @staticmethod
+            def get_code_generator():
+                return default_binding_code_generator
 
-    def get_code_generator(self):
-        return None
+            @classmethod
+            def get_in_c_type_text(cls, optional):
+                return cls.reduce_to_raw_type().get_c_param_type(ParamType.EVENT, optional).get_text()
 
-    def get_in_c_type_text(self, optional):
-        return self.raw_type_.get_c_param_type(ParamType.EVENT, optional).get_text()
+            @staticmethod
+            def get_setter_value_expression_pattern():
+                return None
 
-    def get_setter_value_expression_pattern(self):
-        return None
+            @staticmethod
+            def reduce_to_raw_type():
+                return raw_type
 
-    def reduce_to_raw_type(self):
-        return self.raw_type_
+        return RawTypesBinding
 
 
 class TypeData(object):
@@ -1021,23 +966,12 @@ class TypeData(object):
         json_type_name = json_type["type"]
         raw_type = RawTypes.get(json_type_name)
         self.raw_type_ = raw_type
-        self.binding_being_resolved_ = False
-        self.binding_ = None
+        self.binding_ = TypeBindings.create_named_type_declaration(json_type, json_domain["domain"], self)
 
     def get_raw_type(self):
         return self.raw_type_
 
     def get_binding(self):
-        if not self.binding_:
-            if self.binding_being_resolved_:
-                raise Error("Type %s is already being resolved" % self.json_type_["type"])
-            # Resolve only lazily, because resolving one named type may require resolving some other named type.
-            self.binding_being_resolved_ = True
-            try:
-                self.binding_ = TypeBindings.create_named_type_declaration(self.json_type_, self.json_domain_["domain"], self)
-            finally:
-                self.binding_being_resolved_ = False
-
         return self.binding_
 
     def get_json_type(self):
index e100adead21d00e621e32e609e1956bae99ccbe7..7e953a48fd8564329c8718d055e18cc00876d698 100644 (file)
@@ -244,10 +244,8 @@ public:
     const_iterator begin() const { return m_data.begin(); }
     const_iterator end() const { return m_data.end(); }
 
-protected:
-    InspectorArray();
-
 private:
+    InspectorArray();
     Vector<RefPtr<InspectorValue> > m_data;
 };