Changes

Jump to: navigation, search

IPC Protocols

1,629 bytes added, 11:25, 15 May 2009
Implementation
== Implementation ==
 
The transport layer should hopefully be mainly chromium IPC code. We will likely need to extend this to support objects sent through shared memory, if that feature is desired.
 
The PDL compiler will take as input a FooProtocol.pdl source and generate FooProtocolServer.h and FooProtocolClient.h C++ headers. These headers will declare message types for the transport layer, declare protocol states, and define functions that take care of state transitions and invoke message handlers. The headers will leave undefined the ''implementations'' of message handlers; these are up to mozilla code to provide. (Perhaps through subclassing.)
 
Message handlers will be responsible for processing the received message (obviously) and also deciding which of the allowed states is transitioned to after processing. The generated protocol header will enforce protocol safety here. Lower-level enforcement of transport-layer properties, like not nesting asynchronous calls within synchronous handlers, can be enforced in a shared ProtocolBase class. '''TODO''': should these kinds of properties be global, or defined in protocol specs? What are all these properties? Deadlock avoidance is another, if we provide synchronous messages.
 
Very importantly, there will be an implicitly-defined ERROR state that occurs when an actor violates the protocol (or a type safety constraint). How this is handled is very much open to discussion.
 
'''NOTE''': I think it's worthwhile leaving error detection on even in optimized builds. It should be quite cheap compared to IPC overhead and will likely allow us to avoid security-related bugs.
Confirm
699
edits

Navigation menu