At the standup it was suggested that we talk over email about our proposals for separating routing ids.
My favorite is to move to 64-bit routing ids and then having lots of space for tag bits. Apparently that's not happening.
My next favorite is to keep a registry. Every valid routing id is "owned" by some object in the browser process. So we have something like:
class RoutingRegistry { // singleton
public:
enum RoutingScope {
kNone = -1,
kRenderFrame,
kRenderView,
// etc
};
scoped_ptr<RoutingRegistration> AllocateRoutingRegistration(RoutingScope scope);
// Gets the scope for the routing_id, or kNone if it is not a valid routing id.
RoutingScope GetRoutingScope(int routing_id);
private:
// routing_id -> routing_scope
map<int, int> active_routes;
};
class RoutingRegistration {
~RoutingRegistration() { // unregister the route in the RoutingRegistry }
}
No cap on the number of scopes, we can wrap safely now (the registry can check for re-use before re-issuing), and we can still keep passing ints around like we do today.
Thoughts?
Avi