Changeset 178714 in webkit


Ignore:
Timestamp:
Jan 20, 2015 8:52:18 AM (9 years ago)
Author:
Brian Burg
Message:

Web Replay: code generator should take supplemental specifications and allow cross-framework references
https://bugs.webkit.org/show_bug.cgi?id=136312

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Some types are shared between replay inputs from different frameworks.
Previously, these type declarations were duplicated in every input
specification file in which they were used. This caused some type encoding
traits to be emitted twice if used from WebCore inputs and WebKit2 inputs.

This patch teaches the replay inputs code generator to accept multiple
input specification files. Inputs can freely reference types from other
frameworks without duplicating declarations.

On the code generation side, the model could contain types and inputs from
frameworks that are not the target framework. Only generate code for the
target framework.

To properly generate cross-framework type encoding traits, use
Type.encoding_type_argument in more places, and add the export macro for WebCore
and the Test framework.

Adjust some tests so that enum coverage is preserved by moving the enum types
into "Test" (the target framework for tests).

For Windows, copy over JSInputs.json as if it were a private header.

  • JavaScriptCore.xcodeproj/project.pbxproj: Make JSInputs.json a private header.
  • replay/JSInputs.json:

Put all primitive types and WTF types in this specification file.

  • replay/scripts/CodeGeneratorReplayInputs.py:

(Input.init):
(InputsModel.init): Keep track of the input's framework.
(InputsModel.parse_specification): Parse the framework here. Adjust to new format,
and allow either types or inputs to be missing from a single file.

(InputsModel.parse_type_with_framework):
(InputsModel.parse_input_with_framework):
(Generator.should_generate_item): Added helper method.
(Generator.generate_header): Filter inputs to generate.
(Generator.generate_implementation): Filter inputs to generate.
(Generator.generate_enum_trait_declaration): Filter enums to generate.
Add WEBCORE_EXPORT macro to enum encoding traits.

(Generator.generate_for_each_macro): Filter inputs to generate.
(Generator.generate_enum_trait_implementation): Filter enums to generate.
(generate_from_specifications): Added.
(generate_from_specifications.parse_json_from_file):
(InputsModel.parse_toplevel): Deleted.
(InputsModel.parse_type_with_framework_name): Deleted.
(InputsModel.parse_input): Deleted.
(generate_from_specification): Deleted.

  • replay/scripts/CodeGeneratorReplayInputsTemplates.py:
  • replay/scripts/tests/expected/fail-on-no-inputs.json-error: Removed.
  • replay/scripts/tests/expected/fail-on-no-types.json-error: Removed.
  • replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.cpp:
  • replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.cpp:
  • replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.cpp:
  • replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp:
  • replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-input-with-guard.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-inputs-with-flags.json-TestReplayInputs.h:
  • replay/scripts/tests/expected/generate-memoized-type-modes.json-TestReplayInputs.h:
  • replay/scripts/tests/fail-on-c-style-enum-no-storage.json:
  • replay/scripts/tests/fail-on-duplicate-enum-type.json:
  • replay/scripts/tests/fail-on-duplicate-input-names.json:
  • replay/scripts/tests/fail-on-duplicate-type-names.json:
  • replay/scripts/tests/fail-on-enum-type-missing-values.json:
  • replay/scripts/tests/fail-on-missing-input-member-name.json:
  • replay/scripts/tests/fail-on-missing-input-name.json:
  • replay/scripts/tests/fail-on-missing-input-queue.json:
  • replay/scripts/tests/fail-on-missing-type-mode.json:
  • replay/scripts/tests/fail-on-missing-type-name.json:
  • replay/scripts/tests/fail-on-no-inputs.json:

Removed, no longer required to be in a single file.

  • replay/scripts/tests/fail-on-no-types.json:

Removed, no longer required to be in a single file.

  • replay/scripts/tests/fail-on-unknown-input-queue.json:
  • replay/scripts/tests/fail-on-unknown-member-type.json:
  • replay/scripts/tests/fail-on-unknown-type-mode.json:
  • replay/scripts/tests/generate-enum-encoding-helpers-with-guarded-values.json:
  • replay/scripts/tests/generate-enum-encoding-helpers.json:
  • replay/scripts/tests/generate-enum-with-guard.json:

Include enums that are and are not generated.

  • replay/scripts/tests/generate-enums-with-same-base-name.json:
  • replay/scripts/tests/generate-event-loop-shape-types.json:
  • replay/scripts/tests/generate-input-with-guard.json:
  • replay/scripts/tests/generate-input-with-vector-members.json:
  • replay/scripts/tests/generate-inputs-with-flags.json:
  • replay/scripts/tests/generate-memoized-type-modes.json:

Source/WebCore:

Changes covered by existing input generator tests.

  • DerivedSources.make: Add JSInputs.json as supplemental specification.
  • replay/WebInputs.json: Moved common types to JSInputs.json.
Location:
trunk/Source
Files:
4 deleted
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r178708 r178714  
     12015-01-19  Brian J. Burg  <burg@cs.washington.edu>
     2
     3        Web Replay: code generator should take supplemental specifications and allow cross-framework references
     4        https://bugs.webkit.org/show_bug.cgi?id=136312
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Some types are shared between replay inputs from different frameworks.
     9        Previously, these type declarations were duplicated in every input
     10        specification file in which they were used. This caused some type encoding
     11        traits to be emitted twice if used from WebCore inputs and WebKit2 inputs.
     12
     13        This patch teaches the replay inputs code generator to accept multiple
     14        input specification files. Inputs can freely reference types from other
     15        frameworks without duplicating declarations.
     16
     17        On the code generation side, the model could contain types and inputs from
     18        frameworks that are not the target framework. Only generate code for the
     19        target framework.
     20
     21        To properly generate cross-framework type encoding traits, use
     22        Type.encoding_type_argument in more places, and add the export macro for WebCore
     23        and the Test framework.
     24
     25        Adjust some tests so that enum coverage is preserved by moving the enum types
     26        into "Test" (the target framework for tests).
     27
     28        * JavaScriptCore.vcxproj/copy-files.cmd:
     29        For Windows, copy over JSInputs.json as if it were a private header.
     30
     31        * JavaScriptCore.xcodeproj/project.pbxproj: Make JSInputs.json a private header.
     32        * replay/JSInputs.json:
     33        Put all primitive types and WTF types in this specification file.
     34
     35        * replay/scripts/CodeGeneratorReplayInputs.py:
     36        (Input.__init__):
     37        (InputsModel.__init__): Keep track of the input's framework.
     38        (InputsModel.parse_specification): Parse the framework here. Adjust to new format,
     39        and allow either types or inputs to be missing from a single file.
     40
     41        (InputsModel.parse_type_with_framework):
     42        (InputsModel.parse_input_with_framework):
     43        (Generator.should_generate_item): Added helper method.
     44        (Generator.generate_header): Filter inputs to generate.
     45        (Generator.generate_implementation): Filter inputs to generate.
     46        (Generator.generate_enum_trait_declaration): Filter enums to generate.
     47        Add WEBCORE_EXPORT macro to enum encoding traits.
     48
     49        (Generator.generate_for_each_macro): Filter inputs to generate.
     50        (Generator.generate_enum_trait_implementation): Filter enums to generate.
     51        (generate_from_specifications): Added.
     52        (generate_from_specifications.parse_json_from_file):
     53        (InputsModel.parse_toplevel): Deleted.
     54        (InputsModel.parse_type_with_framework_name): Deleted.
     55        (InputsModel.parse_input): Deleted.
     56        (generate_from_specification): Deleted.
     57        * replay/scripts/CodeGeneratorReplayInputsTemplates.py:
     58        * replay/scripts/tests/expected/fail-on-no-inputs.json-error: Removed.
     59        * replay/scripts/tests/expected/fail-on-no-types.json-error: Removed.
     60        * replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.cpp:
     61        * replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.h:
     62        * replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.cpp:
     63        * replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.h:
     64        * replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.cpp:
     65        * replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h:
     66        * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp:
     67        * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h:
     68        * replay/scripts/tests/expected/generate-input-with-guard.json-TestReplayInputs.h:
     69        * replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h:
     70        * replay/scripts/tests/expected/generate-inputs-with-flags.json-TestReplayInputs.h:
     71        * replay/scripts/tests/expected/generate-memoized-type-modes.json-TestReplayInputs.h:
     72        * replay/scripts/tests/fail-on-c-style-enum-no-storage.json:
     73        * replay/scripts/tests/fail-on-duplicate-enum-type.json:
     74        * replay/scripts/tests/fail-on-duplicate-input-names.json:
     75        * replay/scripts/tests/fail-on-duplicate-type-names.json:
     76        * replay/scripts/tests/fail-on-enum-type-missing-values.json:
     77        * replay/scripts/tests/fail-on-missing-input-member-name.json:
     78        * replay/scripts/tests/fail-on-missing-input-name.json:
     79        * replay/scripts/tests/fail-on-missing-input-queue.json:
     80        * replay/scripts/tests/fail-on-missing-type-mode.json:
     81        * replay/scripts/tests/fail-on-missing-type-name.json:
     82        * replay/scripts/tests/fail-on-no-inputs.json:
     83        Removed, no longer required to be in a single file.
     84
     85        * replay/scripts/tests/fail-on-no-types.json:
     86        Removed, no longer required to be in a single file.
     87
     88        * replay/scripts/tests/fail-on-unknown-input-queue.json:
     89        * replay/scripts/tests/fail-on-unknown-member-type.json:
     90        * replay/scripts/tests/fail-on-unknown-type-mode.json:
     91        * replay/scripts/tests/generate-enum-encoding-helpers-with-guarded-values.json:
     92        * replay/scripts/tests/generate-enum-encoding-helpers.json:
     93        * replay/scripts/tests/generate-enum-with-guard.json:
     94        Include enums that are and are not generated.
     95
     96        * replay/scripts/tests/generate-enums-with-same-base-name.json:
     97        * replay/scripts/tests/generate-event-loop-shape-types.json:
     98        * replay/scripts/tests/generate-input-with-guard.json:
     99        * replay/scripts/tests/generate-input-with-vector-members.json:
     100        * replay/scripts/tests/generate-inputs-with-flags.json:
     101        * replay/scripts/tests/generate-memoized-type-modes.json:
     102
    11032015-01-20  Tomas Popela  <tpopela@redhat.com>
    2104
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd

    r174893 r178714  
    8787xcopy /y "%DerivedSourcesDirectory%\JSReplayInputs.h" "%PrivateHeadersDirectory%" >NUL
    8888
     89echo Copying Web Replay specification files as if they were private headers...
     90xcopy /y /d ..\replay\*.json "%PrivateHeadersDirectory%" >NUL
     91
    8992echo Copying builtins header as if it were a private header...
    9093xcopy /y "%DerivedSourcesDirectory%\JSCBuiltins.h" "%PrivateHeadersDirectory%" >NUL
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r178696 r178714  
    15761576                C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; };
    15771577                C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FE18A316BAEC4000AF3061 /* StructureRareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1578                C442CB251A6CDB8C005D3D7C /* JSInputs.json in Headers */ = {isa = PBXBuildFile; fileRef = 9928FF3D18AC4B1C00B8CF12 /* JSInputs.json */; settings = {ATTRIBUTES = (Private, ); }; };
    15781579                C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CBF192844960013FBEA /* generate-inspector-protocol-bindings.py */; settings = {ATTRIBUTES = (Private, ); }; };
    15791580                C4703CCE192844CC0013FBEA /* generate_js_backend_commands.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC3192844CC0013FBEA /* generate_js_backend_commands.py */; settings = {ATTRIBUTES = (Private, ); }; };
     
    53875388                                A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
    53885389                                86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
     5390                                C442CB251A6CDB8C005D3D7C /* JSInputs.json in Headers */,
    53895391                                52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */,
    53905392                                52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
  • trunk/Source/JavaScriptCore/replay/JSInputs.json

    r164007 r178714  
    22    "types": {
    33        "Global": [
     4            { "name": "bool", "mode": "SCALAR" },
    45            { "name": "double", "mode": "SCALAR" },
    5             { "name": "uint64_t", "mode": "SCALAR" }
     6            { "name": "uint32_t", "mode": "SCALAR", "description": "Unsigned 32-bit integer." },
     7            { "name": "uint64_t", "mode": "SCALAR", "description": "Unsigned 64-bit integer." },
     8            { "name": "int32_t", "mode": "SCALAR", "description": "Signed 32-bit integer." },
     9            { "name": "int64_t", "mode": "SCALAR", "description": "Signed 64-bit integer." }
     10        ],
     11
     12        "WTF": [
     13            {
     14                "name": "String", "mode": "HEAVY_SCALAR",
     15                "header": "wtf/text/WTFString.h"
     16            }
     17        ],
     18
     19        "JavaScriptCore": [
     20            {
     21                "name": "InputQueue", "mode": "SCALAR", "storage": "uint8_t",
     22                "flags": ["ENUM_CLASS"],
     23                "values": ["EventLoopInput", "LoaderMemoizedData", "ScriptMemoizedData", "Count"],
     24                "header": "replay/NondeterministicInput.h"
     25            }
    626        ]
    727    },
    828
    9     "inputs": [
    10         {
    11             "name": "GetCurrentTime",
    12             "description": "Supplies the system time to Date.now() and new Date().",
    13             "queue": "SCRIPT_MEMOIZED",
    14             "members": [
    15                 { "name": "currentTime", "type": "double" }
    16             ]
    17         },
    18         {
    19             "name": "SetRandomSeed",
    20             "description": "Sets the PRNG seed used by Math.random().",
    21             "queue": "SCRIPT_MEMOIZED",
    22             "members": [
    23                 { "name": "randomSeed", "type": "uint64_t" }
    24             ]
    25         }
    26     ]
     29    "inputs": {
     30        "JavaScriptCore": [
     31            {
     32                "name": "GetCurrentTime",
     33                "description": "Supplies the system time to Date.now() and new Date().",
     34                "queue": "SCRIPT_MEMOIZED",
     35                "members": [
     36                    { "name": "currentTime", "type": "double" }
     37                ]
     38            },
     39            {
     40                "name": "SetRandomSeed",
     41                "description": "Sets the PRNG seed used by Math.random().",
     42                "queue": "SCRIPT_MEMOIZED",
     43                "members": [
     44                    { "name": "randomSeed", "type": "uint64_t" }
     45                ]
     46            }
     47        ]
     48    }
    2749}
  • trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py

    r178668 r178714  
    113113        "prefix": "Web",
    114114        "namespace": "WebCore",
     115        "exportMacro": "WEBCORE_EXPORT"
    115116    },
    116117    # Used for bindings tests.
     
    118119        "prefix": "Test",
    119120        "namespace": "Test",
     121        "exportMacro": "TEST_EXPORT_MACRO"
    120122    }
    121123}
     
    216218
    217219class Input:
    218     def __init__(self, name, description, queueString, flags, guard=None):
     220    def __init__(self, name, description, framework, queueString, flags, guard=None):
    219221        self.name = name
    220222        self.description = description
     223        self.framework = framework
    221224        self.queue = InputQueue.fromString(queueString)
    222225        self._flags = flags
     
    398401
    399402class InputsModel:
    400     def __init__(self, parsed_json):
     403    def __init__(self):
    401404        self.inputs = []
    402405        self.types = []
     
    406409        self.types_by_name = {}
    407410        self.inputs_by_name = {}
    408 
    409         self.parse_toplevel(parsed_json)
    410411
    411412    def enum_types(self):
     
    419420            return self.types_by_name.get(member.typeName)
    420421
    421     def parse_toplevel(self, json):
    422         check_for_required_properties(['types', 'inputs'], json, 'toplevel')
    423         if not isinstance(json['types'], dict):
    424             raise ParseException("Malformed specification: types is not a dict of framework->type list")
    425 
    426         if not isinstance(json['inputs'], list):
    427             raise ParseException("Malformed specification: inputs is not an array")
    428 
    429         for type_framework_name, type_list in json['types'].iteritems():
    430             if not isinstance(type_list, list):
    431                 raise ParseException("Malformed specification: type list for framework %s is not a list" % type_framework_name)
    432 
    433             for _type in type_list:
    434                 self.parse_type_with_framework_name(_type, type_framework_name)
    435 
    436         for val in json['inputs']:
    437             self.parse_input(val)
    438 
    439     def parse_type_with_framework_name(self, json, framework_name):
     422    def parse_specification(self, json):
     423        if 'types' in json:
     424            if not isinstance(json['types'], dict):
     425                raise ParseException("Malformed specification: types is not a dict of framework->type list")
     426
     427            for framework_name, type_list in json['types'].iteritems():
     428                if not isinstance(type_list, list):
     429                    raise ParseException("Malformed specification: type list for framework %s is not a list" % framework_name)
     430
     431                framework = Framework.fromString(framework_name)
     432                for _type in type_list:
     433                    self.parse_type_with_framework(_type, framework)
     434
     435        if 'inputs' in json:
     436            if not isinstance(json['inputs'], dict):
     437                raise ParseException("Malformed specification: inputs is not a dict of framework->input list")
     438
     439            for framework_name, input_list in json['inputs'].iteritems():
     440                if not isinstance(input_list, list):
     441                    raise ParseException("Malformed specification: input list for framework %s is not a list" % framework_name)
     442
     443                framework = Framework.fromString(framework_name)
     444                for _input in input_list:
     445                    self.parse_input_with_framework(_input, framework)
     446
     447    def parse_type_with_framework(self, json, framework):
    440448        check_for_required_properties(['name', 'mode'], json, 'type')
    441         framework = Framework.fromString(framework_name)
    442449        if framework is not Frameworks.Global:
    443450            check_for_required_properties(['header'], json, 'non-global type')
     
    463470        self.types.append(_type)
    464471
    465     def parse_input(self, json):
     472    def parse_input_with_framework(self, json, framework):
    466473        check_for_required_properties(['name', 'description', 'queue', 'members'], json, 'input')
    467         _input = Input(json['name'], json['description'], json['queue'], json.get('flags', []), json.get('guard'))
     474        _input = Input(json['name'], json['description'], framework, json['queue'], json.get('flags', []), json.get('guard'))
    468475        if isinstance(json['members'], list):
    469476            for member in json['members']:
     
    564571        return self.target_framework.setting(key, GLOBAL_CONFIG.get(key, default))
    565572
     573    def should_generate_item(self, item):
     574        return item.framework is self.target_framework
     575
    566576    # This does not account for any filename mangling performed on behalf of the test harness.
    567577    def output_filename(self, extension=None):
     
    588598
    589599    def generate_header(self):
     600        enums_to_generate = filter(self.should_generate_item, self._model.enum_types())
     601        inputs_to_generate = filter(self.should_generate_item, self._model.inputs)
     602
    590603        template_arguments = {
    591604            'licenseBlock': self.generate_license(),
     
    597610            'includes': self.generate_includes(defaults=self.setting('headerIncludes')),
    598611            'typeForwardDeclarations': self.generate_type_forward_declarations(),
    599             'inputForwardDeclarations': "\n".join([wrap_with_guard("class %s;", _input.guard) % _input.name for _input in self._model.inputs]),
    600             'inputClassDeclarations': "\n\n".join([self.generate_class_declaration(_input) for _input in self._model.inputs]),
    601             'inputTraitDeclarations': "\n\n".join([self.generate_input_trait_declaration(_input) for _input in self._model.inputs]),
    602             'inputTypeTraitDeclarations': "\n\n".join([self.generate_input_type_trait_declaration(_input) for _input in self._model.inputs]),
    603             'enumTraitDeclarations': "\n\n".join([wrap_with_guard(self.generate_enum_trait_declaration(_type), _type.guard) for _type in self._model.enum_types()]),
     612            'inputForwardDeclarations': "\n".join([wrap_with_guard("class %s;", _input.guard) % _input.name for _input in inputs_to_generate]),
     613            'inputClassDeclarations': "\n\n".join([self.generate_class_declaration(_input) for _input in inputs_to_generate]),
     614            'inputTraitDeclarations': "\n\n".join([self.generate_input_trait_declaration(_input) for _input in inputs_to_generate]),
     615            'inputTypeTraitDeclarations': "\n\n".join([self.generate_input_type_trait_declaration(_input) for _input in inputs_to_generate]),
     616            'enumTraitDeclarations': "\n\n".join([wrap_with_guard(self.generate_enum_trait_declaration(_type), _type.guard) for _type in enums_to_generate]),
    604617            'forEachMacro': self.generate_for_each_macro(),
    605618        }
     
    608621
    609622    def generate_implementation(self):
     623        enums_to_generate = filter(self.should_generate_item, self._model.enum_types())
     624        inputs_to_generate = filter(self.should_generate_item, self._model.inputs)
     625
    610626        template_arguments = {
    611627            'licenseBlock': self.generate_license(),
     
    615631            'inputsNamespace': self.target_framework.setting('namespace'),
    616632            'includes': self.generate_includes(defaults=self.setting('implIncludes'), includes_for_types=True),
    617             'inputClassImplementations': "\n\n".join([self.generate_class_implementation(_input) for _input in self._model.inputs]),
    618             'inputTraitImplementations': "\n\n".join([self.generate_input_trait_implementation(_input) for _input in self._model.inputs]),
    619             'enumTraitImplementations': "\n\n".join([wrap_with_guard(self.generate_enum_trait_implementation(_type), _type.guard) for _type in self._model.enum_types()]),
     633            'inputClassImplementations': "\n\n".join([self.generate_class_implementation(_input) for _input in inputs_to_generate]),
     634            'inputTraitImplementations': "\n\n".join([self.generate_input_trait_implementation(_input) for _input in inputs_to_generate]),
     635            'enumTraitImplementations': "\n\n".join([wrap_with_guard(self.generate_enum_trait_implementation(_type), _type.guard) for _type in enums_to_generate]),
    620636        }
    621637
     
    779795
    780796    def generate_enum_trait_declaration(self, _type):
     797        decl_type = ['struct']
     798        if len(self.setting('exportMacro')) > 0:
     799            decl_type.append(self.setting('exportMacro'))
     800
    781801        should_qualify_type = _type.framework != self.traits_framework
    782802        template = Templates.EnumTraitDeclaration if _type.is_enum() else Templates.EnumClassTraitDeclaration
    783803        template_arguments = {
    784             'enumName': _type.type_name(qualified=should_qualify_type),
     804            'encodingTypeArgument': _type.encoding_type_argument(qualified=should_qualify_type),
     805            'enumType': _type.type_name(qualified=should_qualify_type),
     806            'structOrClass': " ".join(decl_type)
    785807        }
    786808        return Template(template).substitute(template_arguments)
    787809
    788810    def generate_for_each_macro(self):
     811        inputs_to_generate = filter(self.should_generate_item, self._model.inputs)
     812
    789813        macro_name = "%s_REPLAY_INPUT_NAMES_FOR_EACH" % self.setting('prefix').upper()
    790814        lines = []
    791815        lines.append("#define %s(macro) \\" % macro_name)
    792         lines.extend(["    macro(%s) \\" % _input.name for _input in self._model.inputs])
     816        lines.extend(["    macro(%s) \\" % _input.name for _input in inputs_to_generate])
    793817        lines.append("    \\")
    794818        lines.append("// end of %s" % macro_name)
     
    870894
    871895        template_arguments = {
    872             'enumName': _type.type_name(qualified=should_qualify_type),
     896            'encodingTypeArgument': _type.encoding_type_argument(qualified=should_qualify_type),
     897            'enumType': _type.type_name(qualified=should_qualify_type),
    873898            'encodeCases': "\n".join(encodeLines),
    874899            'decodeCases': "\n".join(decodeLines)
     
    960985
    961986
    962 def generate_from_specification(input_filepath=None, output_prefix="", output_dirpath=None, framework_name=None, force_output=False):
    963     try:
    964         with open(input_filepath, "r") as input_file:
    965             parsed_json = json.load(input_file)
    966     except ValueError as e:
    967         raise Exception("Error parsing valid JSON in file: " + input_filepath)
     987def generate_from_specifications(input_filepaths=[], output_prefix="", output_dirpath=None, framework_name=None, force_output=False):
    968988
    969989    if not framework_name in FRAMEWORK_CONFIG_MAP:
    970990        raise ParseException("Unknown or unsupported framework name supplied: " + framework_name)
    971991
    972     model = InputsModel(parsed_json)
     992    if len(input_filepaths) == 0:
     993        raise ParseException("Must provide at least one specification file, none were provided.")
     994
     995    def parse_json_from_file(input_filepath):
     996        try:
     997            with open(input_filepath, "r") as input_file:
     998                return json.load(input_file)
     999        except ValueError as e:
     1000            raise Exception("Error parsing valid JSON in file: " + input_filepath)
     1001
     1002    specifications = map(parse_json_from_file, input_filepaths)
     1003
     1004    model = InputsModel()
     1005    for spec in specifications:
     1006        model.parse_specification(spec)
     1007
    9731008    model.resolve_types()
    974     generator = Generator(model, framework_name, input_filepath, output_prefix)
     1009    generator = Generator(model, framework_name, input_filepaths[0], output_prefix)
    9751010
    9761011    generator.write_output_files(output_dirpath, force_output)
     
    9801015    allowed_framework_names = FRAMEWORK_CONFIG_MAP.keys()
    9811016
    982     cli_parser = optparse.OptionParser(usage="usage: %prog [options] <Inputs.json>")
     1017    cli_parser = optparse.OptionParser(usage="usage: %prog [options] <Inputs.json> [, <MoreInputs.json> ]")
    9831018    cli_parser.add_option("-o", "--outputDir", help="Directory where generated files should be written.")
    9841019    cli_parser.add_option("--framework", type="choice", choices=allowed_framework_names, help="The framework these inputs belong to.")  # JavaScriptCore, WebCore
     
    9901025
    9911026    arg_options, arg_values = cli_parser.parse_args()
    992     if (len(arg_values) < 1):
    993         raise ParseException("At least one plain argument expected")
    9941027
    9951028    if not arg_options.outputDir:
     
    10001033
    10011034    options = {
    1002         'input_filepath': arg_values[0],
     1035        'input_filepaths': arg_values,
    10031036        'output_dirpath': arg_options.outputDir,
    10041037        'output_prefix': os.path.basename(arg_values[0]) if arg_options.test else "",
     
    10081041
    10091042    try:
    1010         generate_from_specification(**options)
     1043        generate_from_specifications(**options)
    10111044    except (ParseException, TypecheckException) as e:
    10121045        if arg_options.test:
  • trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputsTemplates.py

    r178668 r178714  
    113113
    114114    EnumTraitDeclaration = (
    115     """template<> struct EncodingTraits<${enumName}> {
    116     typedef ${enumName} DecodedType;
    117 
    118     static EncodedValue encodeValue(const ${enumName}& value);
    119     static bool decodeValue(EncodedValue&, ${enumName}& value);
     115    """template<> ${structOrClass} EncodingTraits<${encodingTypeArgument}> {
     116    typedef ${enumType} DecodedType;
     117
     118    static EncodedValue encodeValue(const ${enumType}& value);
     119    static bool decodeValue(EncodedValue&, ${enumType}& value);
    120120};""")
    121121
    122122    EnumClassTraitDeclaration = (
    123     """template<> struct EncodingTraits<${enumName}> {
    124     typedef ${enumName} DecodedType;
    125 
    126     static EncodedValue encodeValue(const ${enumName}& value);
    127     static bool decodeValue(EncodedValue&, ${enumName}& value);
     123    """template<> ${structOrClass} EncodingTraits<${encodingTypeArgument}> {
     124    typedef ${enumType} DecodedType;
     125
     126    static EncodedValue encodeValue(const ${enumType}& value);
     127    static bool decodeValue(EncodedValue&, ${enumType}& value);
    128128};""")
    129129
     
    179179
    180180    EnumClassTraitImplementation = (
    181     """EncodedValue EncodingTraits<${enumName}>::encodeValue(const ${enumName}& enumValue)
     181    """EncodedValue EncodingTraits<${encodingTypeArgument}>::encodeValue(const ${enumType}& enumValue)
    182182{
    183183    switch (enumValue) {
     
    187187}
    188188
    189 bool EncodingTraits<${enumName}>::decodeValue(EncodedValue& encodedValue, ${enumName}& enumValue)
     189bool EncodingTraits<${encodingTypeArgument}>::decodeValue(EncodedValue& encodedValue, ${enumType}& enumValue)
    190190{
    191191    String enumString = encodedValue.convertTo<String>();
     
    204204
    205205    EnumTraitImplementation = (
    206     """EncodedValue EncodingTraits<${enumName}>::encodeValue(const ${enumName}& enumValue)
     206    """EncodedValue EncodingTraits<${encodingTypeArgument}>::encodeValue(const ${enumType}& enumValue)
    207207{
    208208    EncodedValue encodedValue = EncodedValue::createArray();
     
    211211}
    212212
    213 bool EncodingTraits<${enumName}>::decodeValue(EncodedValue& encodedValue, ${enumName}& enumValue)
     213bool EncodingTraits<${encodingTypeArgument}>::decodeValue(EncodedValue& encodedValue, ${enumType}& enumValue)
    214214{
    215215    Vector<String> enumStrings;
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.cpp

    r174863 r178714  
    6969    return true;
    7070}
    71 EncodedValue EncodingTraits<WebCore::MouseButton>::encodeValue(const WebCore::MouseButton& enumValue)
    72 {
    73     EncodedValue encodedValue = EncodedValue::createArray();
    74     if (enumValue & WebCore::NoButton) {
    75         encodedValue.append<String>(ASCIILiteral("NoButton"));
    76         if (enumValue == WebCore::NoButton)
    77             return encodedValue;
    78     }
    79     if (enumValue & WebCore::LeftButton) {
    80         encodedValue.append<String>(ASCIILiteral("LeftButton"));
    81         if (enumValue == WebCore::LeftButton)
    82             return encodedValue;
    83     }
    84     if (enumValue & WebCore::MiddleButton) {
    85         encodedValue.append<String>(ASCIILiteral("MiddleButton"));
    86         if (enumValue == WebCore::MiddleButton)
    87             return encodedValue;
    88     }
    89     if (enumValue & WebCore::RightButton) {
    90         encodedValue.append<String>(ASCIILiteral("RightButton"));
    91         if (enumValue == WebCore::RightButton)
    92             return encodedValue;
    93     }
    94 #if ENABLE(SIDE_BUTTONS)
    95     if (enumValue & WebCore::LeftSideButton) {
    96         encodedValue.append<String>(ASCIILiteral("LeftSideButton"));
    97         if (enumValue == WebCore::LeftSideButton)
    98             return encodedValue;
    99     }
    100     if (enumValue & WebCore::RightSideButton) {
    101         encodedValue.append<String>(ASCIILiteral("RightSideButton"));
    102         if (enumValue == WebCore::RightSideButton)
    103             return encodedValue;
    104     }
    105 #endif // ENABLE(SIDE_BUTTONS)
    106 #if PLATFORM(WINDOWS)
    107     if (enumValue & WebCore::WindowsButton) {
    108         encodedValue.append<String>(ASCIILiteral("WindowsButton"));
    109         if (enumValue == WebCore::WindowsButton)
    110             return encodedValue;
    111     }
    112 #endif // PLATFORM(WINDOWS)
    113     return encodedValue;
    114 }
    11571
    116 bool EncodingTraits<WebCore::MouseButton>::decodeValue(EncodedValue& encodedValue, WebCore::MouseButton& enumValue)
    117 {
    118     Vector<String> enumStrings;
    119     if (!EncodingTraits<Vector<String>>::decodeValue(encodedValue, enumStrings))
    120         return false;
    121 
    122     for (const String& enumString : enumStrings) {
    123         if (enumString == "NoButton")
    124             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::NoButton);
    125         else if (enumString == "LeftButton")
    126             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::LeftButton);
    127         else if (enumString == "MiddleButton")
    128             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::MiddleButton);
    129         else if (enumString == "RightButton")
    130             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::RightButton);
    131 #if ENABLE(SIDE_BUTTONS)
    132         if (enumString == "LeftSideButton")
    133             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::LeftSideButton);
    134         else if (enumString == "RightSideButton")
    135             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::RightSideButton);
    136 #endif // ENABLE(SIDE_BUTTONS)
    137 #if PLATFORM(WINDOWS)
    138         if (enumString == "WindowsButton")
    139             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::WindowsButton);
    140 #endif // PLATFORM(WINDOWS)
    141     }
    142 
    143     return true;
    144 }
    14572} // namespace JSC
    14673
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.h

    r178668 r178714  
    4545
    4646namespace JSC {
    47 template<> struct InputTraits<Test::SavedMouseButton> {
     47template<> struct TEST_EXPORT_MACRO InputTraits<Test::SavedMouseButton> {
    4848    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    4949    static const String& type();
     
    5252    static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::SavedMouseButton>&);
    5353};
    54 template<> struct EncodingTraits<WebCore::MouseButton> {
    55     typedef WebCore::MouseButton DecodedType;
    5654
    57     static EncodedValue encodeValue(const WebCore::MouseButton& value);
    58     static bool decodeValue(EncodedValue&, WebCore::MouseButton& value);
    59 };
    6055} // namespace JSC
    6156
     
    6358class SavedMouseButton : public NondeterministicInput<SavedMouseButton> {
    6459public:
    65     SavedMouseButton(MouseButton button);
     60    TEST_EXPORT_MACRO SavedMouseButton(MouseButton button);
    6661    virtual ~SavedMouseButton();
    6762
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.cpp

    r174863 r178714  
    3333#if ENABLE(WEB_REPLAY)
    3434#include "InternalNamespaceImplIncludeDummy.h"
     35#include "NondeterministicInput.h"
     36#include "PlatformMouseEvent.h"
    3537#include <platform/ExternalNamespaceImplIncludeDummy.h>
    36 #include <platform/PlatformMouseEvent.h>
    37 #include <replay/NondeterministicInput.h>
    3838
    3939namespace Test {
     
    5858void InputTraits<Test::SavedMouseButton>::encode(EncodedValue& encodedValue, const Test::SavedMouseButton& input)
    5959{
    60     encodedValue.put<WebCore::MouseButton>(ASCIILiteral("button"), input.button());
     60    encodedValue.put<Test::MouseButton>(ASCIILiteral("button"), input.button());
    6161}
    6262
    6363bool InputTraits<Test::SavedMouseButton>::decode(EncodedValue& encodedValue, std::unique_ptr<Test::SavedMouseButton>& input)
    6464{
    65     WebCore::MouseButton button;
    66     if (!encodedValue.get<WebCore::MouseButton>(ASCIILiteral("button"), button))
     65    Test::MouseButton button;
     66    if (!encodedValue.get<Test::MouseButton>(ASCIILiteral("button"), button))
    6767        return false;
    6868
     
    7070    return true;
    7171}
    72 EncodedValue EncodingTraits<InputQueue>::encodeValue(const InputQueue& enumValue)
     72EncodedValue EncodingTraits<Test::InputQueue>::encodeValue(const Test::InputQueue& enumValue)
    7373{
    7474    switch (enumValue) {
    75     case InputQueue::EventLoopInput: return EncodedValue::createString("EventLoopInput");
    76     case InputQueue::LoaderMemoizedData: return EncodedValue::createString("LoaderMemoizedData");
    77     case InputQueue::ScriptMemoizedData: return EncodedValue::createString("ScriptMemoizedData");
     75    case Test::InputQueue::EventLoopInput: return EncodedValue::createString("EventLoopInput");
     76    case Test::InputQueue::LoaderMemoizedData: return EncodedValue::createString("LoaderMemoizedData");
     77    case Test::InputQueue::ScriptMemoizedData: return EncodedValue::createString("ScriptMemoizedData");
    7878    default: ASSERT_NOT_REACHED(); return EncodedValue::createString("Error!");
    7979    }
    8080}
    8181
    82 bool EncodingTraits<InputQueue>::decodeValue(EncodedValue& encodedValue, InputQueue& enumValue)
     82bool EncodingTraits<Test::InputQueue>::decodeValue(EncodedValue& encodedValue, Test::InputQueue& enumValue)
    8383{
    8484    String enumString = encodedValue.convertTo<String>();
    8585    if (enumString == "EventLoopInput") {
    86         enumValue = InputQueue::EventLoopInput;
     86        enumValue = Test::InputQueue::EventLoopInput;
    8787        return true;
    8888    }
    8989    if (enumString == "LoaderMemoizedData") {
    90         enumValue = InputQueue::LoaderMemoizedData;
     90        enumValue = Test::InputQueue::LoaderMemoizedData;
    9191        return true;
    9292    }
    9393    if (enumString == "ScriptMemoizedData") {
    94         enumValue = InputQueue::ScriptMemoizedData;
     94        enumValue = Test::InputQueue::ScriptMemoizedData;
    9595        return true;
    9696    }
     
    9898}
    9999
    100 EncodedValue EncodingTraits<WebCore::MouseButton>::encodeValue(const WebCore::MouseButton& enumValue)
     100EncodedValue EncodingTraits<Test::MouseButton>::encodeValue(const Test::MouseButton& enumValue)
    101101{
    102102    EncodedValue encodedValue = EncodedValue::createArray();
    103     if (enumValue & WebCore::NoButton) {
     103    if (enumValue & Test::NoButton) {
    104104        encodedValue.append<String>(ASCIILiteral("NoButton"));
    105         if (enumValue == WebCore::NoButton)
     105        if (enumValue == Test::NoButton)
    106106            return encodedValue;
    107107    }
    108     if (enumValue & WebCore::LeftButton) {
     108    if (enumValue & Test::LeftButton) {
    109109        encodedValue.append<String>(ASCIILiteral("LeftButton"));
    110         if (enumValue == WebCore::LeftButton)
     110        if (enumValue == Test::LeftButton)
    111111            return encodedValue;
    112112    }
    113     if (enumValue & WebCore::MiddleButton) {
     113    if (enumValue & Test::MiddleButton) {
    114114        encodedValue.append<String>(ASCIILiteral("MiddleButton"));
    115         if (enumValue == WebCore::MiddleButton)
     115        if (enumValue == Test::MiddleButton)
    116116            return encodedValue;
    117117    }
    118     if (enumValue & WebCore::RightButton) {
     118    if (enumValue & Test::RightButton) {
    119119        encodedValue.append<String>(ASCIILiteral("RightButton"));
    120         if (enumValue == WebCore::RightButton)
     120        if (enumValue == Test::RightButton)
    121121            return encodedValue;
    122122    }
     
    124124}
    125125
    126 bool EncodingTraits<WebCore::MouseButton>::decodeValue(EncodedValue& encodedValue, WebCore::MouseButton& enumValue)
     126bool EncodingTraits<Test::MouseButton>::decodeValue(EncodedValue& encodedValue, Test::MouseButton& enumValue)
    127127{
    128128    Vector<String> enumStrings;
     
    132132    for (const String& enumString : enumStrings) {
    133133        if (enumString == "NoButton")
    134             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::NoButton);
     134            enumValue = static_cast<Test::MouseButton>(enumValue | Test::NoButton);
    135135        else if (enumString == "LeftButton")
    136             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::LeftButton);
     136            enumValue = static_cast<Test::MouseButton>(enumValue | Test::LeftButton);
    137137        else if (enumString == "MiddleButton")
    138             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::MiddleButton);
     138            enumValue = static_cast<Test::MouseButton>(enumValue | Test::MiddleButton);
    139139        else if (enumString == "RightButton")
    140             enumValue = static_cast<WebCore::MouseButton>(enumValue | WebCore::RightButton);
     140            enumValue = static_cast<Test::MouseButton>(enumValue | Test::RightButton);
    141141    }
    142142
     
    144144}
    145145
    146 EncodedValue EncodingTraits<WebCore::PlatformEvent::Type>::encodeValue(const WebCore::PlatformEvent::Type& enumValue)
     146EncodedValue EncodingTraits<Test::PlatformEvent::Type>::encodeValue(const Test::PlatformEvent::Type& enumValue)
    147147{
    148148    EncodedValue encodedValue = EncodedValue::createArray();
    149     if (enumValue & WebCore::PlatformEvent::Mouse) {
     149    if (enumValue & Test::PlatformEvent::Mouse) {
    150150        encodedValue.append<String>(ASCIILiteral("Mouse"));
    151         if (enumValue == WebCore::PlatformEvent::Mouse)
     151        if (enumValue == Test::PlatformEvent::Mouse)
    152152            return encodedValue;
    153153    }
    154     if (enumValue & WebCore::PlatformEvent::Key) {
     154    if (enumValue & Test::PlatformEvent::Key) {
    155155        encodedValue.append<String>(ASCIILiteral("Key"));
    156         if (enumValue == WebCore::PlatformEvent::Key)
     156        if (enumValue == Test::PlatformEvent::Key)
    157157            return encodedValue;
    158158    }
    159     if (enumValue & WebCore::PlatformEvent::Touch) {
     159    if (enumValue & Test::PlatformEvent::Touch) {
    160160        encodedValue.append<String>(ASCIILiteral("Touch"));
    161         if (enumValue == WebCore::PlatformEvent::Touch)
     161        if (enumValue == Test::PlatformEvent::Touch)
    162162            return encodedValue;
    163163    }
    164     if (enumValue & WebCore::PlatformEvent::Wheel) {
     164    if (enumValue & Test::PlatformEvent::Wheel) {
    165165        encodedValue.append<String>(ASCIILiteral("Wheel"));
    166         if (enumValue == WebCore::PlatformEvent::Wheel)
     166        if (enumValue == Test::PlatformEvent::Wheel)
    167167            return encodedValue;
    168168    }
     
    170170}
    171171
    172 bool EncodingTraits<WebCore::PlatformEvent::Type>::decodeValue(EncodedValue& encodedValue, WebCore::PlatformEvent::Type& enumValue)
     172bool EncodingTraits<Test::PlatformEvent::Type>::decodeValue(EncodedValue& encodedValue, Test::PlatformEvent::Type& enumValue)
    173173{
    174174    Vector<String> enumStrings;
     
    178178    for (const String& enumString : enumStrings) {
    179179        if (enumString == "Mouse")
    180             enumValue = static_cast<WebCore::PlatformEvent::Type>(enumValue | WebCore::PlatformEvent::Mouse);
     180            enumValue = static_cast<Test::PlatformEvent::Type>(enumValue | Test::PlatformEvent::Mouse);
    181181        else if (enumString == "Key")
    182             enumValue = static_cast<WebCore::PlatformEvent::Type>(enumValue | WebCore::PlatformEvent::Key);
     182            enumValue = static_cast<Test::PlatformEvent::Type>(enumValue | Test::PlatformEvent::Key);
    183183        else if (enumString == "Touch")
    184             enumValue = static_cast<WebCore::PlatformEvent::Type>(enumValue | WebCore::PlatformEvent::Touch);
     184            enumValue = static_cast<Test::PlatformEvent::Type>(enumValue | Test::PlatformEvent::Touch);
    185185        else if (enumString == "Wheel")
    186             enumValue = static_cast<WebCore::PlatformEvent::Type>(enumValue | WebCore::PlatformEvent::Wheel);
     186            enumValue = static_cast<Test::PlatformEvent::Type>(enumValue | Test::PlatformEvent::Wheel);
    187187    }
    188188
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.h

    r178668 r178714  
    3333#if ENABLE(WEB_REPLAY)
    3434#include "InternalNamespaceHeaderIncludeDummy.h"
     35#include "PlatformEvent.h"
    3536#include <platform/ExternalNamespaceHeaderIncludeDummy.h>
    36 #include <platform/PlatformEvent.h>
    3737
    38 namespace WebCore {
     38namespace Test {
    3939enum MouseButton : unsigned;
    40 }
    41 
    42 namespace JSC {
    4340enum class InputQueue;
    4441}
     
    5047
    5148namespace JSC {
    52 template<> struct InputTraits<Test::SavedMouseButton> {
     49template<> struct TEST_EXPORT_MACRO InputTraits<Test::SavedMouseButton> {
    5350    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5451    static const String& type();
     
    5754    static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::SavedMouseButton>&);
    5855};
    59 template<> struct EncodingTraits<InputQueue> {
    60     typedef InputQueue DecodedType;
     56template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::InputQueue> {
     57    typedef Test::InputQueue DecodedType;
    6158
    62     static EncodedValue encodeValue(const InputQueue& value);
    63     static bool decodeValue(EncodedValue&, InputQueue& value);
     59    static EncodedValue encodeValue(const Test::InputQueue& value);
     60    static bool decodeValue(EncodedValue&, Test::InputQueue& value);
    6461};
    6562
    66 template<> struct EncodingTraits<WebCore::MouseButton> {
    67     typedef WebCore::MouseButton DecodedType;
     63template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::MouseButton> {
     64    typedef Test::MouseButton DecodedType;
    6865
    69     static EncodedValue encodeValue(const WebCore::MouseButton& value);
    70     static bool decodeValue(EncodedValue&, WebCore::MouseButton& value);
     66    static EncodedValue encodeValue(const Test::MouseButton& value);
     67    static bool decodeValue(EncodedValue&, Test::MouseButton& value);
    7168};
    7269
    73 template<> struct EncodingTraits<WebCore::PlatformEvent::Type> {
    74     typedef WebCore::PlatformEvent::Type DecodedType;
     70template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::PlatformEvent::Type> {
     71    typedef Test::PlatformEvent::Type DecodedType;
    7572
    76     static EncodedValue encodeValue(const WebCore::PlatformEvent::Type& value);
    77     static bool decodeValue(EncodedValue&, WebCore::PlatformEvent::Type& value);
     73    static EncodedValue encodeValue(const Test::PlatformEvent::Type& value);
     74    static bool decodeValue(EncodedValue&, Test::PlatformEvent::Type& value);
    7875};
    7976} // namespace JSC
     
    8279class SavedMouseButton : public NondeterministicInput<SavedMouseButton> {
    8380public:
    84     SavedMouseButton(MouseButton button);
     81    TEST_EXPORT_MACRO SavedMouseButton(MouseButton button);
    8582    virtual ~SavedMouseButton();
    8683
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.cpp

    r174863 r178714  
    3333#if ENABLE(WEB_REPLAY)
    3434#include "InternalNamespaceImplIncludeDummy.h"
     35#include "PlatformWheelEvent.h"
    3536#include <platform/ExternalNamespaceImplIncludeDummy.h>
    3637#include <platform/PlatformWheelEvent.h>
    3738
    3839namespace Test {
    39 HandleWheelEvent::HandleWheelEvent(std::unique_ptr<PlatformWheelEvent> platformEvent)
     40HandleWheelEvent::HandleWheelEvent(std::unique_ptr<PlatformWheelEvent> platformEvent, PlatformWheelPhase phase)
    4041    : EventLoopInput<HandleWheelEvent>()
    4142    , m_platformEvent(WTF::move(platformEvent))
     43    , m_phase(phase)
    4244{
    4345}
     
    5860{
    5961    encodedValue.put<WebCore::PlatformWheelEvent>(ASCIILiteral("platformEvent"), input.platformEvent());
     62    encodedValue.put<Test::PlatformWheelPhase>(ASCIILiteral("phase"), input.phase());
    6063}
    6164
     
    6669        return false;
    6770
    68     input = std::make_unique<Test::HandleWheelEvent>(WTF::move(platformEvent));
     71    Test::PlatformWheelPhase phase;
     72    if (!encodedValue.get<Test::PlatformWheelPhase>(ASCIILiteral("phase"), phase))
     73        return false;
     74
     75    input = std::make_unique<Test::HandleWheelEvent>(WTF::move(platformEvent), phase);
    6976    return true;
    7077}
    7178#if ENABLE(DUMMY_FEATURE)
    72 EncodedValue EncodingTraits<WebCore::PlatformWheelEventPhase>::encodeValue(const WebCore::PlatformWheelEventPhase& enumValue)
     79EncodedValue EncodingTraits<Test::PlatformWheelPhase>::encodeValue(const Test::PlatformWheelPhase& enumValue)
    7380{
    7481    EncodedValue encodedValue = EncodedValue::createArray();
    75     if (enumValue & WebCore::PlatformWheelEventPhaseNone) {
     82    if (enumValue & Test::PlatformWheelEventPhaseNone) {
    7683        encodedValue.append<String>(ASCIILiteral("PlatformWheelEventPhaseNone"));
    77         if (enumValue == WebCore::PlatformWheelEventPhaseNone)
     84        if (enumValue == Test::PlatformWheelEventPhaseNone)
    7885            return encodedValue;
    7986    }
     
    8188}
    8289
    83 bool EncodingTraits<WebCore::PlatformWheelEventPhase>::decodeValue(EncodedValue& encodedValue, WebCore::PlatformWheelEventPhase& enumValue)
     90bool EncodingTraits<Test::PlatformWheelPhase>::decodeValue(EncodedValue& encodedValue, Test::PlatformWheelPhase& enumValue)
    8491{
    8592    Vector<String> enumStrings;
     
    8996    for (const String& enumString : enumStrings) {
    9097        if (enumString == "PlatformWheelEventPhaseNone")
    91             enumValue = static_cast<WebCore::PlatformWheelEventPhase>(enumValue | WebCore::PlatformWheelEventPhaseNone);
     98            enumValue = static_cast<Test::PlatformWheelPhase>(enumValue | Test::PlatformWheelEventPhaseNone);
    9299    }
    93100
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h

    r178668 r178714  
    3535#include <platform/ExternalNamespaceHeaderIncludeDummy.h>
    3636
     37namespace Test {
     38enum PlatformWheelPhase : uint64_t;
     39}
     40
    3741namespace WebCore {
    3842class PlatformWheelEvent;
    39 enum PlatformWheelEventPhase : uint64_t;
    4043}
    4144
     
    4649
    4750namespace JSC {
    48 template<> struct InputTraits<Test::HandleWheelEvent> {
     51template<> struct TEST_EXPORT_MACRO InputTraits<Test::HandleWheelEvent> {
    4952    static InputQueue queue() { return InputQueue::EventLoopInput; }
    5053    static const String& type();
     
    5457};
    5558#if ENABLE(DUMMY_FEATURE)
    56 template<> struct EncodingTraits<WebCore::PlatformWheelEventPhase> {
    57     typedef WebCore::PlatformWheelEventPhase DecodedType;
     59template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::PlatformWheelPhase> {
     60    typedef Test::PlatformWheelPhase DecodedType;
    5861
    59     static EncodedValue encodeValue(const WebCore::PlatformWheelEventPhase& value);
    60     static bool decodeValue(EncodedValue&, WebCore::PlatformWheelEventPhase& value);
     62    static EncodedValue encodeValue(const Test::PlatformWheelPhase& value);
     63    static bool decodeValue(EncodedValue&, Test::PlatformWheelPhase& value);
    6164};
    6265#endif // ENABLE(DUMMY_FEATURE)
     
    6669class HandleWheelEvent : public EventLoopInput<HandleWheelEvent> {
    6770public:
    68     HandleWheelEvent(std::unique_ptr<PlatformWheelEvent> platformEvent);
     71    TEST_EXPORT_MACRO HandleWheelEvent(std::unique_ptr<PlatformWheelEvent> platformEvent, PlatformWheelPhase phase);
    6972    virtual ~HandleWheelEvent();
    7073
     
    7275    virtual void dispatch(ReplayController&) override final;
    7376    const PlatformWheelEvent& platformEvent() const { return *m_platformEvent; }
     77    PlatformWheelPhase phase() const { return m_phase; }
    7478private:
    7579    std::unique_ptr<PlatformWheelEvent> m_platformEvent;
     80    PlatformWheelPhase m_phase;
    7681};
    7782} // namespace Test
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp

    r174863 r178714  
    6161    encodedValue.put<PlatformEvent1::Type>(ASCIILiteral("eventType1"), input.eventType1());
    6262    encodedValue.put<PlatformEvent2::Type>(ASCIILiteral("eventType2"), input.eventType2());
    63     encodedValue.put<WebCore::FormData1::Type>(ASCIILiteral("formType1"), input.formType1());
    64     encodedValue.put<WebCore::FormData2::Type>(ASCIILiteral("formType2"), input.formType2());
     63    encodedValue.put<Test::FormData1::Type>(ASCIILiteral("formType1"), input.formType1());
     64    encodedValue.put<Test::FormData2::Type>(ASCIILiteral("formType2"), input.formType2());
    6565}
    6666
     
    7575        return false;
    7676
    77     WebCore::FormData1::Type formType1;
    78     if (!encodedValue.get<WebCore::FormData1::Type>(ASCIILiteral("formType1"), formType1))
     77    Test::FormData1::Type formType1;
     78    if (!encodedValue.get<Test::FormData1::Type>(ASCIILiteral("formType1"), formType1))
    7979        return false;
    8080
    81     WebCore::FormData2::Type formType2;
    82     if (!encodedValue.get<WebCore::FormData2::Type>(ASCIILiteral("formType2"), formType2))
     81    Test::FormData2::Type formType2;
     82    if (!encodedValue.get<Test::FormData2::Type>(ASCIILiteral("formType2"), formType2))
    8383        return false;
    8484
     
    8686    return true;
    8787}
    88 EncodedValue EncodingTraits<WebCore::FormData1::Type>::encodeValue(const WebCore::FormData1::Type& enumValue)
     88EncodedValue EncodingTraits<Test::FormData1::Type>::encodeValue(const Test::FormData1::Type& enumValue)
    8989{
    9090    EncodedValue encodedValue = EncodedValue::createArray();
    91     if (enumValue & WebCore::FormData1::Text) {
     91    if (enumValue & Test::FormData1::Text) {
    9292        encodedValue.append<String>(ASCIILiteral("Text"));
    93         if (enumValue == WebCore::FormData1::Text)
     93        if (enumValue == Test::FormData1::Text)
    9494            return encodedValue;
    9595    }
    96     if (enumValue & WebCore::FormData1::Blob) {
     96    if (enumValue & Test::FormData1::Blob) {
    9797        encodedValue.append<String>(ASCIILiteral("Blob"));
    98         if (enumValue == WebCore::FormData1::Blob)
     98        if (enumValue == Test::FormData1::Blob)
    9999            return encodedValue;
    100100    }
     
    102102}
    103103
    104 bool EncodingTraits<WebCore::FormData1::Type>::decodeValue(EncodedValue& encodedValue, WebCore::FormData1::Type& enumValue)
     104bool EncodingTraits<Test::FormData1::Type>::decodeValue(EncodedValue& encodedValue, Test::FormData1::Type& enumValue)
    105105{
    106106    Vector<String> enumStrings;
     
    110110    for (const String& enumString : enumStrings) {
    111111        if (enumString == "Text")
    112             enumValue = static_cast<WebCore::FormData1::Type>(enumValue | WebCore::FormData1::Text);
     112            enumValue = static_cast<Test::FormData1::Type>(enumValue | Test::FormData1::Text);
    113113        else if (enumString == "Blob")
    114             enumValue = static_cast<WebCore::FormData1::Type>(enumValue | WebCore::FormData1::Blob);
     114            enumValue = static_cast<Test::FormData1::Type>(enumValue | Test::FormData1::Blob);
    115115    }
    116116
     
    118118}
    119119
    120 EncodedValue EncodingTraits<WebCore::FormData2::Type>::encodeValue(const WebCore::FormData2::Type& enumValue)
     120EncodedValue EncodingTraits<Test::FormData2::Type>::encodeValue(const Test::FormData2::Type& enumValue)
    121121{
    122122    switch (enumValue) {
    123     case WebCore::FormData2::Type::Text: return EncodedValue::createString("Text");
    124     case WebCore::FormData2::Type::Blob: return EncodedValue::createString("Blob");
     123    case Test::FormData2::Type::Text: return EncodedValue::createString("Text");
     124    case Test::FormData2::Type::Blob: return EncodedValue::createString("Blob");
    125125    default: ASSERT_NOT_REACHED(); return EncodedValue::createString("Error!");
    126126    }
    127127}
    128128
    129 bool EncodingTraits<WebCore::FormData2::Type>::decodeValue(EncodedValue& encodedValue, WebCore::FormData2::Type& enumValue)
     129bool EncodingTraits<Test::FormData2::Type>::decodeValue(EncodedValue& encodedValue, Test::FormData2::Type& enumValue)
    130130{
    131131    String enumString = encodedValue.convertTo<String>();
    132132    if (enumString == "Text") {
    133         enumValue = WebCore::FormData2::Type::Text;
     133        enumValue = Test::FormData2::Type::Text;
    134134        return true;
    135135    }
    136136    if (enumString == "Blob") {
    137         enumValue = WebCore::FormData2::Type::Blob;
    138         return true;
    139     }
    140     return false;
    141 }
    142 
    143 EncodedValue EncodingTraits<PlatformEvent1::Type>::encodeValue(const PlatformEvent1::Type& enumValue)
    144 {
    145     EncodedValue encodedValue = EncodedValue::createArray();
    146     if (enumValue & PlatformEvent1::Mouse) {
    147         encodedValue.append<String>(ASCIILiteral("Mouse"));
    148         if (enumValue == PlatformEvent1::Mouse)
    149             return encodedValue;
    150     }
    151     if (enumValue & PlatformEvent1::Keyboard) {
    152         encodedValue.append<String>(ASCIILiteral("Keyboard"));
    153         if (enumValue == PlatformEvent1::Keyboard)
    154             return encodedValue;
    155     }
    156     return encodedValue;
    157 }
    158 
    159 bool EncodingTraits<PlatformEvent1::Type>::decodeValue(EncodedValue& encodedValue, PlatformEvent1::Type& enumValue)
    160 {
    161     Vector<String> enumStrings;
    162     if (!EncodingTraits<Vector<String>>::decodeValue(encodedValue, enumStrings))
    163         return false;
    164 
    165     for (const String& enumString : enumStrings) {
    166         if (enumString == "Mouse")
    167             enumValue = static_cast<PlatformEvent1::Type>(enumValue | PlatformEvent1::Mouse);
    168         else if (enumString == "Keyboard")
    169             enumValue = static_cast<PlatformEvent1::Type>(enumValue | PlatformEvent1::Keyboard);
    170     }
    171 
    172     return true;
    173 }
    174 
    175 EncodedValue EncodingTraits<PlatformEvent2::Type>::encodeValue(const PlatformEvent2::Type& enumValue)
    176 {
    177     switch (enumValue) {
    178     case PlatformEvent2::Type::Mouse: return EncodedValue::createString("Mouse");
    179     case PlatformEvent2::Type::Keyboard: return EncodedValue::createString("Keyboard");
    180     default: ASSERT_NOT_REACHED(); return EncodedValue::createString("Error!");
    181     }
    182 }
    183 
    184 bool EncodingTraits<PlatformEvent2::Type>::decodeValue(EncodedValue& encodedValue, PlatformEvent2::Type& enumValue)
    185 {
    186     String enumString = encodedValue.convertTo<String>();
    187     if (enumString == "Mouse") {
    188         enumValue = PlatformEvent2::Type::Mouse;
    189         return true;
    190     }
    191     if (enumString == "Keyboard") {
    192         enumValue = PlatformEvent2::Type::Keyboard;
     137        enumValue = Test::FormData2::Type::Blob;
    193138        return true;
    194139    }
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h

    r178668 r178714  
    3232
    3333#if ENABLE(WEB_REPLAY)
     34#include "FormData1.h"
     35#include "FormData2.h"
    3436#include "InternalNamespaceHeaderIncludeDummy.h"
    3537#include <platform/ExternalNamespaceHeaderIncludeDummy.h>
    36 #include <replay/FormData1.h>
    37 #include <replay/FormData2.h>
    3838#include <replay/PlatformEvent.h>
    3939
     
    4545
    4646namespace JSC {
    47 template<> struct InputTraits<Test::FormCombo> {
     47template<> struct TEST_EXPORT_MACRO InputTraits<Test::FormCombo> {
    4848    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    4949    static const String& type();
     
    5252    static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::FormCombo>&);
    5353};
    54 template<> struct EncodingTraits<WebCore::FormData1::Type> {
    55     typedef WebCore::FormData1::Type DecodedType;
     54template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::FormData1::Type> {
     55    typedef Test::FormData1::Type DecodedType;
    5656
    57     static EncodedValue encodeValue(const WebCore::FormData1::Type& value);
    58     static bool decodeValue(EncodedValue&, WebCore::FormData1::Type& value);
     57    static EncodedValue encodeValue(const Test::FormData1::Type& value);
     58    static bool decodeValue(EncodedValue&, Test::FormData1::Type& value);
    5959};
    6060
    61 template<> struct EncodingTraits<WebCore::FormData2::Type> {
    62     typedef WebCore::FormData2::Type DecodedType;
     61template<> struct TEST_EXPORT_MACRO EncodingTraits<Test::FormData2::Type> {
     62    typedef Test::FormData2::Type DecodedType;
    6363
    64     static EncodedValue encodeValue(const WebCore::FormData2::Type& value);
    65     static bool decodeValue(EncodedValue&, WebCore::FormData2::Type& value);
    66 };
    67 
    68 template<> struct EncodingTraits<PlatformEvent1::Type> {
    69     typedef PlatformEvent1::Type DecodedType;
    70 
    71     static EncodedValue encodeValue(const PlatformEvent1::Type& value);
    72     static bool decodeValue(EncodedValue&, PlatformEvent1::Type& value);
    73 };
    74 
    75 template<> struct EncodingTraits<PlatformEvent2::Type> {
    76     typedef PlatformEvent2::Type DecodedType;
    77 
    78     static EncodedValue encodeValue(const PlatformEvent2::Type& value);
    79     static bool decodeValue(EncodedValue&, PlatformEvent2::Type& value);
     64    static EncodedValue encodeValue(const Test::FormData2::Type& value);
     65    static bool decodeValue(EncodedValue&, Test::FormData2::Type& value);
    8066};
    8167} // namespace JSC
     
    8470class FormCombo : public NondeterministicInput<FormCombo> {
    8571public:
    86     FormCombo(PlatformEvent1::Type eventType1, PlatformEvent2::Type eventType2, FormData1::Type formType1, FormData2::Type formType2);
     72    TEST_EXPORT_MACRO FormCombo(PlatformEvent1::Type eventType1, PlatformEvent2::Type eventType2, FormData1::Type formType1, FormData2::Type formType2);
    8773    virtual ~FormCombo();
    8874
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-input-with-guard.json-TestReplayInputs.h

    r178668 r178714  
    4646namespace JSC {
    4747#if ENABLE(DUMMY_FEATURE)
    48 template<> struct InputTraits<Test::GetCurrentTime> {
     48template<> struct TEST_EXPORT_MACRO InputTraits<Test::GetCurrentTime> {
    4949    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5050    static const String& type();
     
    5555#endif // ENABLE(DUMMY_FEATURE)
    5656
    57 template<> struct InputTraits<Test::SetRandomSeed> {
     57template<> struct TEST_EXPORT_MACRO InputTraits<Test::SetRandomSeed> {
    5858    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5959    static const String& type();
     
    6969class GetCurrentTime : public NondeterministicInput<GetCurrentTime> {
    7070public:
    71     GetCurrentTime(double currentTime);
     71    TEST_EXPORT_MACRO GetCurrentTime(double currentTime);
    7272    virtual ~GetCurrentTime();
    7373
     
    8080class SetRandomSeed : public NondeterministicInput<SetRandomSeed> {
    8181public:
    82     SetRandomSeed(uint64_t randomSeed);
     82    TEST_EXPORT_MACRO SetRandomSeed(uint64_t randomSeed);
    8383    virtual ~SetRandomSeed();
    8484
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h

    r178668 r178714  
    4747
    4848namespace JSC {
    49 template<> struct InputTraits<Test::ArrayOfThings> {
     49template<> struct TEST_EXPORT_MACRO InputTraits<Test::ArrayOfThings> {
    5050    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5151    static const String& type();
     
    5555};
    5656
    57 template<> struct InputTraits<Test::SavedHistory> {
     57template<> struct TEST_EXPORT_MACRO InputTraits<Test::SavedHistory> {
    5858    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5959    static const String& type();
     
    6868class ArrayOfThings : public NondeterministicInput<ArrayOfThings> {
    6969public:
    70     ArrayOfThings(Vector<double>& doubles, Vector<JSThing>& jsthings, Vector<WebThing>& webthings);
     70    TEST_EXPORT_MACRO ArrayOfThings(Vector<double>& doubles, Vector<JSThing>& jsthings, Vector<WebThing>& webthings);
    7171    virtual ~ArrayOfThings();
    7272
     
    8282class SavedHistory : public NondeterministicInput<SavedHistory> {
    8383public:
    84     SavedHistory(Vector<RefPtr<HistoryItem>>& entries);
     84    TEST_EXPORT_MACRO SavedHistory(Vector<RefPtr<HistoryItem>>& entries);
    8585    virtual ~SavedHistory();
    8686
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-inputs-with-flags.json-TestReplayInputs.h

    r178668 r178714  
    4343
    4444namespace JSC {
    45 template<> struct InputTraits<Test::ScalarInput1> {
     45template<> struct TEST_EXPORT_MACRO InputTraits<Test::ScalarInput1> {
    4646    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    4747    static const String& type();
     
    5151};
    5252
    53 template<> struct InputTraits<Test::ScalarInput2> {
     53template<> struct TEST_EXPORT_MACRO InputTraits<Test::ScalarInput2> {
    5454    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5555    static const String& type();
     
    6464class ScalarInput1 : public NondeterministicInput<ScalarInput1> {
    6565public:
    66     ScalarInput1(ScalarType data);
     66    TEST_EXPORT_MACRO ScalarInput1(ScalarType data);
    6767    virtual ~ScalarInput1();
    6868
     
    7474class ScalarInput2 : public NondeterministicInput<ScalarInput2> {
    7575public:
    76     ScalarInput2(ScalarType data);
     76    TEST_EXPORT_MACRO ScalarInput2(ScalarType data);
    7777    virtual ~ScalarInput2();
    7878
  • trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-memoized-type-modes.json-TestReplayInputs.h

    r178668 r178714  
    4343
    4444namespace JSC {
    45 template<> struct InputTraits<Test::ScalarInput> {
     45template<> struct TEST_EXPORT_MACRO InputTraits<Test::ScalarInput> {
    4646    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    4747    static const String& type();
     
    5151};
    5252
    53 template<> struct InputTraits<Test::MapInput> {
     53template<> struct TEST_EXPORT_MACRO InputTraits<Test::MapInput> {
    5454    static InputQueue queue() { return InputQueue::ScriptMemoizedData; }
    5555    static const String& type();
     
    6464class ScalarInput : public NondeterministicInput<ScalarInput> {
    6565public:
    66     ScalarInput(ScalarType data);
     66    TEST_EXPORT_MACRO ScalarInput(ScalarType data);
    6767    virtual ~ScalarInput();
    6868
     
    7474class MapInput : public NondeterministicInput<MapInput> {
    7575public:
    76     MapInput(std::unique_ptr<MapType> data);
     76    TEST_EXPORT_MACRO MapInput(std::unique_ptr<MapType> data);
    7777    virtual ~MapInput();
    7878
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-c-style-enum-no-storage.json

    r163918 r178714  
    11{
    22    "types": {
    3         "WebCore": [
     3        "Test": [
    44            {
    55                "name": "MouseButton", "mode": "SCALAR",
     
    1111    },
    1212
    13     "inputs": [
    14         {
    15             "name": "SavedMouseButton",
    16             "description": "Supplies a mouse button enum value.",
    17             "queue": "SCRIPT_MEMOIZED",
    18             "members": [
    19                 { "name": "button", "type": "MouseButton" }
    20             ]
    21         }
    22     ]
     13    "inputs": {
     14        "Test": [
     15            {
     16                "name": "SavedMouseButton",
     17                "description": "Supplies a mouse button enum value.",
     18                "queue": "SCRIPT_MEMOIZED",
     19                "members": [
     20                    { "name": "button", "type": "MouseButton" }
     21                ]
     22            }
     23        ]
     24    }
    2325}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-duplicate-enum-type.json

    r167174 r178714  
    2121    },
    2222
    23     "inputs": [
    24         {
    25             "name": "FormCombo",
    26             "description": "Combines an event type and form data type.",
    27             "queue": "SCRIPT_MEMOIZED",
    28             "members": [
    29                 { "name": "eventType", "type": "PlatformEvent::Type" }
    30             ]
    31         }
    32     ]
     23    "inputs": {
     24        "Test": [
     25            {
     26                "name": "FormCombo",
     27                "description": "Combines an event type and form data type.",
     28                "queue": "SCRIPT_MEMOIZED",
     29                "members": [
     30                    { "name": "eventType", "type": "PlatformEvent::Type" }
     31                ]
     32            }
     33        ]
     34    }
    3335}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-duplicate-input-names.json

    r163918 r178714  
    77    },
    88
    9     "inputs": [
    10         {
    11             "name": "GetCurrentTime",
    12             "description": "Supplies the system time to Date.now() and new Date().",
    13             "queue": "SCRIPT_MEMOIZED",
    14             "members": [
    15                 { "name": "currentTime", "type": "double" }
    16             ]
    17         },
    18         {
    19             "name": "GetCurrentTime",
    20             "description": "Sets the PRNG seed used by Math.random().",
    21             "queue": "SCRIPT_MEMOIZED",
    22             "members": [
    23                 { "name": "randomSeed", "type": "uint64_t" }
    24             ]
    25         }
    26     ]
     9    "inputs": {
     10        "Test": [
     11            {
     12                "name": "GetCurrentTime",
     13                "description": "Supplies the system time to Date.now() and new Date().",
     14                "queue": "SCRIPT_MEMOIZED",
     15                "members": [
     16                    { "name": "currentTime", "type": "double" }
     17                ]
     18            },
     19            {
     20                "name": "GetCurrentTime",
     21                "description": "Sets the PRNG seed used by Math.random().",
     22                "queue": "SCRIPT_MEMOIZED",
     23                "members": [
     24                    { "name": "randomSeed", "type": "uint64_t" }
     25                ]
     26            }
     27        ]
     28    }
    2729}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-duplicate-type-names.json

    r163918 r178714  
    77    },
    88
    9     "inputs": [
    10         {
    11             "name": "SetRandomSeed",
    12             "description": "Sets the PRNG seed used by Math.random().",
    13             "queue": "SCRIPT_MEMOIZED",
    14             "members": [
    15                 {
    16                     "name": "randomSeed",
    17                     "type": "uint64_t"
    18                 }
    19             ]
    20         }
    21     ]
     9    "inputs": {
     10        "Test": [
     11            {
     12                "name": "SetRandomSeed",
     13                "description": "Sets the PRNG seed used by Math.random().",
     14                "queue": "SCRIPT_MEMOIZED",
     15                "members": [
     16                    {
     17                        "name": "randomSeed",
     18                        "type": "uint64_t"
     19                    }
     20                ]
     21            }
     22        ]
     23    }
    2224}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-enum-type-missing-values.json

    r163918 r178714  
    99    },
    1010
    11     "inputs": [
    12         {
    13             "name": "SavedMouseButton",
    14             "description": "Supplies a mouse button enum value.",
    15             "queue": "SCRIPT_MEMOIZED",
    16             "members": [
    17                 { "name": "currentTime", "type": "MouseButton" }
    18             ]
    19         }
    20     ]
     11    "inputs": {
     12        "Test": [
     13            {
     14                "name": "SavedMouseButton",
     15                "description": "Supplies a mouse button enum value.",
     16                "queue": "SCRIPT_MEMOIZED",
     17                "members": [
     18                    { "name": "currentTime", "type": "MouseButton" }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-missing-input-member-name.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 {
    15                     "type": "double"
    16                 }
    17             ]
    18         }
    19     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    {
     16                        "type": "double"
     17                    }
     18                ]
     19            }
     20        ]
     21    }
    2022}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-missing-input-name.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "description": "Supplies the system time to Date.now() and new Date().",
    11             "queue": "SCRIPT_MEMOIZED",
    12             "members": [
    13                 {
    14                     "name": "currentTime",
    15                     "type": "double"
    16                 }
    17             ]
    18         }
    19     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "description": "Supplies the system time to Date.now() and new Date().",
     12                "queue": "SCRIPT_MEMOIZED",
     13                "members": [
     14                    {
     15                        "name": "currentTime",
     16                        "type": "double"
     17                    }
     18                ]
     19            }
     20        ]
     21    }
    2022}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-missing-input-queue.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "members": [
    13                 {
    14                     "name": "currentTime",
    15                     "type": "double"
    16                 }
    17             ]
    18         }
    19     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "members": [
     14                    {
     15                        "name": "currentTime",
     16                        "type": "double"
     17                    }
     18                ]
     19            }
     20        ]
     21    }
    2022}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-missing-type-mode.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 {
    15                     "name": "currentTime",
    16                     "type": "double"
    17                 }
    18             ]
    19         }
    20     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    {
     16                        "name": "currentTime",
     17                        "type": "double"
     18                    }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-missing-type-name.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 {
    15                     "name": "currentTime",
    16                     "type": "double"
    17                 }
    18             ]
    19         }
    20     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    {
     16                        "name": "currentTime",
     17                        "type": "double"
     18                    }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-unknown-input-queue.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "queue": "SCRIPT_MEOIZED",
    13             "members": [
    14                 {
    15                     "name": "currentTime",
    16                     "type": "double"
    17                 }
    18             ]
    19         }
    20     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "queue": "SCRIPT_MEOIZED",
     14                "members": [
     15                    {
     16                        "name": "currentTime",
     17                        "type": "double"
     18                    }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-unknown-member-type.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "SetRandomSeed",
    11             "description": "Sets the PRNG seed used by Math.random().",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 {
    15                     "name": "randomSeed",
    16                     "type": "double"
    17                 }
    18             ]
    19         }
    20     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "SetRandomSeed",
     12                "description": "Sets the PRNG seed used by Math.random().",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    {
     16                        "name": "randomSeed",
     17                        "type": "double"
     18                    }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/fail-on-unknown-type-mode.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "GetCurrentTime",
    11             "description": "Supplies the system time to Date.now() and new Date().",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 {
    15                     "name": "currentTime",
    16                     "type": "double"
    17                 }
    18             ]
    19         }
    20     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "GetCurrentTime",
     12                "description": "Supplies the system time to Date.now() and new Date().",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    {
     16                        "name": "currentTime",
     17                        "type": "double"
     18                    }
     19                ]
     20            }
     21        ]
     22    }
    2123}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enum-encoding-helpers-with-guarded-values.json

    r163918 r178714  
    1515    },
    1616
    17     "inputs": [
    18         {
    19             "name": "SavedMouseButton",
    20             "description": "Supplies a mouse button enum value.",
    21             "queue": "SCRIPT_MEMOIZED",
    22             "members": [
    23                 { "name": "button", "type": "MouseButton" }
    24             ]
    25         }
    26     ]
     17    "inputs": {
     18        "Test": [
     19            {
     20                "name": "SavedMouseButton",
     21                "description": "Supplies a mouse button enum value.",
     22                "queue": "SCRIPT_MEMOIZED",
     23                "members": [
     24                    { "name": "button", "type": "MouseButton" }
     25                ]
     26            }
     27        ]
     28    }
    2729}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enum-encoding-helpers.json

    r174863 r178714  
    11{
    22    "types": {
    3         "JavaScriptCore": [
     3        "Test": [
    44            {
    55                "name": "InputQueue", "mode": "SCALAR",
     
    77                "values": ["EventLoopInput", "LoaderMemoizedData", "ScriptMemoizedData"],
    88                "header": "replay/NondeterministicInput.h"
    9             }
    10         ],
    11         "WebCore": [
     9            },
    1210            {
    1311                "name": "MouseButton", "mode": "SCALAR", "storage": "unsigned",
     
    2624    },
    2725
    28     "inputs": [
    29         {
    30             "name": "SavedMouseButton",
    31             "description": "Supplies a mouse button enum value.",
    32             "queue": "SCRIPT_MEMOIZED",
    33             "members": [
    34                 { "name": "button", "type": "MouseButton" }
    35             ]
    36         }
    37     ]
     26    "inputs": {
     27        "Test": [
     28            {
     29                "name": "SavedMouseButton",
     30                "description": "Supplies a mouse button enum value.",
     31                "queue": "SCRIPT_MEMOIZED",
     32                "members": [
     33                    { "name": "button", "type": "MouseButton" }
     34                ]
     35            }
     36        ]
     37    }
    3838}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enum-with-guard.json

    r169889 r178714  
    88                "name": "PlatformWheelEvent", "mode": "OWNED",
    99                "header": "platform/PlatformWheelEvent.h"
    10             },
     10            }
     11        ],
     12        "Test": [
    1113            {
    12                 "name": "PlatformWheelEventPhase", "mode": "SCALAR", "storage": "uint64_t",
     14                "name": "PlatformWheelPhase", "mode": "SCALAR", "storage": "uint64_t",
    1315                "flags": ["ENUM"],
    1416                "guard": "ENABLE(DUMMY_FEATURE)",
     
    1921    },
    2022
    21     "inputs": [
    22         {
    23             "name": "HandleWheelEvent",
    24             "description": "",
    25             "queue": "EVENT_LOOP",
    26             "members": [
    27                 { "name": "platformEvent", "type": "PlatformWheelEvent" }
    28             ]
    29         }
    30     ]
     23    "inputs": {
     24        "Test": [
     25            {
     26                "name": "HandleWheelEvent",
     27                "description": "",
     28                "queue": "EVENT_LOOP",
     29                "members": [
     30                    { "name": "platformEvent", "type": "PlatformWheelEvent" },
     31                    { "name": "phase", "type": "PlatformWheelPhase" }
     32                ]
     33            }
     34        ]
     35    }
    3136}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enums-with-same-base-name.json

    r171683 r178714  
    1717            }
    1818        ],
    19         "WebCore": [
     19        "Test": [
    2020            {
    2121                "name": "Type", "mode": "SCALAR", "storage": "uint64_t",
     
    3535    },
    3636
    37     "inputs": [
    38         {
    39             "name": "FormCombo",
    40             "description": "Combines an event type and form data type.",
    41             "queue": "SCRIPT_MEMOIZED",
    42             "members": [
    43                 { "name": "eventType1", "type": "PlatformEvent1::Type" },
    44                 { "name": "eventType2", "type": "PlatformEvent2::Type" },
    45                 { "name": "formType1", "type": "FormData1::Type" },
    46                 { "name": "formType2", "type": "FormData2::Type" }
    47             ]
    48         }
    49     ]
     37    "inputs": {
     38        "Test": [
     39            {
     40                "name": "FormCombo",
     41                "description": "Combines an event type and form data type.",
     42                "queue": "SCRIPT_MEMOIZED",
     43                "members": [
     44                    { "name": "eventType1", "type": "PlatformEvent1::Type" },
     45                    { "name": "eventType2", "type": "PlatformEvent2::Type" },
     46                    { "name": "formType1", "type": "FormData1::Type" },
     47                    { "name": "formType2", "type": "FormData2::Type" }
     48                ]
     49            }
     50        ]
     51    }
    5052}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-event-loop-shape-types.json

    r163918 r178714  
    88    },
    99
    10     "inputs": [
    11         {
    12             "name": "ScalarInput",
    13             "description": "",
    14             "queue": "EVENT_LOOP",
    15             "members": [
    16                 { "name": "data", "type": "ScalarType" }
    17             ]
    18         },
    19         {
    20             "name": "MapInput",
    21             "description": "",
    22             "queue": "EVENT_LOOP",
    23             "members": [
    24                 { "name": "data", "type": "MapType" }
    25             ]
    26         },
    27         {
    28             "name": "SharedMapInput",
    29             "description": "",
    30             "queue": "EVENT_LOOP",
    31             "members": [
    32                 { "name": "data", "type": "SharedMapType" }
    33             ]
    34         }
    35     ]
     10    "inputs": {
     11        "Test": [
     12            {
     13                "name": "ScalarInput",
     14                "description": "",
     15                "queue": "EVENT_LOOP",
     16                "members": [
     17                    { "name": "data", "type": "ScalarType" }
     18                ]
     19            },
     20            {
     21                "name": "MapInput",
     22                "description": "",
     23                "queue": "EVENT_LOOP",
     24                "members": [
     25                    { "name": "data", "type": "MapType" }
     26                ]
     27            },
     28            {
     29                "name": "SharedMapInput",
     30                "description": "",
     31                "queue": "EVENT_LOOP",
     32                "members": [
     33                    { "name": "data", "type": "SharedMapType" }
     34                ]
     35            }
     36        ]
     37    }
    3638}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-input-with-guard.json

    r163918 r178714  
    77    },
    88
    9     "inputs": [
    10         {
    11             "name": "GetCurrentTime",
    12             "description": "Supplies the system time to Date.now() and new Date().",
    13             "queue": "SCRIPT_MEMOIZED",
    14             "guard": "ENABLE(DUMMY_FEATURE)",
    15             "members": [
    16                 { "name": "currentTime", "type": "double" }
    17             ]
    18         },
    19         {
    20             "name": "SetRandomSeed",
    21             "description": "Sets the PRNG seed used by Math.random().",
    22             "queue": "SCRIPT_MEMOIZED",
    23             "members": [
    24                 {"name": "randomSeed", "type": "uint64_t" }
    25             ]
    26         }
    27     ]
     9    "inputs": {
     10        "Test": [
     11            {
     12                "name": "GetCurrentTime",
     13                "description": "Supplies the system time to Date.now() and new Date().",
     14                "queue": "SCRIPT_MEMOIZED",
     15                "guard": "ENABLE(DUMMY_FEATURE)",
     16                "members": [
     17                    { "name": "currentTime", "type": "double" }
     18                ]
     19            },
     20            {
     21                "name": "SetRandomSeed",
     22                "description": "Sets the PRNG seed used by Math.random().",
     23                "queue": "SCRIPT_MEMOIZED",
     24                "members": [
     25                    {"name": "randomSeed", "type": "uint64_t" }
     26                ]
     27            }
     28        ]
     29    }
    2830}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-input-with-vector-members.json

    r171684 r178714  
    1818    },
    1919
    20     "inputs": [
    21         {
    22             "name": "ArrayOfThings",
    23             "description": "Supplies arrays of things.",
    24             "queue": "SCRIPT_MEMOIZED",
    25             "members": [
    26                 { "name": "doubles", "type": "double", "flags": ["VECTOR"] },
    27                 { "name": "jsthings", "type": "JSThing", "flags": ["VECTOR"] },
    28                 { "name": "webthings", "type": "WebThing", "flags": ["VECTOR"] }
    29             ]
    30         },
    31         {
    32             "name": "SavedHistory",
    33             "description": "Save history items.",
    34             "queue": "SCRIPT_MEMOIZED",
    35             "members": [
    36                 { "name": "entries", "type": "HistoryItem", "flags": ["VECTOR"] }
    37             ]
    38         }
    39     ]
     20    "inputs": {
     21        "Test": [
     22            {
     23                "name": "ArrayOfThings",
     24                "description": "Supplies arrays of things.",
     25                "queue": "SCRIPT_MEMOIZED",
     26                "members": [
     27                    { "name": "doubles", "type": "double", "flags": ["VECTOR"] },
     28                    { "name": "jsthings", "type": "JSThing", "flags": ["VECTOR"] },
     29                    { "name": "webthings", "type": "WebThing", "flags": ["VECTOR"] }
     30                ]
     31            },
     32            {
     33                "name": "SavedHistory",
     34                "description": "Save history items.",
     35                "queue": "SCRIPT_MEMOIZED",
     36                "members": [
     37                    { "name": "entries", "type": "HistoryItem", "flags": ["VECTOR"] }
     38                ]
     39            }
     40        ]
     41    }
    4042}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-inputs-with-flags.json

    r163918 r178714  
    66    },
    77
    8     "inputs": [
    9         {
    10             "name": "ScalarInput1",
    11             "description": "",
    12             "queue": "SCRIPT_MEMOIZED",
    13             "members": [
    14                 { "name": "data", "type": "ScalarType" }
    15             ]
    16         },
    17         {
    18             "name": "ScalarInput2",
    19             "description": "",
    20             "queue": "SCRIPT_MEMOIZED",
    21             "flags": ["CREATE_FROM_PAGE"],
    22             "members": [
    23                 { "name": "data", "type": "ScalarType" }
    24             ]
    25         }
    26     ]
     8    "inputs": {
     9        "Test": [
     10            {
     11                "name": "ScalarInput1",
     12                "description": "",
     13                "queue": "SCRIPT_MEMOIZED",
     14                "members": [
     15                    { "name": "data", "type": "ScalarType" }
     16                ]
     17            },
     18            {
     19                "name": "ScalarInput2",
     20                "description": "",
     21                "queue": "SCRIPT_MEMOIZED",
     22                "flags": ["CREATE_FROM_PAGE"],
     23                "members": [
     24                    { "name": "data", "type": "ScalarType" }
     25                ]
     26            }
     27        ]
     28    }
    2729}
  • trunk/Source/JavaScriptCore/replay/scripts/tests/generate-memoized-type-modes.json

    r163918 r178714  
    77    },
    88
    9     "inputs": [
    10         {
    11             "name": "ScalarInput",
    12             "description": "",
    13             "queue": "SCRIPT_MEMOIZED",
    14             "members": [
    15                 { "name": "data", "type": "ScalarType" }
    16             ]
    17         },
    18         {
    19             "name": "MapInput",
    20             "description": "",
    21             "queue": "SCRIPT_MEMOIZED",
    22             "members": [
    23                 { "name": "data", "type": "MapType" }
    24             ]
    25         }
    26     ]
     9    "inputs": {
     10        "Test": [
     11            {
     12                "name": "ScalarInput",
     13                "description": "",
     14                "queue": "SCRIPT_MEMOIZED",
     15                "members": [
     16                    { "name": "data", "type": "ScalarType" }
     17                ]
     18            },
     19            {
     20                "name": "MapInput",
     21                "description": "",
     22                "queue": "SCRIPT_MEMOIZED",
     23                "members": [
     24                    { "name": "data", "type": "MapType" }
     25                ]
     26            }
     27        ]
     28    }
    2729}
  • trunk/Source/WebCore/ChangeLog

    r178712 r178714  
     12015-01-19  Brian J. Burg  <burg@cs.washington.edu>
     2
     3        Web Replay: code generator should take supplemental specifications and allow cross-framework references
     4        https://bugs.webkit.org/show_bug.cgi?id=136312
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Changes covered by existing input generator tests.
     9
     10        * DerivedSources.make: Add JSInputs.json as supplemental specification.
     11        * replay/WebInputs.json: Moved common types to JSInputs.json.
     12
    1132015-01-20  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/Source/WebCore/DerivedSources.make

    r178674 r178714  
    11631163INPUT_GENERATOR_SPECIFICATIONS = \
    11641164        $(WebCore)/replay/WebInputs.json \
     1165        $(WebReplayScripts)/JSInputs.json \
    11651166#
    11661167
  • trunk/Source/WebCore/replay/WebInputs.json

    r173034 r178714  
    11{
    22    "types": {
    3         "Global": [
    4             { "name": "bool", "mode": "SCALAR" },
    5             { "name": "double", "mode": "SCALAR" },
    6             { "name": "uint32_t", "mode": "SCALAR", "description": "Unsigned 32-bit integer." },
    7             { "name": "uint64_t", "mode": "SCALAR", "description": "Unsigned 64-bit integer." },
    8             { "name": "int32_t", "mode": "SCALAR", "description": "Signed 32-bit integer." },
    9             { "name": "int64_t", "mode": "SCALAR", "description": "Signed 64-bit integer." }
    10         ],
    11 
    12         "WTF": [
    13             {
    14                 "name": "String", "mode": "HEAVY_SCALAR",
    15                 "header": "wtf/text/WTFString.h"
    16             }
    17         ],
    18 
    19         "JavaScriptCore": [
    20             {
    21                 "name": "InputQueue", "mode": "SCALAR", "storage": "uint8_t",
    22                 "flags": ["ENUM_CLASS"],
    23                 "values": ["EventLoopInput", "LoaderMemoizedData", "ScriptMemoizedData", "Count"],
    24                 "header": "replay/NondeterministicInput.h"
    25             }
    26         ],
    27 
    283        "WebCore": [
    294            {
     
    158133    },
    159134
    160     "inputs": [
    161         {
    162             "name": "BeginSegmentSentinel",
    163             "description": "A sentinel input to signal the start of a segment.",
    164             "queue": "EVENT_LOOP",
    165             "members": [ ]
    166         },
    167         {
    168             "name": "DocumentLastModifiedDate",
    169             "description": "A fallback value used for the document's last modified date if the Last-Modified header can't be found or used.",
    170             "queue": "SCRIPT_MEMOIZED",
    171             "members": [
    172                 { "name": "fallbackValue", "type": "double" }
    173             ]
    174         },
    175         {
    176             "name": "EndSegmentSentinel",
    177             "description": "A sentinel input to signal the end of a segment.",
    178             "queue": "EVENT_LOOP",
    179             "members": [ ]
    180         },
    181         {
    182             "name": "HandleMouseMove",
    183             "description": "The embedder signalled a mouse move event.",
    184             "queue": "EVENT_LOOP",
    185             "members": [
    186                 { "name": "platformEvent", "type": "PlatformMouseEvent" },
    187                 { "name": "scrollbarTargeted", "type": "bool" }
    188             ]
    189         },
    190         {
    191             "name": "HandleMousePress",
    192             "description": "The embedder signalled a mouse press event.",
    193             "queue": "EVENT_LOOP",
    194             "members": [
    195                 { "name": "platformEvent", "type": "PlatformMouseEvent" }
    196             ]
    197         },
    198         {
    199             "name": "HandleMouseRelease",
    200             "description": "The embedder signalled a mouse release event.",
    201             "queue": "EVENT_LOOP",
    202             "members": [
    203                 { "name": "platformEvent", "type": "PlatformMouseEvent" }
    204             ]
    205         },
    206         {
    207             "name": "HandleKeyPress",
    208             "description": "The embedder signalled a key press event.",
    209             "queue": "EVENT_LOOP",
    210             "members": [
    211                 { "name": "platformEvent", "type": "PlatformKeyboardEvent" }
    212             ]
    213         },
    214         {
    215             "name": "HandleWheelEvent",
    216             "description": "The embedder signalled a mouse wheel event.",
    217             "queue": "EVENT_LOOP",
    218             "members": [
    219                 { "name": "platformEvent", "type": "PlatformWheelEvent" }
    220             ]
    221         },
    222         {
    223             "name": "InitialNavigation",
    224             "description": "Initiate the initial main frame navigation.",
    225             "queue": "EVENT_LOOP",
    226             "flags": ["HIDDEN", "CREATE_FROM_PAGE"],
    227             "members": [
    228                 { "name": "securityOrigin", "type": "SecurityOrigin" },
    229                 { "name": "url", "type": "URL" },
    230                 { "name": "referrer", "type": "String" }
    231             ]
    232         },
    233         {
    234             "name": "FetchPluginData",
    235             "description": "Plugin data was requested through DOMPluginArray or DOMMimeTypeArray.",
    236             "queue": "SCRIPT_MEMOIZED",
    237             "members": [
    238                 { "name": "pluginData", "type": "PluginData" }
    239             ]
    240         },
    241         {
    242             "name": "LogicalScrollPage",
    243             "description": "The embedder signalled a logical scroll event.",
    244             "queue": "EVENT_LOOP",
    245             "members": [
    246                 { "name": "direction", "type": "ScrollLogicalDirection" },
    247                 { "name": "granularity", "type": "ScrollGranularity" }
    248             ]
    249         },
    250         {
    251             "name": "ScrollPage",
    252             "description": "The embedder signalled a scroll event.",
    253             "queue": "EVENT_LOOP",
    254             "members": [
    255                 { "name": "direction", "type": "ScrollDirection" },
    256                 { "name": "granularity", "type": "ScrollGranularity" }
    257             ]
    258         }
    259     ]
     135    "inputs": {
     136        "WebCore": [
     137            {
     138                "name": "BeginSegmentSentinel",
     139                "description": "A sentinel input to signal the start of a segment.",
     140                "queue": "EVENT_LOOP",
     141                "members": [ ]
     142            },
     143            {
     144                "name": "DocumentLastModifiedDate",
     145                "description": "A fallback value used for the document's last modified date if the Last-Modified header can't be found or used.",
     146                "queue": "SCRIPT_MEMOIZED",
     147                "members": [
     148                    { "name": "fallbackValue", "type": "double" }
     149                ]
     150            },
     151            {
     152                "name": "EndSegmentSentinel",
     153                "description": "A sentinel input to signal the end of a segment.",
     154                "queue": "EVENT_LOOP",
     155                "members": [ ]
     156            },
     157            {
     158                "name": "HandleMouseMove",
     159                "description": "The embedder signalled a mouse move event.",
     160                "queue": "EVENT_LOOP",
     161                "members": [
     162                    { "name": "platformEvent", "type": "PlatformMouseEvent" },
     163                    { "name": "scrollbarTargeted", "type": "bool" }
     164                ]
     165            },
     166            {
     167                "name": "HandleMousePress",
     168                "description": "The embedder signalled a mouse press event.",
     169                "queue": "EVENT_LOOP",
     170                "members": [
     171                    { "name": "platformEvent", "type": "PlatformMouseEvent" }
     172                ]
     173            },
     174            {
     175                "name": "HandleMouseRelease",
     176                "description": "The embedder signalled a mouse release event.",
     177                "queue": "EVENT_LOOP",
     178                "members": [
     179                    { "name": "platformEvent", "type": "PlatformMouseEvent" }
     180                ]
     181            },
     182            {
     183                "name": "HandleKeyPress",
     184                "description": "The embedder signalled a key press event.",
     185                "queue": "EVENT_LOOP",
     186                "members": [
     187                    { "name": "platformEvent", "type": "PlatformKeyboardEvent" }
     188                ]
     189            },
     190            {
     191                "name": "HandleWheelEvent",
     192                "description": "The embedder signalled a mouse wheel event.",
     193                "queue": "EVENT_LOOP",
     194                "members": [
     195                    { "name": "platformEvent", "type": "PlatformWheelEvent" }
     196                ]
     197            },
     198            {
     199                "name": "InitialNavigation",
     200                "description": "Initiate the initial main frame navigation.",
     201                "queue": "EVENT_LOOP",
     202                "flags": ["HIDDEN", "CREATE_FROM_PAGE"],
     203                "members": [
     204                    { "name": "securityOrigin", "type": "SecurityOrigin" },
     205                    { "name": "url", "type": "URL" },
     206                    { "name": "referrer", "type": "String" }
     207                ]
     208            },
     209            {
     210                "name": "FetchPluginData",
     211                "description": "Plugin data was requested through DOMPluginArray or DOMMimeTypeArray.",
     212                "queue": "SCRIPT_MEMOIZED",
     213                "members": [
     214                    { "name": "pluginData", "type": "PluginData" }
     215                ]
     216            },
     217            {
     218                "name": "LogicalScrollPage",
     219                "description": "The embedder signalled a logical scroll event.",
     220                "queue": "EVENT_LOOP",
     221                "members": [
     222                    { "name": "direction", "type": "ScrollLogicalDirection" },
     223                    { "name": "granularity", "type": "ScrollGranularity" }
     224                ]
     225            },
     226            {
     227                "name": "ScrollPage",
     228                "description": "The embedder signalled a scroll event.",
     229                "queue": "EVENT_LOOP",
     230                "members": [
     231                    { "name": "direction", "type": "ScrollDirection" },
     232                    { "name": "granularity", "type": "ScrollGranularity" }
     233                ]
     234            }
     235        ]
     236    }
    260237}
Note: See TracChangeset for help on using the changeset viewer.