| Summary: | Add a convenience method to unregister remote object. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yongjun Zhang <yongjun_zhang> |
| Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | andersca, mitz, sam |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Yongjun Zhang
2014-01-20 13:36:43 PST
What if the same object is registered for multiple interfaces? FWIW, I do think this API is cumbersome because it requires the caller to pass a WKRemoteObjectInterface, which it typically gets from +remoteObjectInterfaceWithProtocol:. I wonder if there can be methods that take a Protocol instead of a WKRemoteObjectInterface. (In reply to comment #2) > FWIW, I do think this API is cumbersome because it requires the caller to pass a WKRemoteObjectInterface, which it typically gets from +remoteObjectInterfaceWithProtocol:. I wonder if there can be methods that take a Protocol instead of a WKRemoteObjectInterface. What if the same protocol is registered for multiple interfaces? (In reply to comment #2) > FWIW, I do think this API is cumbersome because it requires the caller to pass a WKRemoteObjectInterface, which it typically gets from +remoteObjectInterfaceWithProtocol:. I wonder if there can be methods that take a Protocol instead of a WKRemoteObjectInterface. +remoteObjectInterfaceWithProtocol:. I wonder if there can be methods that take a Protocol instead of a WKRemoteObjectInterface. The problem with +remoteObjectInterfaceWithProtocol: is that it creates a new WKRemoteObjectInterface* object every time for the same Protocol. That means we will hit assertion in - (void)unregisterExportedObject:(id)object interface:(WKRemoteObjectInterface *)interface since it is different than the interface argument used on registering. For now, the only way to get around this is to save interface on the caller and use that exact object on both registering and unregistering. It is hard to predict the usage pattern now, but I think sometimes we probably just want to unregister the object before destroying the object, in that case, it would be helpful if we provide a method to remove an object (for all interfaces) from the registry. Some thing like: - (void)unregisterObjectForAllInterfaces:(id)object; what do you think? |