RESOLVED FIXED 46654
Add support for autogenerating synchronous message handlers
https://bugs.webkit.org/show_bug.cgi?id=46654
Summary Add support for autogenerating synchronous message handlers
Anders Carlsson
Reported 2010-09-27 14:33:33 PDT
Add support for autogenerating synchronous message handlers
Attachments
Patch (10.47 KB, patch)
2010-09-27 14:52 PDT, Anders Carlsson
aroben: review+
Anders Carlsson
Comment 1 2010-09-27 14:52:37 PDT
Adam Roben (:aroben)
Comment 2 2010-09-27 14:59:39 PDT
Comment on attachment 68964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=68964&action=review > WebKit2/Scripts/webkit2/messages.py:384 > + if async_messages: > + result.append('void %s::didReceive%sMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)\n' % (receiver.name, receiver.name)) > + result.append('{\n') > + result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name) > + result += [async_case_statement(receiver, message) for message in async_messages] > + result.append(' default:\n') > + result.append(' break;\n') > + result.append(' }\n\n') > + result.append(' ASSERT_NOT_REACHED();\n') > + result.append('}\n') > + > + if sync_messages: > + result.append('\n') > + result.append('CoreIPC::SyncReplyMode %s::didReceiveSync%sMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)\n' % (receiver.name, receiver.name)) > + result.append('{\n') > + result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name) > + result += [sync_case_statement(receiver, message) for message in sync_messages] > + result.append(' default:\n') > + result.append(' break;\n') > + result.append(' }\n\n') > + result.append(' ASSERT_NOT_REACHED();\n') > + result.append(' return CoreIPC::AutomaticReply;\n') > + result.append('}\n') It would be nice not to duplicate so much code.
Anders Carlsson
Comment 3 2010-09-27 15:03:54 PDT
Note You need to log in before you can comment on or make changes to this bug.