Backout Bug 570002 (changeset 218c8700878c) due to test failure.
authorJustin Wood <Callek@gmail.com>
Thu, 10 Jun 2010 18:22:27 -0400
changeset 43482 dd7bb545e0bed8600abc3d231aad6e6b6192a503
parent 43481 218c8700878c6ca920e0f4888ac84ccd8e11fbee
child 43483 01f4a0bad338d689bdbff88e292de84378aba98d
push id13730
push userCallek@gmail.com
push dateThu, 10 Jun 2010 22:24:03 +0000
treeherdermozilla-central@01f4a0bad338 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs570002
milestone1.9.3a6pre
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
Backout Bug 570002 (changeset 218c8700878c) due to test failure.
modules/libpr0n/decoders/icon/nsIconURI.cpp
--- a/modules/libpr0n/decoders/icon/nsIconURI.cpp
+++ b/modules/libpr0n/decoders/icon/nsIconURI.cpp
@@ -246,34 +246,41 @@ nsMozIconURI::SetSpec(const nsACString &
   // (3) a valid URL
 
   if (!strncmp("//stock/", iconPath.get(), 8))
   {
     mStockIcon.Assign(Substring(iconPath, 8));
     return NS_OK;
   }
 
-  if (StringBeginsWith(iconPath, NS_LITERAL_CSTRING("//")))
+  if (!strncmp("//", iconPath.get(), 2))
   {
     // Sanity check this supposed dummy file name.
     if (iconPath.Length() > SANE_FILE_NAME_LEN)
       return NS_ERROR_MALFORMED_URI;
-    iconPath.Cut(0, 2);
-    mFileName.Assign(iconPath);
+    mFileName.Assign(Substring(iconPath, 2));
+    return NS_OK;
   }
 
   nsresult rv;
   nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIURI> uri;
-  ioService->NewURI(iconPath, nsnull, nsnull, getter_AddRefs(uri));
-  mIconURL = do_QueryInterface(uri);
+  rv = ioService->NewURI(iconPath, nsnull, nsnull, getter_AddRefs(uri));
+  if (NS_SUCCEEDED(rv) && uri)
+  {
+    nsCOMPtr<nsIURL> url(do_QueryInterface(uri, &rv));
+    if (NS_SUCCEEDED(rv) && url)
+    {
+      mIconURL = url;
+    }
+  }
 
-  return NS_OK;
+  return rv;
 }
 
 NS_IMETHODIMP
 nsMozIconURI::GetPrePath(nsACString &prePath)
 {
   prePath = MOZICON_SCHEME;
   return NS_OK;
 }