Changeset 96320 in webkit
- Timestamp:
- Sep 29, 2011 4:49:53 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r96215 r96320 2205 2205 # All Web Inspector generated files are created with this one call to CodeGeneratorInspector.pm 2206 2206 ADD_CUSTOM_COMMAND( 2207 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json.validated 2208 MAIN_DEPENDENCY inspector/Inspector.json 2209 DEPENDS ${WEBCORE_DIR}/inspector/validate-protocol-compatibility ${WEBCORE_DIR}/inspector/Inspector.json 2210 COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/validate-protocol-compatibility -o ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json.validated ${WEBCORE_DIR}/inspector/Inspector.json 2211 VERBATIM) 2212 2213 ADD_CUSTOM_COMMAND( 2207 2214 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.idl 2208 2215 MAIN_DEPENDENCY inspector/Inspector.json -
trunk/Source/WebCore/ChangeLog
r96319 r96320 1 2011-09-28 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: make inspector protocol validation a part of the build process. 4 https://bugs.webkit.org/show_bug.cgi?id=68999 5 6 Since we'd like to commit to inspector protocol backwards compatibility, violating it 7 should be a build failure. 8 9 Reviewed by Yury Semikhatsky. 10 11 * CMakeLists.txt: 12 * CodeGenerators.pri: 13 * DerivedSources.make: 14 * GNUmakefile.am: 15 * WebCore.gyp/WebCore.gyp: 16 * inspector/Inspector.draft-01.json: 17 * inspector/Inspector.json: 18 * inspector/generate-inspector-idl: 19 * inspector/generate-protocol-externs: 20 * inspector/validate-protocol-compatibility: 21 1 22 2011-09-27 Pavel Feldman <pfeldman@google.com> 2 23 -
trunk/Source/WebCore/CodeGenerators.pri
r95911 r96320 669 669 670 670 # GENERATOR 2: inspector idl compiler 671 inspectorValidate.output = $${WC_GENERATED_SOURCES_DIR}/Inspector.json.validated 672 inspectorValidate.input = INSPECTOR_JSON 673 inspectorValidate.wkScript = $$PWD/inspector/validate-protocol-compatibility 674 inspectorValidate.commands = python $$inspectorValidate.wkScript -o $${WC_GENERATED_SOURCES_DIR}/Inspector.json.validated $$PWD/inspector/Inspector.json 675 inspectorValidate.depends = $$PWD/inspector/validate-protocol-compatibility 676 inspectorValidate.wkAddOutputToSources = false 677 addExtraCompiler(inspectorValidate) 678 671 679 inspectorJSON.output = $${WC_GENERATED_SOURCES_DIR}/Inspector.idl 672 680 inspectorJSON.input = INSPECTOR_JSON -
trunk/Source/WebCore/DerivedSources.make
r96064 r96320 889 889 # Inspector interfaces generator 890 890 891 Inspector.json.validated : Inspector.json inspector/validate-protocol-compatibility 892 python $(WebCore)/inspector/validate-protocol-compatibility -o Inspector.json.validated $(WebCore)/inspector/Inspector.json 893 891 894 Inspector.idl : Inspector.json inspector/generate-inspector-idl 892 895 python $(WebCore)/inspector/generate-inspector-idl -o Inspector.idl $(WebCore)/inspector/Inspector.json -
trunk/Source/WebCore/GNUmakefile.am
r95919 r96320 688 688 689 689 # All Web Inspector generated files are created with this one call to CodeGeneratorInspector.pm 690 DerivedSources/WebCore/Inspector.json.validated : $(WebCore)/inspector/Inspector.json $(WebCore)/inspector/validate-protocol-compatibility 691 $(PYTHON) $(WebCore)/inspector/validate-protocol-compatibility -o $(GENSOURCES_WEBCORE)/Inspector.json.validated $(WebCore)/inspector/Inspector.json 692 690 693 DerivedSources/WebCore/Inspector.idl : $(WebCore)/inspector/Inspector.json $(WebCore)/inspector/generate-inspector-idl 691 694 $(PYTHON) $(WebCore)/inspector/generate-inspector-idl -o $(GENSOURCES_WEBCORE)/Inspector.idl $(WebCore)/inspector/Inspector.json -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r96233 r96320 339 339 'type': 'none', 340 340 'actions': [ 341 { 342 'action_name': 'validateInspectorProtocol', 343 'inputs': [ 344 '../inspector/validate-protocol-compatibility', 345 '../inspector/Inspector.json', 346 ], 347 'outputs': [ 348 '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.json.validated', 349 ], 350 'variables': { 351 'generator_include_dirs': [ 352 ], 353 }, 354 'action': [ 355 'python', 356 '../inspector/validate-protocol-compatibility', 357 '-o', 358 '<@(_outputs)', 359 '<@(_inputs)' 360 ], 361 'message': 'Validate inspector protocol for backwards compatibility', 362 }, 341 363 { 342 364 'action_name': 'generateInspectorProtocolIDL', -
trunk/Source/WebCore/inspector/Inspector.draft-01.json
r96106 r96320 1 [ 2 { 1 { 2 "version": "draft-01", 3 "compatible": [], 4 "domains" : [{ 3 5 "domain": "Inspector", 6 "hidden": true, 4 7 "types": [], 5 8 "commands": [ … … 1246 1249 { 1247 1250 "domain": "CSS", 1251 "hidden": true, 1248 1252 "description": "This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated <code>id</code> used in subsequent operations on the related object. Each object type has a specific <code>id</code> structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the <code>get*ForNode()</code> calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the <code>getAllStyleSheets()</code> method and subsequently load the required stylesheet contents using the <code>getStyleSheet[Text]()</code> methods.", 1249 1253 "types": [ … … 1962 1966 { 1963 1967 "domain": "Worker", 1968 "hidden": true, 1964 1969 "types": [], 1965 1970 "commands": [ … … 2020 2025 } 2021 2026 ] 2022 } 2023 ] 2027 }] 2028 } -
trunk/Source/WebCore/inspector/Inspector.json
r96223 r96320 1 [ 2 { 1 { 2 "version": "tip-of-tree", 3 "compatible": ["draft-01"], 4 "domains": [{ 3 5 "domain": "Inspector", 6 "hidden": true, 4 7 "types": [], 5 8 "commands": [ … … 1212 1215 "parameters": [ 1213 1216 { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node that has changed." }, 1214 { "name": "name", "type": "string", "description": " Local attribute name." }1217 { "name": "name", "type": "string", "description": "A ttribute name." } 1215 1218 ], 1216 1219 "description": "Fired when <code>Element</code>'s attribute is removed." … … 1269 1272 { 1270 1273 "domain": "CSS", 1274 "hidden": true, 1271 1275 "description": "This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated <code>id</code> used in subsequent operations on the related object. Each object type has a specific <code>id</code> structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the <code>get*ForNode()</code> calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the <code>getAllStyleSheets()</code> method and subsequently load the required stylesheet contents using the <code>getStyleSheet[Text]()</code> methods.", 1272 1276 "types": [ … … 1985 1989 { 1986 1990 "domain": "Worker", 1991 "hidden": true, 1987 1992 "types": [], 1988 1993 "commands": [ … … 2043 2048 } 2044 2049 ] 2045 } 2046 ] 2050 }] 2051 } -
trunk/Source/WebCore/inspector/generate-inspector-idl
r95919 r96320 43 43 json_string = json_string.replace(": true", ": True") 44 44 json_string = json_string.replace(": false", ": false") 45 json_api = eval(json_string) 45 json_api = eval(json_string)["domains"] 46 46 47 47 output_file = open(output_path, "w") -
trunk/Source/WebCore/inspector/generate-protocol-externs
r93706 r96320 43 43 json_string = json_string.replace(": true", ": True") 44 44 json_string = json_string.replace(": false", ": false") 45 json_api = eval(json_string) 45 json_api = eval(json_string)["domains"] 46 46 47 47 output_file = open(output_path, "w") -
trunk/Source/WebCore/inspector/validate-protocol-compatibility
r96106 r96320 297 297 for i in range(len(errors)): 298 298 if errors[i] != golden_errors[i]: 299 print "Self-test failed"300 299 return False 301 300 return True … … 303 302 def main(): 304 303 if not self_test(): 305 return 306 307 if len(sys.argv) < 3: 308 print "Usage: %s Inspector.draft-01.json Inspector.json" % sys.argv[0] 309 return 310 311 schema_1 = load_json(sys.argv[1]) 312 schema_2 = load_json(sys.argv[2]) 313 314 errors = compare_schemas(schema_1, schema_2) 315 for error in errors: 316 print error 304 sys.stderr.write("Self-test failed") 305 return 1 306 307 if len(sys.argv) < 4 or sys.argv[1] != "-o": 308 sys.stderr.write("Usage: %s -o OUTPUT_FILE INPUT_FILE\n" % sys.argv[0]) 309 return 1 310 311 output_path = sys.argv[2] 312 output_file = open(output_path, "w") 313 314 input_path = sys.argv[3] 315 dir_name = os.path.dirname(input_path) 316 schema = load_json(input_path) 317 sys.stdout.write("Validating schema: %s\n" % schema["version"]) 318 compatible = schema["compatible"] 319 errors_found = False 320 for version in compatible: 321 schema = load_json(input_path) # reload since modified while comparing 322 version_file_name = os.path.normpath(dir_name + "/Inspector." + version + ".json") 323 version_schema = load_json(version_file_name) 324 errors = compare_schemas(version_schema["domains"], schema["domains"]) 325 if len(errors) > 0: 326 errors_found = True 327 sys.stderr.write(" compatibility with %s: FAILED\n" % version) 328 for error in errors: 329 sys.stderr.write( " %s\n" % error) 330 else: 331 sys.stderr.write(" compatibility with %s: SUCCESS\n" % version) 332 if errors_found: 333 return 1 317 334 318 335 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.