请输入您要查询的百科知识:

 

词条 XPCOM
释义

  1. The model

  2. Past overuse

  3. References

  4. External links

Cross Platform Component Object Model (XPCOM) is a cross-platform component model from Mozilla. It is similar to Microsoft Component Object Model (COM) and Common Object Request Broker Architecture (CORBA).[1] It features multiple language bindings and interface description language (IDL) descriptions; thus programmers can plug their custom functions into the framework and connect it with other components.

The most prominent usage of XPCOM is within the Firefox web browser. Many of its internal components interact via XPCOM interfaces. Furthermore, Firefox used to allow add-ons extensive XPCOM access, but this was removed in Firefox 57 and replaced with the less-permissive WebExtensions API.[2][3] (Three forks of Firefox still support the legacy add-on capability: Pale Moon,[4] Basilisk,[5] Waterfox.[6])

The model

XPCOM is one of the main things making the Mozilla application environment an actual framework. It is a development environment that provides the following features for the cross-platform software developer:

  • Component management
  • File abstraction
  • Object message passing
  • Memory management

This component object model makes virtually all of the functionality of Gecko available as a series of components, or reusable cross-platform libraries, that can be accessed from the web browser or scripted from any Mozilla application. Applications that must access the various Mozilla XPCOM libraries (networking, security, DOM, etc.) use a special layer of XPCOM called XPConnect, which reflects the library interfaces into JavaScript, or other languages. XPConnect glues the front end to the C++ or C programming language based components in XPCOM, and it can be extended to include scripting support for other languages: PyXPCOM[7] already offers support for Python. PerlConnect and plXPCOM[8] provide support for Perl, and there are efforts underway to add Common Language Infrastructure (CLI) and Ruby language support for XPConnect.

For developers, XPCOM allows writing components in C++, C, JavaScript, Python, or other languages for which special bindings have been created, and compile and run those components on dozens of different platforms, including these and others where Mozilla is supported.

The flexibility to reuse the XPCOM components from the Gecko library and develop new components that run on different platforms facilitates rapid application development and results in an application that is more productive and easier to maintain. The networking library, for example, is a set of XPCOM components that can be accessed and used by any Mozilla application. File I/O, security, password management, and profiles are also separate XPCOM components that programmers can use in their own application development.

Past overuse

XPCOM adds a lot of code for marshalling objects, and in the Netscape era XPCOM was overused for internal interfaces where it wasn't truly necessary, resulting in software bloat.[9] This was a key reason why in 2001 Apple forked KHTML, not Gecko, to create the WebKit engine for its Safari browser.[10]

Mozilla has since cleaned up some of the XPCOM bloat.[11] By 2008, this combined with other efforts resulted in big performance improvements for Gecko.[12]

References

1. ^Comparison with COM, GObject, SOM, Objective-C, Windows Runtime
2. ^[https://www.mozilla.org/en-US/firefox/57.0/releasenotes/ Firefox 57 release notes]
3. ^{{cite web|title=The Future of Developing Firefox Add-ons|url=https://blog.mozilla.org/addons/2015/08/21/the-future-of-developing-firefox-add-ons/|date=2015-08-21|author=Kev Needham|accessdate=2018-04-02|website=blog.mozilla.org}}
4. ^{{cite web|url=https://www.palemoon.org/roadmap.shtml |title=Pale Moon future roadmap | accessdate=2018-04-02 |publisher=Pale Moon}}
5. ^{{cite web|title=Pale Moon team releases first version of Basilisk browser|url=https://www.ghacks.net/2017/11/17/pale-moon-team-releases-first-version-of-basilisk-browser/|website=ghacks.net|date=2017-11-17|accessdate=2018-04-02}}
6. ^{{cite web|title=Waterfox, Its Legacy and Looking to the Future|url=https://blog.waterfoxproject.org/waterfox-its-legacy-and-looking-to-the-future|website=Waterfox blog|date=2018-04-28|accessdate=2018-06-20}}
7. ^[https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_bindings/PyXPCOM PyXPCOM]
8. ^Perl XPCOM project
9. ^{{cite web |url = https://arstechnica.com/information-technology/2004/06/collins-interview/2/ |title = Ars Technica sits down with Scott Collins from Mozilla.org |author = Jorge O. Castro |publisher = Ars Technica |date = 2004-06-15 |accessdate=2017-02-16}}
10. ^{{cite web|url=http://news.cnet.com/2100-1023-980492.html |archiveurl=https://www.webcitation.org/5jaojY2P3?url=http://news.cnet.com/2100-1023-980492.html |title=Apple snub stings Mozilla |author=Paul Festa |publisher=CNET Networks |date=2003-01-14 |archivedate=2009-09-06 |accessdate=2017-02-16 |authorlink=Paul Festa |deadurl=yes |df= }}
11. ^{{cite web | url= https://wiki.mozilla.org/Gecko:DeCOMtamination | title= Gecko:DeCOMtamination}}
12. ^{{cite web |url =https://arstechnica.com/information-technology/2008/09/mozilla-committed-to-gecko/ |author = Ryan Paul |title = Why Mozilla is committed to Gecko as WebKit popularity grows |date = 2008-09-09 |accessdate=2017-02-16}}

External links

  • [https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference XPCOM API Reference]
  • [https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM XPCOM Project Homepage]
  • A slightly out-of-date but still useful book that talks about XPCOM
  • A Simple XPCOM Tutorial
{{Mozilla projects}}{{DEFAULTSORT:Xpcom}}

2 : Application programming interfaces|Mozilla

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/21 17:48:29