Bug 575639 - [e10s] clean up GetBaseURIFromPackage signature. r=jdm, a=dougt
authorMike Kristoffersen <mkristoffersen@mozilla.com>
Wed, 13 Oct 2010 21:46:05 +0200
changeset 56330 7896216a2724fb8d6e2b284695667a48f117e81a
parent 56329 29f9e7e313d0a4b07b00bcde4fa9184f2c76b752
child 56331 179ea37e0a5711afc94ed72d66420a78da6c9a15
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, dougt
bugs575639
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 575639 - [e10s] clean up GetBaseURIFromPackage signature. r=jdm, a=dougt
chrome/src/nsChromeRegistry.cpp
chrome/src/nsChromeRegistry.h
chrome/src/nsChromeRegistryChrome.cpp
chrome/src/nsChromeRegistryChrome.h
chrome/src/nsChromeRegistryContent.cpp
chrome/src/nsChromeRegistryContent.h
--- a/chrome/src/nsChromeRegistry.cpp
+++ b/chrome/src/nsChromeRegistry.cpp
@@ -324,19 +324,17 @@ nsChromeRegistry::ConvertChromeURL(nsIUR
 
   nsCAutoString package, provider, path;
   rv = chromeURL->GetHostPort(package);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = GetProviderAndPath(chromeURL, provider, path);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsIURI* baseURI;
-  rv = GetBaseURIFromPackage(package, provider, path, &baseURI);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsIURI* baseURI = GetBaseURIFromPackage(package, provider, path);
 
   PRUint32 flags;
   rv = GetFlagsFromPackage(package, &flags);
   if (NS_FAILED(rv))
     return rv;
 
   if (flags & PLATFORM_PACKAGE) {
 #if defined(XP_WIN) || defined(XP_OS2)
--- a/chrome/src/nsChromeRegistry.h
+++ b/chrome/src/nsChromeRegistry.h
@@ -113,20 +113,19 @@ public:
 protected:
   void FlushSkinCaches();
   void FlushAllCaches();
 
   static void LogMessage(const char* aMsg, ...);
   static void LogMessageWithContext(nsIURI* aURL, PRUint32 aLineNumber, PRUint32 flags,
                                     const char* aMsg, ...);
 
-  virtual nsresult GetBaseURIFromPackage(const nsCString& aPackage,
-                                         const nsCString& aProvider,
-                                         const nsCString& aPath,
-                                         nsIURI* *aResult) = 0;
+  virtual nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
+                                        const nsCString& aProvider,
+                                        const nsCString& aPath) = 0;
   virtual nsresult GetFlagsFromPackage(const nsCString& aPackage,
                                        PRUint32* aFlags) = 0;
 
   nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
 
   static nsresult RefreshWindow(nsIDOMWindowInternal* aWindow);
   static nsresult GetProviderAndPath(nsIURL* aChromeURL,
                                      nsACString& aProvider, nsACString& aPath);
--- a/chrome/src/nsChromeRegistryChrome.cpp
+++ b/chrome/src/nsChromeRegistryChrome.cpp
@@ -527,48 +527,46 @@ CanLoadResource(nsIURI* aResourceURI)
 {
   PRBool isLocalResource = PR_FALSE;
   (void)NS_URIChainHasFlags(aResourceURI,
                             nsIProtocolHandler::URI_IS_LOCAL_RESOURCE,
                             &isLocalResource);
   return isLocalResource;
 }
 
-nsresult
+nsIURI*
 nsChromeRegistryChrome::GetBaseURIFromPackage(const nsCString& aPackage,
                                               const nsCString& aProvider,
-                                              const nsCString& aPath,
-                                              nsIURI* *aResult)
+                                              const nsCString& aPath)
 {
   PackageEntry* entry =
       static_cast<PackageEntry*>(PL_DHashTableOperate(&mPackagesHash,
                                                       &aPackage,
                                                       PL_DHASH_LOOKUP));
 
   if (PL_DHASH_ENTRY_IS_FREE(entry)) {
     if (!mInitialized)
-      return NS_ERROR_NOT_INITIALIZED;
+      return nsnull;
 
     LogMessage("No chrome package registered for chrome://%s/%s/%s",
                aPackage.get(), aProvider.get(), aPath.get());
 
-    return NS_ERROR_FAILURE;
+    return nsnull;
   }
 
-  *aResult = nsnull;
   if (aProvider.EqualsLiteral("locale")) {
-    *aResult = entry->locales.GetBase(mSelectedLocale, nsProviderArray::LOCALE);
+    return entry->locales.GetBase(mSelectedLocale, nsProviderArray::LOCALE);
   }
   else if (aProvider.EqualsLiteral("skin")) {
-    *aResult = entry->skins.GetBase(mSelectedSkin, nsProviderArray::ANY);
+    return entry->skins.GetBase(mSelectedSkin, nsProviderArray::ANY);
   }
   else if (aProvider.EqualsLiteral("content")) {
-    *aResult = entry->baseURI;
+    return entry->baseURI;
   }
-  return NS_OK;
+  return nsnull;
 }
 
 nsresult
 nsChromeRegistryChrome::GetFlagsFromPackage(const nsCString& aPackage,
                                             PRUint32* aFlags)
 {
   PackageEntry* entry =
       static_cast<PackageEntry*>(PL_DHashTableOperate(&mPackagesHash,
--- a/chrome/src/nsChromeRegistryChrome.h
+++ b/chrome/src/nsChromeRegistryChrome.h
@@ -82,20 +82,19 @@ class nsChromeRegistryChrome : public ns
  private:
 #ifdef MOZ_IPC
   static PLDHashOperator CollectPackages(PLDHashTable *table,
                                          PLDHashEntryHdr *entry,
                                          PRUint32 number, void *arg);
 #endif
 
   nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
-  NS_OVERRIDE nsresult GetBaseURIFromPackage(const nsCString& aPackage,
+  NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
                                              const nsCString& aProvider,
-                                             const nsCString& aPath,
-                                             nsIURI* *aResult);
+                                             const nsCString& aPath);
   NS_OVERRIDE nsresult GetFlagsFromPackage(const nsCString& aPackage,
                                            PRUint32* aFlags);
 
   static const PLDHashTableOps kTableOps;
   static PLDHashNumber HashKey(PLDHashTable *table, const void *key);
   static PRBool        MatchKey(PLDHashTable *table, const PLDHashEntryHdr *entry,
                                 const void *key);
   static void          ClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry);
--- a/chrome/src/nsChromeRegistryContent.cpp
+++ b/chrome/src/nsChromeRegistryContent.cpp
@@ -165,38 +165,36 @@ nsChromeRegistryContent::RegisterOverrid
   rv = NS_NewURI(getter_AddRefs(overrideURI), aOverride.overrideURI.spec,
                  aOverride.overrideURI.charset.get(), nsnull, io);
   if (NS_FAILED(rv))
     return;
   
   mOverrideTable.Put(chromeURI, overrideURI);
 }
 
-nsresult
+nsIURI*
 nsChromeRegistryContent::GetBaseURIFromPackage(const nsCString& aPackage,
                                                const nsCString& aProvider,
-                                               const nsCString& aPath,
-                                               nsIURI* *aResult)
+                                               const nsCString& aPath)
 {
   PackageEntry* entry;
   if (!mPackagesHash.Get(aPackage, &entry)) {
-    return NS_ERROR_FAILURE;
+    return nsnull;
   }
 
-  *aResult = nsnull;
   if (aProvider.EqualsLiteral("locale")) {
-    *aResult = entry->localeBaseURI;
+    return entry->localeBaseURI;
   }
   else if (aProvider.EqualsLiteral("skin")) {
-    *aResult = entry->skinBaseURI;
+    return entry->skinBaseURI;
   }
   else if (aProvider.EqualsLiteral("content")) {
-    *aResult = entry->contentBaseURI;
+    return entry->contentBaseURI;
   }
-  return NS_OK;
+  return nsnull;
 }
 
 nsresult
 nsChromeRegistryContent::GetFlagsFromPackage(const nsCString& aPackage,
                                              PRUint32* aFlags)
 {
   PackageEntry* entry;
   if (!mPackagesHash.Get(aPackage, &entry)) {
--- a/chrome/src/nsChromeRegistryContent.h
+++ b/chrome/src/nsChromeRegistryContent.h
@@ -83,20 +83,19 @@ class nsChromeRegistryContent : public n
     nsCOMPtr<nsIURI> skinBaseURI;
     PRUint32         flags;
   };
   
   void RegisterPackage(const ChromePackage& aPackage);
   void RegisterResource(const ResourceMapping& aResource);
   void RegisterOverride(const OverrideMapping& aOverride);
 
-  NS_OVERRIDE nsresult GetBaseURIFromPackage(const nsCString& aPackage,
+  NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
                                  const nsCString& aProvider,
-                                 const nsCString& aPath,
-                                 nsIURI* *aResult);
+                                 const nsCString& aPath);
   NS_OVERRIDE nsresult GetFlagsFromPackage(const nsCString& aPackage, PRUint32* aFlags);
 
   nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
 
   virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
                                char *const * argv, bool platform,
                                bool contentaccessible);
   virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,