Summary: | Web Inspector: make ObjC protocol dispatcher commands optional and add `respondsToSelector` checks to allow other inspector clients to choose what they implement | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||
Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bburg, commit-queue, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | 200384 | ||||||
Bug Blocks: | 203300 | ||||||
Attachments: |
|
Description
Devin Rousso
2019-10-21 11:00:06 PDT
Created attachment 381438 [details]
Patch
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`) Comment on attachment 381438 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381438&action=review r=me! > Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:110 > + def _generate_responds_to_selector_for_command(self, domain, command): > + return '[m_delegate respondsToSelector:@selector(%sWithErrorCallback:successCallback:%s)]' % (command.command_name, ''.join(map(lambda parameter: '%s:' % parameter.parameter_name, command.call_parameters))) You can probably just simplify this to join parameters with a colon, and add the trailing colon to the respondsToSelector part of the format string. Comment on attachment 381438 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381438&action=review >> Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:110 >> + return '[m_delegate respondsToSelector:@selector(%sWithErrorCallback:successCallback:%s)]' % (command.command_name, ''.join(map(lambda parameter: '%s:' % parameter.parameter_name, command.call_parameters))) > > You can probably just simplify this to join parameters with a colon, and add the trailing colon to the respondsToSelector part of the format string. As we just discussed, we actually don't want to do that because if `command.call_parameters` is empty, we don't want a second trailing colon. Comment on attachment 381438 [details]
Patch
r=me !!
Comment on attachment 381438 [details] Patch Clearing flags on attachment: 381438 Committed r251395: <https://trac.webkit.org/changeset/251395> All reviewed patches have been landed. Closing bug. |