Changeset 240318 in webkit
- Timestamp:
- Jan 22, 2019 8:17:06 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 33 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240314 r240318 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: expose Audit and Recording versions to the frontend 4 https://bugs.webkit.org/show_bug.cgi?id=193262 5 <rdar://problem/47130684> 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/audit/version.html: Added. 10 * inspector/audit/version-expected.txt: Added. 11 * inspector/recording/version.html: Added. 12 * inspector/recording/version-expected.txt: Added. 13 1 14 2019-01-22 Nikita Vasilyev <nvasilyev@apple.com> 2 15 -
trunk/Source/JavaScriptCore/ChangeLog
r240273 r240318 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: expose Audit and Recording versions to the frontend 4 https://bugs.webkit.org/show_bug.cgi?id=193262 5 <rdar://problem/47130684> 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/protocol/Audit.json: 10 * inspector/protocol/Recording.json: 11 Add `version` values. 12 13 * inspector/scripts/codegen/models.py: 14 (Protocol.parse_domain): 15 (Domain.__init__): 16 (Domain.version): Added. 17 (Domains): 18 19 * inspector/scripts/codegen/generator.py: 20 (Generator.version_for_domain): Added. 21 22 * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: 23 (CppProtocolTypesHeaderGenerator.generate_output): 24 (CppProtocolTypesHeaderGenerator._generate_versions): Added. 25 26 * inspector/scripts/codegen/generate_js_backend_commands.py: 27 (JSBackendCommandsGenerator.should_generate_domain): 28 (JSBackendCommandsGenerator.generate_domain): 29 30 * inspector/scripts/tests/generic/version.json: Added. 31 * inspector/scripts/tests/generic/expected/version.json-result: Added. 32 33 * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: 34 * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: 35 * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: 36 * inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result: 37 * inspector/scripts/tests/generic/expected/domain-availability.json-result: 38 * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: 39 * inspector/scripts/tests/generic/expected/enum-values.json-result: 40 * inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result: 41 * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: 42 * inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result: 43 * inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result: 44 * inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result: 45 * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result: 46 * inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result: 47 * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result: 48 * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: 49 * inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result: 50 * inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result: 51 * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: 52 1 53 2019-01-22 Yusuke Suzuki <ysuzuki@apple.com> 2 54 -
trunk/Source/JavaScriptCore/inspector/protocol/Audit.json
r239976 r240318 2 2 "domain": "Audit", 3 3 "description": "", 4 "version": 1, 4 5 "commands": [ 5 6 { -
trunk/Source/JavaScriptCore/inspector/protocol/Recording.json
r237997 r240318 3 3 "description": "General types used for recordings of actions performed in the inspected page.", 4 4 "availability": ["web"], 5 "version": 1, 5 6 "types": [ 6 7 { -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
r239427 r240318 66 66 sections.append(Template(CppTemplates.HeaderPrelude).substitute(None, **header_args)) 67 67 sections.append('namespace Protocol {') 68 sections.append(self._generate_versions(domains)) 68 69 sections.append(self._generate_forward_declarations(domains)) 69 70 sections.append(self._generate_typedefs(domains)) … … 89 90 90 91 return '\n'.join(self.generate_includes_from_entries(header_includes)) 92 93 def _generate_versions(self, domains): 94 sections = [] 95 96 for domain in domains: 97 version = self.version_for_domain(domain) 98 if not version: 99 continue 100 101 domain_lines = [] 102 domain_lines.append('namespace %s {' % domain.domain_name) 103 104 if isinstance(version, int): 105 domain_lines.append('static const unsigned VERSION = %s;' % version) 106 107 domain_lines.append('} // %s' % domain.domain_name) 108 sections.append(self.wrap_with_guard_for_domain(domain, '\n'.join(domain_lines))) 109 110 if len(sections) == 0: 111 return '' 112 113 return """// Versions. 114 %s 115 // End of versions. 116 """ % '\n\n'.join(sections) 91 117 92 118 def _generate_forward_declarations(self, domains): -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py
r237997 r240318 53 53 type_declarations = self.type_declarations_for_domain(domain) 54 54 domain_enum_types = [declaration for declaration in type_declarations if isinstance(declaration.type, EnumType)] 55 return len(self.commands_for_domain(domain)) > 0 or len(self.events_for_domain(domain)) > 0 or len(domain_enum_types) > 055 return self.version_for_domain(domain) is not None or len(self.commands_for_domain(domain)) > 0 or len(self.events_for_domain(domain)) > 0 or len(domain_enum_types) > 0 56 56 57 57 def domains_to_generate(self): … … 72 72 lines.append('// %(domain)s.' % args) 73 73 74 version = self.version_for_domain(domain) 74 75 type_declarations = self.type_declarations_for_domain(domain) 75 76 commands = self.commands_for_domain(domain) … … 79 80 if len(events) > 0 or has_async_commands: 80 81 lines.append('InspectorBackend.register%(domain)sDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "%(domain)s");' % args) 82 83 if isinstance(version, int): 84 version_args = { 85 'domain': domain.domain_name, 86 'version': version 87 } 88 lines.append('InspectorBackend.registerVersion("%(domain)s", %(version)s);' % version_args) 81 89 82 90 for declaration in type_declarations: -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py
r238192 r240318 109 109 return model_platform is Platforms.Generic or self._platform is Platforms.All or model_platform is self._platform 110 110 111 def version_for_domain(self, domain): 112 return domain.version() 113 111 114 def type_declarations_for_domain(self, domain): 112 115 return [type_declaration for type_declaration in domain.all_type_declarations() if self.can_generate_platform(type_declaration.platform)] -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/models.py
r237997 r240318 369 369 log.debug("parse domain " + json['domain']) 370 370 371 version = None 371 372 types = [] 372 373 commands = [] 373 374 events = [] 375 376 if 'version' in json: 377 if not isinstance(json['version'], int): 378 raise ParseException("Malformed domain specification: version is not a number or string") 379 version = json['version'] 374 380 375 381 if 'types' in json: … … 396 402 raise ParseException('Malformed domain specification: availability is an unsupported string. Was: "%s", Allowed values: %s' % (json['availability'], ', '.join(allowed_activation_strings))) 397 403 398 self.domains.append(Domain(json['domain'], json.get('description', ''), json.get('featureGuard'), json.get('availability'), isSupplemental, types, commands, events))404 self.domains.append(Domain(json['domain'], json.get('description', ''), json.get('featureGuard'), json.get('availability'), isSupplemental, version, types, commands, events)) 399 405 400 406 def parse_type_declaration(self, json): … … 566 572 567 573 class Domain: 568 def __init__(self, domain_name, description, feature_guard, availability, isSupplemental, type_declarations, commands, events):574 def __init__(self, domain_name, description, feature_guard, availability, isSupplemental, version, type_declarations, commands, events): 569 575 self.domain_name = domain_name 570 576 self.description = description … … 572 578 self.availability = availability 573 579 self.is_supplemental = isSupplemental 580 self._version = version 574 581 self._type_declarations = type_declarations 575 582 self._commands = commands 576 583 self._events = events 584 585 def version(self): 586 return self._version 577 587 578 588 def all_type_declarations(self): … … 600 610 601 611 class Domains: 602 GLOBAL = Domain("", "The global domain, in which primitive types are implicitly declared.", None, None, False, [], [], [])612 GLOBAL = Domain("", "The global domain, in which primitive types are implicitly declared.", None, None, False, None, [], [], []) 603 613 604 614 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result
r239427 r240318 410 410 namespace Protocol { 411 411 412 413 412 414 // Forward declarations. 413 415 namespace Network { -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result
r239846 r240318 603 603 604 604 namespace Protocol { 605 606 605 607 606 608 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result
r239839 r240318 518 518 519 519 namespace Protocol { 520 521 520 522 521 523 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result
r239427 r240318 477 477 478 478 479 480 479 481 } // namespace Protocol 480 482 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result
r239427 r240318 635 635 636 636 637 638 637 639 // Typedefs. 638 640 namespace Network2 { -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result
r239427 r240318 438 438 namespace Protocol { 439 439 440 441 440 442 // Forward declarations. 441 443 namespace TypeDomain { -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result
r239427 r240318 375 375 376 376 namespace Protocol { 377 378 377 379 378 380 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result
r239427 r240318 429 429 namespace Protocol { 430 430 431 432 431 433 // Forward declarations. 432 434 #if PLATFORM(WEB_TYPES) -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result
r239427 r240318 317 317 318 318 namespace Protocol { 319 320 319 321 320 322 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result
r239427 r240318 318 318 319 319 namespace Protocol { 320 321 320 322 321 323 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
r239427 r240318 319 319 320 320 namespace Protocol { 321 322 321 323 322 324 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
r239427 r240318 318 318 319 319 namespace Protocol { 320 321 320 322 321 323 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 // Forward declarations. -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/version.json-result
r240317 r240318 27 27 */ 28 28 29 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json 30 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 29 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 30 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 31 32 // VersionDomain. 33 InspectorBackend.registerVersion("VersionDomain", 42); 34 InspectorBackend.activateDomain("VersionDomain"); 31 35 ### End File: InspectorBackendCommands.js 32 36 … … 59 63 */ 60 64 61 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json65 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 62 66 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 63 67 … … 116 120 */ 117 121 118 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json122 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 119 123 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 120 124 … … 162 166 */ 163 167 164 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json168 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 165 169 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 166 170 … … 213 217 */ 214 218 215 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json219 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 216 220 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 217 221 … … 257 261 */ 258 262 259 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json263 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 260 264 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 261 265 … … 300 304 */ 301 305 302 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json306 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 303 307 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 304 308 … … 314 318 namespace Protocol { 315 319 320 // Versions. 321 namespace VersionDomain { 322 static const unsigned VERSION = 42; 323 } // VersionDomain 324 // End of versions. 325 326 316 327 317 328 … … 353 364 */ 354 365 355 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json366 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 356 367 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 357 368 … … 402 413 */ 403 414 404 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json415 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 405 416 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 406 417 … … 445 456 */ 446 457 447 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json458 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 448 459 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 449 460 … … 489 500 */ 490 501 491 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json502 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 492 503 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 493 504 … … 529 540 */ 530 541 531 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json542 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 532 543 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 533 544 … … 596 607 */ 597 608 598 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json609 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 599 610 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 600 611 … … 637 648 */ 638 649 639 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json650 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 640 651 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 641 652 … … 693 704 */ 694 705 695 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json706 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 696 707 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 697 708 … … 734 745 */ 735 746 736 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json747 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 737 748 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 738 749 … … 805 816 */ 806 817 807 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json818 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 808 819 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 809 820 … … 851 862 */ 852 863 853 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json864 // DO NOT EDIT THIS FILE. It is automatically generated from version.json 854 865 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py 855 866 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result
r239427 r240318 313 313 314 314 namespace Protocol { 315 316 315 317 316 318 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result
r239427 r240318 410 410 namespace Protocol { 411 411 412 413 412 414 // Forward declarations. 413 415 namespace Network { -
trunk/Source/WebCore/ChangeLog
r240315 r240318 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: expose Audit and Recording versions to the frontend 4 https://bugs.webkit.org/show_bug.cgi?id=193262 5 <rdar://problem/47130684> 6 7 Reviewed by Joseph Pecoraro. 8 9 Tests: inspector/audit/version.html 10 inspector/recording/version.html 11 12 * inspector/agents/InspectorCanvasAgent.cpp: 13 (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): 14 1 15 2019-01-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 16 -
trunk/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
r239535 r240318 559 559 560 560 auto recording = Inspector::Protocol::Recording::Recording::create() 561 .setVersion( 1)561 .setVersion(Inspector::Protocol::Recording::VERSION) 562 562 .setType(type) 563 563 .setInitialState(inspectorCanvas->releaseInitialState()) -
trunk/Source/WebInspectorUI/ChangeLog
r240314 r240318 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: expose Audit and Recording versions to the frontend 4 https://bugs.webkit.org/show_bug.cgi?id=193262 5 <rdar://problem/47130684> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Protocol/InspectorBackend.js: 10 (InspectorBackendClass.prototype.registerVersion): Added. 11 12 * UserInterface/Models/AuditTestCase.js: 13 * UserInterface/Models/Recording.js: 14 (WI.Recording.fromPayload): 15 Add Interface version values. 16 1 17 2019-01-22 Nikita Vasilyev <nvasilyev@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js
r239976 r240318 280 280 }; 281 281 282 // Keep this in sync with Inspector::Protocol::Audit::VERSION. 283 WI.AuditTestCase.Version = 1; 284 282 285 WI.AuditTestCase.TypeIdentifier = "test-case"; -
trunk/Source/WebInspectorUI/UserInterface/Models/Recording.js
r238199 r240318 52 52 return null; 53 53 54 if (isNaN(payload.version) || payload.version <= 0 )54 if (isNaN(payload.version) || payload.version <= 0 || payload.version > WI.Recording.Version) 55 55 return null; 56 56 … … 473 473 }; 474 474 475 // Keep this in sync with Inspector::Protocol::Recording::VERSION. 476 WI.Recording.Version = 1; 477 475 478 WI.Recording.Event = { 476 479 ProcessedAction: "recording-processed-action", -
trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js
r238750 r240318 141 141 } 142 142 143 registerVersion(domainName, version) 144 { 145 let agent = this._agentForDomain(domainName); 146 agent.VERSION = version; 147 } 148 143 149 registerCommand(qualifiedName, callSignature, replySignature) 144 150 {
Note: See TracChangeset
for help on using the changeset viewer.