зеркало из https://github.com/mozilla/gecko-dev.git
registry added to faq
This commit is contained in:
Родитель
328b2181b8
Коммит
549d8873d5
|
@ -33,19 +33,30 @@ Is there any restriction on which static class I should call first</h4>
|
||||||
|
|
||||||
<blockquote>No restrictions. You can call any function from the static
|
<blockquote>No restrictions. You can call any function from the static
|
||||||
classes nsComponentManager and nsServiceManager. XPCOM will do the right
|
classes nsComponentManager and nsServiceManager. XPCOM will do the right
|
||||||
thing to initialize itself at both places.</blockquote>
|
thing to initialize itself at both places.
|
||||||
|
<p>Autoregistration() can happen only after Init_XPCOM() is called since
|
||||||
|
the registy might be required by SelfRegister() functions of the dlls and
|
||||||
|
it is only in Init_XPCOM() do we create register the RegistryFactory()
|
||||||
|
with the ComponentManager.</blockquote>
|
||||||
|
|
||||||
<h4>
|
<h4>
|
||||||
What is the order of creation of the ServiceManager, ComponentManager and
|
What is the order of creation of the ServiceManager, ComponentManager and
|
||||||
Registry</h4>
|
Registry</h4>
|
||||||
|
|
||||||
<blockquote>Init_XPCOM()
|
<blockquote>Init_XPCOM()
|
||||||
<br> create the global component manager
|
<blockquote>
|
||||||
<br> create the global registry and register as service
|
<li>
|
||||||
with global service manager
|
create the global component manager</li>
|
||||||
<br> create the global component manager and register
|
|
||||||
as service with the global service manager
|
<li>
|
||||||
<p>Now the hard problem is when to trigger Init_XPCOM() There are two static
|
create the global component manager and register as service with the global
|
||||||
|
service manager</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
RegisterFactory(...RegistryFactory...) Register the RegistryFactory()
|
||||||
|
with the component manager so that new registry objects can be created.</li>
|
||||||
|
</blockquote>
|
||||||
|
Now the hard problem is when to trigger Init_XPCOM() There are two static
|
||||||
objects nsComponentManager and nsServiceManager. Any function in either
|
objects nsComponentManager and nsServiceManager. Any function in either
|
||||||
of them can be called first. Today nsServiceManager::GetService() is the
|
of them can be called first. Today nsServiceManager::GetService() is the
|
||||||
first one that gets called. All the members of the static nsServiceManager
|
first one that gets called. All the members of the static nsServiceManager
|
||||||
|
@ -55,6 +66,17 @@ to get to the global component manager. Hence if we trigger Init_XPCOM()
|
||||||
from both NS_GetGlobalComponentManager() and NS_GetGlobalServiceManager()
|
from both NS_GetGlobalComponentManager() and NS_GetGlobalServiceManager()
|
||||||
we will be safe.</blockquote>
|
we will be safe.</blockquote>
|
||||||
|
|
||||||
|
<h4>
|
||||||
|
Is there a global Registry being maintained</h4>
|
||||||
|
|
||||||
|
<blockquote>No. The nsIRegistry is designed to be lightweight access to
|
||||||
|
the registry. Consumers who need to access the registry should use the
|
||||||
|
component manager to create the their own registry access object. This
|
||||||
|
is required because the open() call is supported by the nsIRegistry() and
|
||||||
|
if we maintain a global registry arbitrating which registry file is opened
|
||||||
|
is going to be a major headach.
|
||||||
|
<p>The ProgID for the registry will be <font color="#990000">component://netscape/registry</font></blockquote>
|
||||||
|
|
||||||
<hr WIDTH="100%">
|
<hr WIDTH="100%">
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче