XPCOM Interface Rules We Break

John Bandhauer<jband@netscape.com>


This is a list with commentary of the XPCOM interface rules that I see being broken in our code. Much code is written as if the XPCOM interfaces were nothing more than C++ virtual base classes. So far, people have been able to get away with that. But these patterns simply will not do as we convert to xpidl, make more interfaces scriptable via XPConnect, and move toward proxy generation for an apartment threading model, or for remoting.

This does not generally address possible issues with how we use XPCOM and the interfaces, but instead focuses on how we declare interfaces. A much deeper analysis would be required to uncover problems with how interfaces are used (and where XPCOM rules might be being broken; e.g. refcounting errors, casting instead of using QueryInterface, Implementing objects that break XPCOM identity rules, etc).

document history...