diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index c08c7363e77..c91384b5d9b 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -62,7 +62,7 @@ public: NS_DECL_ISUPPORTS // nsIChromeRegistry methods: - NS_IMETHOD EnsureRegistryDataSource(); + NS_IMETHOD InitRegistry(); NS_IMETHOD ConvertChromeURL(nsIURL* aChromeURL); // nsIRDFDataSource methods @@ -280,7 +280,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } NS_IMETHODIMP -nsChromeRegistry::EnsureRegistryDataSource() +nsChromeRegistry::InitRegistry() { if (mInner == nsnull) return Init("rdf:chrome"); diff --git a/network/module/nsNetService.cpp b/network/module/nsNetService.cpp index 867310d780f..9827e585185 100644 --- a/network/module/nsNetService.cpp +++ b/network/module/nsNetService.cpp @@ -229,7 +229,6 @@ nsNetlibService::nsNetlibService() (nsISupports **)&gChromeRegistry))) { gChromeRegistry = nsnull; } - else gChromeRegistry->Init(); // Load the chrome registry } } @@ -397,7 +396,8 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl, if ((PL_strcmp(protocol, "chrome") == 0) && gChromeRegistry != nsnull) { - if (NS_FAILED(result = gChromeRegistry->ConvertChromeURL(aUrl))) { + if (NS_FAILED(result = gChromeRegistry->InitRegistry()) || + NS_FAILED(result = gChromeRegistry->ConvertChromeURL(aUrl))) { NS_ERROR("Unable to convert chrome URL."); return result; } @@ -552,7 +552,8 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl, if ((PL_strcmp(protocol, "chrome") == 0) && gChromeRegistry != nsnull) { - if (NS_FAILED(result = gChromeRegistry->ConvertChromeURL(aUrl))) { + if (NS_FAILED(result = gChromeRegistry->InitRegistry()) || + NS_FAILED(result = gChromeRegistry->ConvertChromeURL(aUrl))) { NS_ERROR("Unable to convert chrome URL."); return result; } diff --git a/rdf/chrome/public/nsIChromeRegistry.h b/rdf/chrome/public/nsIChromeRegistry.h index 498b2d370f8..fa3ea14e30d 100644 --- a/rdf/chrome/public/nsIChromeRegistry.h +++ b/rdf/chrome/public/nsIChromeRegistry.h @@ -33,7 +33,7 @@ public: static const nsIID& GetIID() { static nsIID iid = NS_ICHROMEREGISTRY_IID; return iid; } NS_IMETHOD ConvertChromeURL(nsIURL* aChromeURL) = 0; - NS_IMETHOD EnsureRegistryDataSource() = 0; + NS_IMETHOD InitRegistry() = 0; }; // for component registration diff --git a/rdf/chrome/src/nsChromeRegistry.cpp b/rdf/chrome/src/nsChromeRegistry.cpp index c08c7363e77..c91384b5d9b 100644 --- a/rdf/chrome/src/nsChromeRegistry.cpp +++ b/rdf/chrome/src/nsChromeRegistry.cpp @@ -62,7 +62,7 @@ public: NS_DECL_ISUPPORTS // nsIChromeRegistry methods: - NS_IMETHOD EnsureRegistryDataSource(); + NS_IMETHOD InitRegistry(); NS_IMETHOD ConvertChromeURL(nsIURL* aChromeURL); // nsIRDFDataSource methods @@ -280,7 +280,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } NS_IMETHODIMP -nsChromeRegistry::EnsureRegistryDataSource() +nsChromeRegistry::InitRegistry() { if (mInner == nsnull) return Init("rdf:chrome");