Bug 1517577 - DataTransferItemList::Add should use nsVariantCC. r=nika, a=RyanVM
authorAndrew McCreight <continuation@gmail.com>
Thu, 10 Jan 2019 19:23:43 +0000
changeset 509430 75bae5cabb1c83c4a0333663d1db9c4079130880
parent 509429 7ddc13a7de8d8d42546f96b5a14379c4ca49dfde
child 509431 138a3eb773c865898c1f43e53aa9b3b39e2f38d4
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)
reviewersnika, RyanVM
bugs1517577
milestone65.0
Bug 1517577 - DataTransferItemList::Add should use nsVariantCC. r=nika, a=RyanVM nsVariant isn't cycle collected, so this can cause a leak. Differential Revision: https://phabricator.services.mozilla.com/D16124
dom/events/DataTransferItemList.cpp
testing/web-platform/meta/FileAPI/file/__dir__.ini
testing/web-platform/meta/html/semantics/forms/form-submission-0/__dir__.ini
--- a/dom/events/DataTransferItemList.cpp
+++ b/dom/events/DataTransferItemList.cpp
@@ -168,17 +168,17 @@ DataTransferItem* DataTransferItemList::
 DataTransferItem* DataTransferItemList::Add(File& aData,
                                             nsIPrincipal& aSubjectPrincipal,
                                             ErrorResult& aRv) {
   if (mDataTransfer->IsReadOnly()) {
     return nullptr;
   }
 
   nsCOMPtr<nsISupports> supports = do_QueryObject(&aData);
-  nsCOMPtr<nsIWritableVariant> data = new nsVariant();
+  nsCOMPtr<nsIWritableVariant> data = new nsVariantCC();
   data->SetAsISupports(supports);
 
   nsAutoString type;
   aData.GetType(type);
 
   if (!DataTransfer::PrincipalMaySetData(type, data, &aSubjectPrincipal)) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return nullptr;
deleted file mode 100644
--- a/testing/web-platform/meta/FileAPI/file/__dir__.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-lsan-allowed: [Alloc, NewEmptyScopeData, __rdl_alloc, __rdl_realloc, js_pod_calloc, js_pod_malloc, js_pod_realloc, mozilla::dom::ChromeUtils::GenerateQI, mozilla::dom::Performance::CreateForMainThread]
-leak-threshold: [default:409600, tab:819200]
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/forms/form-submission-0/__dir__.ini
+++ /dev/null
@@ -1,1 +0,0 @@
-lsan-allowed: [Alloc, NewEmptyScopeData, __rdl_alloc, __rdl_realloc, js_new, js_pod_calloc, js_pod_malloc, js_pod_realloc, mozilla::dom::ChromeUtils::GenerateQI, mozilla::dom::Performance::CreateForMainThread]