Gecko
XPCOM
- Cross Platform Component Object Model; A framework which allows developers to break up monolithic software projects into smaller modularized pieces
- Provide:
- component management
- object message passing
- memory management
- nsISupports(?)
- CID: 128-bit number that uniquely identifies a class or component.
{ 0x777f7150, 0x4a2b, 0x4301, 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa} - IID: 128-bit number that uniquely identifies an interface
- Contract ID: human readable string used to access a component.
"@mozilla.org/network/ldap-operation;1" - Expections(?): All interface methods should return an
nsresulterror value
Create XPCOM Component
XPConnect
- The bridge between XPCOM and JS(?)
XPIDL
- An Interface Description Language used to specify XPCOM interface classes
- Some examples are in the
gecko/xpcom/baseandgeckoxpcom/dsdirectories
xpidl
- A tool
- For generating XPCOM interface information
- c++ headers
- type library files(.xpt): type library is the binary representation of interfaces.类型lib库(.xpt文件),是用接口类文件生成的二进制的文件。
xptcall
- A small low level XPCOM method call library.
- The code is at:
gecko/xpcom/reflect/xptcall - xptcall exists for two reasons:
- To support invoking arbitrary methods on XPCOM interfaces.
- To support dynamically impersonating any XPCOM interface.
Non-blocking IO(?)
There is an IO thread in gecko. You can check RilClient in gecko/ipc/ril/Ril.cpp
Code Directory Structure