XPCOM history, including stuff we don't use much anymore binary drop-in libraries, compiler independent - reference-counting for ownership - how reference counting works - QueryInterface for dynamic_cast - how query interface works, and is used component is an XPCOM object (?) - multiple languages interfaces and IIDs - NS_GET_IID should only be used on template parameters https://github.com/mozilla/gecko-dev/blob/06944cc30e4232e11d813b997e2048a30e52a250/layout/style/nsComputedDOMStyle.cpp#L2406 https://github.com/mozilla/gecko-dev/blob/99ef95d12ff4ff66b5685691dc291ba4aaa38732/layout/style/nsComputedDOMStyle.cpp#L3570 https://github.com/mozilla/gecko-dev/blob/301f982c2116554821cad946db98a5a7296e95dd/layout/style/nsComputedDOMStyle.cpp#L4523 createInstance / getService (lack of enforcement) modules, factories contract IDs, CIDs, categories cycle collection performance costs of cross-library calls and virtual function calls - other abstraction costs dangers of drop-in binary components breaking the browser costs of maintaining binary compatibility - didn't get automatic modularity String goals: - encapsulate memory management - avoid buffer overruns - avoid string copies (what's special about our string classes) 1-byte vs. 2-byte, encodings dynamic vs. static typing Substring vs. String (and AString) ownership types: - reference-counted buffer - owned buffer - dependent buffer - AutoString binding references to temporaries as recommended pattern, e.g., with Substring, StringHead, StringTail; maybe more in future a + b creating temporaries buffer growth by doubling; exact at first better encoding conversion helpers