RESOLVED INVALID 104339
Make it possible to use other types as well as class and struct as an argument of messages.
https://bugs.webkit.org/show_bug.cgi?id=104339
Summary Make it possible to use other types as well as class and struct as an argumen...
Dongseong Hwang
Reported 2012-12-06 21:29:55 PST
This patch changes forward_declarations_and_headers function to include headers for types in special_cases set, not to make forward declarations. We can use typedef as an argument now. It means we can use RefPtr as an argument if we define typedef from RefPtr. This patch applies this special handling to CoordinatedLayerID and CoordinatedImageBackingID.
Attachments
Patch (6.21 KB, patch)
2012-12-06 21:31 PST, Dongseong Hwang
andersca: review-
andersca: commit-queue-
Dongseong Hwang
Comment 1 2012-12-06 21:31:20 PST
Darin Adler
Comment 2 2012-12-06 21:44:41 PST
Anders, as the creator and architect of the WebKit2 message system, is this the direction you’d like to go with this?
Dongseong Hwang
Comment 3 2012-12-06 21:49:35 PST
I make this change to use RefPtr as an argument. You can see the example in https://bugs.webkit.org/attachment.cgi?id=177979&action=review I want this change to match your direction :)
Anders Carlsson
Comment 4 2012-12-07 09:44:58 PST
(In reply to comment #2) > Anders, as the creator and architect of the WebKit2 message system, is this the direction you’d like to go with this? No. I think that we shouldn't use typedefs in .message.in files, because they can hide the real size of the underlying data. (This is why we always use explicitly sized types as message parameters). In addition, I'd also like to completely get rid of hard-coded types in the message generator by extending the syntax where possible.
Dongseong Hwang
Comment 5 2012-12-07 19:16:11 PST
(In reply to comment #4) > (In reply to comment #2) > > Anders, as the creator and architect of the WebKit2 message system, is this the direction you’d like to go with this? > > No. I think that we shouldn't use typedefs in .message.in files, because they can hide the real size of the underlying data. (This is why we always use explicitly sized types as message parameters). I don't understand what you mean. We can not know the real size from forward declaration too, and to know the real size we should include headers. The problem I had is the c++ does not support forward declaration of typedef. btw, I agree that only POD struct is natural to use it as an argument of messages, but current default argument is class, not struct. And I agree that you don't want each class to change messages.py > In addition, I'd also like to completely get rid of hard-coded types in the message generator by extending the syntax where possible. Currently, there are three special case including headers. 1. in the case that type name does not match to header name. for example, class FooRef in Foo.h 2. in the case that type is struct, as mentioned. 3. nested class. Do you mean that all classes, which we want to use an argument of messages, must be in the same header, and the type must be class? although we must create a redundant class to wrap the type that we want to use an argument. If yes, I'll give up.
Note You need to log in before you can comment on or make changes to this bug.