Backed out changeset f9900ac6071c (bug 571074) for failing clipboard at browser/base/content/test/general/browser_clipboard.js on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Fri, 30 Nov 2018 02:30:22 +0200
changeset 508095 1e64f8c3f949bb16b4981f255033021b42118586
parent 508094 57816e067da5bac79091eb33436e2d45c8699079
child 508096 305c06df7740f4b2393c53dae175f0d199f3e30b
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs571074
milestone65.0a1
backs outf9900ac6071c17ff7af3ccfaf2a8ce02ea66cffc
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
Backed out changeset f9900ac6071c (bug 571074) for failing clipboard at browser/base/content/test/general/browser_clipboard.js on a CLOSED TREE
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsContentUtils.cpp
editor/libeditor/HTMLEditorDataTransfer.cpp
widget/cocoa/nsChildView.mm
widget/cocoa/nsClipboard.mm
widget/gtk/nsClipboard.cpp
widget/gtk/nsDragService.cpp
widget/nsITransferable.idl
widget/windows/nsDataObj.cpp
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -236,36 +236,33 @@ nsContentAreaDragDropDataProvider::GetFl
   *aData = nullptr;
 
   nsresult rv = NS_ERROR_NOT_IMPLEMENTED;
 
   if (strcmp(aFlavor, kFilePromiseMime) == 0) {
     // get the URI from the kFilePromiseURLMime flavor
     NS_ENSURE_ARG(aTransferable);
     nsCOMPtr<nsISupports> tmp;
-    rv = aTransferable->GetTransferData(kFilePromiseURLMime,
-                                        getter_AddRefs(tmp));
-    NS_ENSURE_SUCCESS(rv, rv);
+    aTransferable->GetTransferData(kFilePromiseURLMime, getter_AddRefs(tmp));
     nsCOMPtr<nsISupportsString> supportsString =
       do_QueryInterface(tmp);
     if (!supportsString)
       return NS_ERROR_FAILURE;
 
     nsAutoString sourceURLString;
     supportsString->GetData(sourceURLString);
     if (sourceURLString.IsEmpty())
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIURI> sourceURI;
     rv = NS_NewURI(getter_AddRefs(sourceURI), sourceURLString);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = aTransferable->GetTransferData(kFilePromiseDestFilename,
-                                        getter_AddRefs(tmp));
-    NS_ENSURE_SUCCESS(rv, rv);
+    aTransferable->GetTransferData(kFilePromiseDestFilename,
+                                   getter_AddRefs(tmp));
     supportsString = do_QueryInterface(tmp);
     if (!supportsString)
       return NS_ERROR_FAILURE;
 
     nsAutoString targetFilename;
     supportsString->GetData(targetFilename);
     if (targetFilename.IsEmpty())
       return NS_ERROR_FAILURE;
@@ -273,19 +270,18 @@ nsContentAreaDragDropDataProvider::GetFl
 #if defined(XP_MACOSX)
     // Use the image request's MIME type to ensure the filename's
     // extension is compatible with the OS's handler for this type.
     // If it isn't, or is missing, replace the extension with the
     // primary extension. On Mac, do this in the parent process
     // because sandboxing blocks access to MIME-handler info from
     // content processes.
     if (XRE_IsParentProcess()) {
-      rv = aTransferable->GetTransferData(kImageRequestMime,
-                                          getter_AddRefs(tmp));
-      NS_ENSURE_SUCCESS(rv, rv);
+      aTransferable->GetTransferData(kImageRequestMime,
+                                     getter_AddRefs(tmp));
       supportsString = do_QueryInterface(tmp);
       if (!supportsString)
         return NS_ERROR_FAILURE;
 
       nsAutoString imageRequestMime;
       supportsString->GetData(imageRequestMime);
 
       // If we have a MIME type, check the extension is compatible
@@ -323,19 +319,18 @@ nsContentAreaDragDropDataProvider::GetFl
     // make the filename safe for the filesystem
     targetFilename.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS,
                                '-');
 #endif /* defined(XP_MACOSX) */
 
     // get the target directory from the kFilePromiseDirectoryMime
     // flavor
     nsCOMPtr<nsISupports> dirPrimitive;
-    rv = aTransferable->GetTransferData(kFilePromiseDirectoryMime,
-                                        getter_AddRefs(dirPrimitive));
-    NS_ENSURE_SUCCESS(rv, rv);
+    aTransferable->GetTransferData(kFilePromiseDirectoryMime,
+                                   getter_AddRefs(dirPrimitive));
     nsCOMPtr<nsIFile> destDirectory = do_QueryInterface(dirPrimitive);
     if (!destDirectory)
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIFile> file;
     rv = destDirectory->Clone(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -8105,20 +8105,17 @@ nsContentUtils::TransferableToIPCTransfe
 
     for (uint32_t j = 0; j < flavorList.Length(); ++j) {
       nsCString& flavorStr = flavorList[j];
       if (!flavorStr.Length()) {
         continue;
       }
 
       nsCOMPtr<nsISupports> data;
-      if (NS_FAILED(aTransferable->GetTransferData(flavorStr.get(),
-                                                   getter_AddRefs(data)))) {
-        continue;
-      }
+      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(data));
 
       nsCOMPtr<nsISupportsString> text = do_QueryInterface(data);
       nsCOMPtr<nsISupportsCString> ctext = do_QueryInterface(data);
       if (text) {
         nsAutoString dataAsString;
         text->GetData(dataAsString);
         IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
         item->flavor() = flavorStr;
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -1590,35 +1590,29 @@ HTMLEditor::PasteInternal(int32_t aClipb
     nsCOMPtr<nsITransferable> contextTransferable =
       do_CreateInstance("@mozilla.org/widget/transferable;1");
     if (NS_WARN_IF(!contextTransferable)) {
       return NS_ERROR_FAILURE;
     }
     contextTransferable->Init(nullptr);
     contextTransferable->AddDataFlavor(kHTMLContext);
     clipboard->GetData(contextTransferable, aClipboardType);
-    rv = contextTransferable->GetTransferData(kHTMLContext,
-                                              getter_AddRefs(contextDataObj));
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
+    contextTransferable->GetTransferData(kHTMLContext,
+                                         getter_AddRefs(contextDataObj));
 
     nsCOMPtr<nsITransferable> infoTransferable =
       do_CreateInstance("@mozilla.org/widget/transferable;1");
     if (NS_WARN_IF(!infoTransferable)) {
       return NS_ERROR_FAILURE;
     }
     infoTransferable->Init(nullptr);
     infoTransferable->AddDataFlavor(kHTMLInfo);
     clipboard->GetData(infoTransferable, aClipboardType);
-    rv = infoTransferable->GetTransferData(kHTMLInfo,
-                                           getter_AddRefs(infoDataObj));
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
+    infoTransferable->GetTransferData(kHTMLInfo,
+                                      getter_AddRefs(infoDataObj));
 
     if (contextDataObj) {
       textDataObj = do_QueryInterface(contextDataObj);
       textDataObj->GetData(contextStr);
     }
 
     if (infoDataObj) {
       textDataObj = do_QueryInterface(infoDataObj);
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -1,17 +1,16 @@
 /* -*- Mode: objc; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
 
 #include "mozilla/Logging.h"
-#include "mozilla/Unused.h"
 
 #include <unistd.h>
 #include <math.h>
 
 #include "nsChildView.h"
 #include "nsCocoaWindow.h"
 
 #include "mozilla/MiscEvents.h"
@@ -6252,18 +6251,18 @@ provideDataForType:(NSString*)aType
             continue;
           }
 
           item->SetTransferData(kFilePromiseDirectoryMime, macLocalFile);
 
           // Now request the kFilePromiseMime data, which will invoke the data
           // provider. If successful, the file will have been created.
           nsCOMPtr<nsISupports> fileDataPrimitive;
-          Unused << item->GetTransferData(kFilePromiseMime,
-                                          getter_AddRefs(fileDataPrimitive));
+          item->GetTransferData(kFilePromiseMime,
+                                getter_AddRefs(fileDataPrimitive));
         }
         CFRelease(urlRef);
         CFRelease(pboardRef);
 
         [aPasteboard setPropertyList:[pasteboardOutputDict valueForKey:curType]
                              forType:curType];
       }
     }
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -557,20 +557,17 @@ nsClipboard::PasteboardDictFromTransfera
           [UTIHelper stringFromPboardType:kMozCustomTypesPboardType];
         [pasteboardOutputDict setObject:nativeData forKey:customType];
       }
     }
     else if (flavorStr.EqualsLiteral(kPNGImageMime) || flavorStr.EqualsLiteral(kJPEGImageMime) ||
              flavorStr.EqualsLiteral(kJPGImageMime) || flavorStr.EqualsLiteral(kGIFImageMime) ||
              flavorStr.EqualsLiteral(kNativeImageMime)) {
       nsCOMPtr<nsISupports> transferSupports;
-      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(transferSupports));
-      if (NS_FAILED(rv)) {
-        continue;
-      }
+      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(transferSupports));
 
       nsCOMPtr<imgIContainer> image(do_QueryInterface(transferSupports));
       if (!image) {
         NS_WARNING("Image isn't an imgIContainer in transferable");
         continue;
       }
 
       RefPtr<SourceSurface> surface =
--- a/widget/gtk/nsClipboard.cpp
+++ b/widget/gtk/nsClipboard.cpp
@@ -477,19 +477,18 @@ nsClipboard::SelectionGetEvent(GtkClipbo
     GdkAtom selectionTarget = gtk_selection_data_get_target(aSelectionData);
 
     // Check to see if the selection data is some text type.
     if (gtk_targets_include_text(&selectionTarget, 1)) {
         // Try to convert our internal type into a text string.  Get
         // the transferable for this clipboard and try to get the
         // text/unicode type for it.
         rv = trans->GetTransferData("text/unicode", getter_AddRefs(item));
-        if (NS_FAILED(rv) || !item) {
+        if (!item || NS_FAILED(rv))
             return;
-        }
 
         nsCOMPtr<nsISupportsString> wideString;
         wideString = do_QueryInterface(item);
         if (!wideString)
             return;
 
         nsAutoString ucs2string;
         wideString->GetData(ucs2string);
@@ -529,17 +528,17 @@ nsClipboard::SelectionGetEvent(GtkClipbo
 
         gtk_selection_data_set_pixbuf(aSelectionData, pixbuf);
         g_object_unref(pixbuf);
         return;
     }
 
     if (selectionTarget == gdk_atom_intern(kHTMLMime, FALSE)) {
         rv = trans->GetTransferData(kHTMLMime, getter_AddRefs(item));
-        if (NS_FAILED(rv) || !item) {
+        if (!item || NS_FAILED(rv)) {
             return;
         }
 
         nsCOMPtr<nsISupportsString> wideString;
         wideString = do_QueryInterface(item);
         if (!wideString) {
             return;
         }
@@ -560,17 +559,17 @@ nsClipboard::SelectionGetEvent(GtkClipbo
     // Try to match up the selection data target to something our
     // transferable provides.
     gchar *target_name = gdk_atom_name(selectionTarget);
     if (!target_name)
         return;
 
     rv = trans->GetTransferData(target_name, getter_AddRefs(item));
     // nothing found?
-    if (NS_FAILED(rv) || !item) {
+    if (!item || NS_FAILED(rv)) {
         g_free(target_name);
         return;
     }
 
     void *primitive_data = nullptr;
     uint32_t dataLen = 0;
     nsPrimitiveHelpers::CreateDataFromPrimitive(nsDependentCString(target_name),
                                                 item, &primitive_data, &dataLen);
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -1734,26 +1734,21 @@ nsDragService::SourceBeginDrag(GdkDragCo
 
     nsTArray<nsCString> flavors;
     nsresult rv = transferable->FlavorsTransferableCanImport(flavors);
     NS_ENSURE_SUCCESS(rv,);
 
     for (uint32_t i = 0; i < flavors.Length(); ++i) {
         if (flavors[i].EqualsLiteral(kFilePromiseDestFilename)) {
             nsCOMPtr<nsISupports> data;
-            rv  = transferable->GetTransferData(kFilePromiseDestFilename,
-                                                getter_AddRefs(data));
-            if (NS_FAILED(rv)) {
+            transferable->GetTransferData(kFilePromiseDestFilename,
+                                          getter_AddRefs(data));
+            nsCOMPtr<nsISupportsString> fileName = do_QueryInterface(data);
+            if (!fileName)
                 return;
-            }
-
-            nsCOMPtr<nsISupportsString> fileName = do_QueryInterface(data);
-            if (!fileName) {
-                return;
-            }
 
             nsAutoString fileNameStr;
             fileName->GetData(fileNameStr);
 
             nsCString fileNameCStr;
             CopyUTF16toUTF8(fileNameStr, fileNameCStr);
 
             GdkAtom property = gdk_atom_intern(gXdndDirectSaveType, FALSE);
--- a/widget/nsITransferable.idl
+++ b/widget/nsITransferable.idl
@@ -126,17 +126,17 @@ interface nsITransferable : nsISupports
 
   /**
     * Given a flavor retrieve the data. 
     *
     * @param  aFlavor (in parameter) the flavor of data to retrieve
     * @param  aData the data. Some variant of class in nsISupportsPrimitives.idl
     * @param  aDataLen the length of the data
     */
-  [must_use] void getTransferData(in string aFlavor, out nsISupports aData);
+  void getTransferData(in string aFlavor, out nsISupports aData);
 
   /**
     * Returns the best flavor in the transferable, given those that have
     * been added to it with |AddFlavor()|
     *
     * @param  aFlavor (out parameter) the flavor of data that was retrieved
     * @param  aData the data. Some variant of class in nsISupportsPrimitives.idl
     */
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -892,77 +892,75 @@ HRESULT nsDataObj::AddGetFormat(FORMATET
 // Someone is asking for a bitmap. The data in the transferable will be a straight
 // imgIContainer, so just QI it.
 //
 HRESULT 
 nsDataObj::GetDib(const nsACString& inFlavor,
                   FORMATETC &aFormat,
                   STGMEDIUM & aSTG)
 {
+  ULONG result = E_FAIL;
   nsCOMPtr<nsISupports> genericDataWrapper;
-  if (NS_FAILED(mTransferable->GetTransferData(PromiseFlatCString(inFlavor).get(),
-                                               getter_AddRefs(genericDataWrapper)))) {
-    return E_FAIL;
-  }
+  mTransferable->GetTransferData(PromiseFlatCString(inFlavor).get(), getter_AddRefs(genericDataWrapper));
+  nsCOMPtr<imgIContainer> image ( do_QueryInterface(genericDataWrapper) );
+  if ( image ) {
+    nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
 
-  nsCOMPtr<imgIContainer> image = do_QueryInterface(genericDataWrapper);
-  if (!image) {
-    return E_FAIL;
-  }
+    nsAutoString options;
+    if (aFormat.cfFormat == CF_DIBV5) {
+      options.AppendLiteral("version=5");
+    } else {
+      options.AppendLiteral("version=3");
+    }
 
-  nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
+    nsCOMPtr<nsIInputStream> inputStream;
+    nsresult rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
+                                        options, getter_AddRefs(inputStream));
+    if (NS_FAILED(rv) || !inputStream) {
+      return E_FAIL;
+    }
+
+    nsCOMPtr<imgIEncoder> encoder = do_QueryInterface(inputStream);
+    if (!encoder) {
+      return E_FAIL;
+    }
 
-  nsAutoString options;
-  if (aFormat.cfFormat == CF_DIBV5) {
-    options.AppendLiteral("version=5");
-  } else {
-    options.AppendLiteral("version=3");
-  }
+    uint32_t size = 0;
+    rv = encoder->GetImageBufferUsed(&size);
+    if (NS_FAILED(rv) || size <= BFH_LENGTH) {
+      return E_FAIL;
+    }
+
+    char *src = nullptr;
+    rv = encoder->GetImageBuffer(&src);
+    if (NS_FAILED(rv) || !src) {
+      return E_FAIL;
+    }
+
+    // We don't want the file header.
+    src += BFH_LENGTH;
+    size -= BFH_LENGTH;
 
-  nsCOMPtr<nsIInputStream> inputStream;
-  nsresult rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
-                                      options, getter_AddRefs(inputStream));
-  if (NS_FAILED(rv) || !inputStream) {
-    return E_FAIL;
-  }
+    HGLOBAL glob = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size);
+    if (!glob) {
+      DWORD err = ::GetLastError();
+      return E_FAIL;
+    }
 
-  nsCOMPtr<imgIEncoder> encoder = do_QueryInterface(inputStream);
-  if (!encoder) {
-    return E_FAIL;
+    char *dst = (char*) ::GlobalLock(glob);
+    ::CopyMemory(dst, src, size);
+    ::GlobalUnlock(glob);
+
+    aSTG.hGlobal = glob;
+    aSTG.tymed = TYMED_HGLOBAL;
+    result = S_OK;
+  } else {
+    NS_WARNING ( "Definitely not an image on clipboard" );
   }
-
-  uint32_t size = 0;
-  rv = encoder->GetImageBufferUsed(&size);
-  if (NS_FAILED(rv) || size <= BFH_LENGTH) {
-    return E_FAIL;
-  }
-
-  char *src = nullptr;
-  rv = encoder->GetImageBuffer(&src);
-  if (NS_FAILED(rv) || !src) {
-    return E_FAIL;
-  }
-
-  // We don't want the file header.
-  src += BFH_LENGTH;
-  size -= BFH_LENGTH;
-
-  HGLOBAL glob = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size);
-  if (!glob) {
-    DWORD err = ::GetLastError();
-    return E_FAIL;
-  }
-
-  char *dst = (char*) ::GlobalLock(glob);
-  ::CopyMemory(dst, src, size);
-  ::GlobalUnlock(glob);
-
-  aSTG.hGlobal = glob;
-  aSTG.tymed = TYMED_HGLOBAL;
-  return S_OK;
+  return result;
 }
 
 
 
 //
 // GetFileDescriptor
 //
 
@@ -1371,21 +1369,19 @@ HRESULT nsDataObj::GetText(const nsACStr
   const nsPromiseFlatCString& flat = PromiseFlatCString(aDataFlavor);
   if (aDataFlavor.EqualsLiteral("text/plain"))
     flavorStr = kUnicodeMime;
   else
     flavorStr = flat.get();
 
   // NOTE: CreateDataFromPrimitive creates new memory, that needs to be deleted
   nsCOMPtr<nsISupports> genericDataWrapper;
-  nsresult rv = mTransferable->GetTransferData(flavorStr,
-                                               getter_AddRefs(genericDataWrapper));
-  if (NS_FAILED(rv) || !genericDataWrapper) {
+  mTransferable->GetTransferData(flavorStr, getter_AddRefs(genericDataWrapper));
+  if ( !genericDataWrapper )
     return E_FAIL;
-  }
 
   uint32_t   len;
   nsPrimitiveHelpers::CreateDataFromPrimitive(
     nsDependentCString(flavorStr), genericDataWrapper, &data, &len);
   if ( !data )
     return E_FAIL;
 
   HGLOBAL     hGlobalMemory = nullptr;
@@ -1483,19 +1479,17 @@ HRESULT nsDataObj::GetFile(FORMATETC& aF
   return E_FAIL;
 }
 
 HRESULT nsDataObj::DropFile(FORMATETC& aFE, STGMEDIUM& aSTG)
 {
   nsresult rv;
   nsCOMPtr<nsISupports> genericDataWrapper;
 
-  if (NS_FAILED(mTransferable->GetTransferData(kFileMime, getter_AddRefs(genericDataWrapper)))) {
-    return E_FAIL;
-  }
+  mTransferable->GetTransferData(kFileMime, getter_AddRefs(genericDataWrapper));
   nsCOMPtr<nsIFile> file ( do_QueryInterface(genericDataWrapper) );
   if (!file)
     return E_FAIL;
 
   aSTG.tymed = TYMED_HGLOBAL;
   aSTG.pUnkForRelease = nullptr;
 
   nsAutoString path;
@@ -1538,20 +1532,17 @@ HRESULT nsDataObj::DropFile(FORMATETC& a
 }
 
 HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
 {
   nsresult rv;
   if (!mCachedTempFile) {
     nsCOMPtr<nsISupports> genericDataWrapper;
 
-    if (NS_FAILED(mTransferable->GetTransferData(kNativeImageMime,
-                                                 getter_AddRefs(genericDataWrapper)))) {
-      return E_FAIL;
-    }
+    mTransferable->GetTransferData(kNativeImageMime, getter_AddRefs(genericDataWrapper));
     nsCOMPtr<imgIContainer> image(do_QueryInterface(genericDataWrapper));
     if (!image) 
       return E_FAIL;
 
     nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
     nsCOMPtr<nsIInputStream> inputStream;
     rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
                                NS_LITERAL_STRING("version=3"),
@@ -2100,32 +2091,30 @@ HRESULT nsDataObj::GetDownloadDetails(ns
                                       nsAString &aFilename)
 {
   *aSourceURI = nullptr;
 
   NS_ENSURE_TRUE(mTransferable, E_FAIL);
 
   // get the URI from the kFilePromiseURLMime flavor
   nsCOMPtr<nsISupports> urlPrimitive;
-  nsresult rv = mTransferable->GetTransferData(kFilePromiseURLMime, getter_AddRefs(urlPrimitive));
-  NS_ENSURE_SUCCESS(rv, E_FAIL);
+  mTransferable->GetTransferData(kFilePromiseURLMime, getter_AddRefs(urlPrimitive));
   nsCOMPtr<nsISupportsString> srcUrlPrimitive = do_QueryInterface(urlPrimitive);
   NS_ENSURE_TRUE(srcUrlPrimitive, E_FAIL);
   
   nsAutoString srcUri;
   srcUrlPrimitive->GetData(srcUri);
   if (srcUri.IsEmpty())
     return E_FAIL;
   nsCOMPtr<nsIURI> sourceURI;
   NS_NewURI(getter_AddRefs(sourceURI), srcUri);
 
   nsAutoString srcFileName;
   nsCOMPtr<nsISupports> fileNamePrimitive;
-  rv = mTransferable->GetTransferData(kFilePromiseDestFilename, getter_AddRefs(fileNamePrimitive));
-  NS_ENSURE_SUCCESS(rv, E_FAIL);
+  mTransferable->GetTransferData(kFilePromiseDestFilename, getter_AddRefs(fileNamePrimitive));
   nsCOMPtr<nsISupportsString> srcFileNamePrimitive = do_QueryInterface(fileNamePrimitive);
   if (srcFileNamePrimitive) {
     srcFileNamePrimitive->GetData(srcFileName);
   } else {
     nsCOMPtr<nsIURL> sourceURL = do_QueryInterface(sourceURI);
     if (!sourceURL)
       return E_FAIL;