--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
This may break a couple of valgrind's suppressions. It'd be nice if you can run valgrind trybots before you check in,or please let valgrind sheriff know when you check it in.Thanks,- oshimaOn Fri, Dec 3, 2010 at 5:28 PM, John Abd-El-Malek <j...@chromium.org> wrote:
I'm splitting off all the classes in ResourceMessageFilter that filter messages, so that they're all separate message filters. This will hopefully make RMF more maintainable, and make it easier to add new filters. I wanted to give a heads-up to code reviewers, and a hint to future filter writers, regarding naming:If a filter in the browser process has a corresponding object in the renderer process, then it should be called FeatureXDispatcherHost. The object in the renderer is FeatureXDispatcher. This is consistent with ResourceDispatcherHost/ResourceDispatcher, and a variety of other classes.If a filter has no corresponding object in the renderer, then it's not a "Host" of anything, and should just be named FeatureXMessageFilter.After that I will work on making filters work on threads other than UI,
I'm splitting off all the classes in ResourceMessageFilter that filter messages, so that they're all separate message filters. This will hopefully make RMF more maintainable, and make it easier to add new filters.
I wanted to give a heads-up to code reviewers, and a hint to future filter writers, regarding naming:If a filter in the browser process has a corresponding object in the renderer process, then it should be called FeatureXDispatcherHost. The object in the renderer is FeatureXDispatcher. This is consistent with ResourceDispatcherHost/ResourceDispatcher, and a variety of other classes.If a filter has no corresponding object in the renderer, then it's not a "Host" of anything, and should just be named FeatureXMessageFilter.After that I will work on making filters work on threads other than UI, to save the manual work that we currently do for UI, WebKit, FILE threads etc.
On Fri, Dec 3, 2010 at 5:28 PM, John Abd-El-Malek <j...@chromium.org> wrote:I'm splitting off all the classes in ResourceMessageFilter that filter messages, so that they're all separate message filters. This will hopefully make RMF more maintainable, and make it easier to add new filters.Thanks for doing this !I wanted to give a heads-up to code reviewers, and a hint to future filter writers, regarding naming:If a filter in the browser process has a corresponding object in the renderer process, then it should be called FeatureXDispatcherHost. The object in the renderer is FeatureXDispatcher. This is consistent with ResourceDispatcherHost/ResourceDispatcher, and a variety of other classes.If a filter has no corresponding object in the renderer, then it's not a "Host" of anything, and should just be named FeatureXMessageFilter.After that I will work on making filters work on threads other than UI, to save the manual work that we currently do for UI, WebKit, FILE threads etc.For that you may want to look at what I did in http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/renderer_host/pepper_file_message_filter.cc?revision=68069&content-type=text/plainIn that class all the thread hopping is factorized in a single place, because all the messages are meant to be handled on the FILE thread. It works pretty well, aside of the fact that messages need to be listed twice (once for the filtering itself which needs to happen on the IO thread, and once on the FILE thread to dispatch to the handler method). Feel free to suggest a better way.
-using IPC_MESSAGE_HANDLER_DELAY_REPLY and then sending the reply in the handler-IPC_MESSAGE_HANDLER_DELAY_REPLY is meant to be used when the handler won't have the output parameters ready (i.e. because it has to wait for another operation to finish asynchronously). If the result is available though, IPC_MESSAGE_HANDLE should be used directly, which is much more convenient to use.