Bug 1550930 part 2. Stop using [array] for nsIDroppedLinkHandler.validateURIsForDrop. r=NeilDeakin
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 15 May 2019 20:52:52 +0000
changeset 535893 5945a8e0198b041454d61bfc92b2d3e79229d352
parent 535892 a0d592c0cd66b61393d78a81a88be2d9f133837b
child 535894 1274c074caef1fb327fad2d59bda256e5029e5e2
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1550930
milestone68.0a1
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 1550930 part 2. Stop using [array] for nsIDroppedLinkHandler.validateURIsForDrop. r=NeilDeakin Differential Revision: https://phabricator.services.mozilla.com/D30769
browser/base/content/browser.js
dom/base/ContentAreaDropListener.jsm
dom/base/nsIDroppedLinkHandler.idl
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3721,20 +3721,18 @@ var browserDragAndDrop = {
   getTriggeringPrincipal(aEvent) {
     return Services.droppedLinkHandler.getTriggeringPrincipal(aEvent);
   },
 
   getCSP(aEvent) {
     return Services.droppedLinkHandler.getCSP(aEvent);
   },
 
-  validateURIsForDrop(aEvent, aURIsCount, aURIs) {
-    return Services.droppedLinkHandler.validateURIsForDrop(aEvent,
-                                                           aURIsCount,
-                                                           aURIs);
+  validateURIsForDrop(aEvent, aURIs) {
+    return Services.droppedLinkHandler.validateURIsForDrop(aEvent, aURIs);
   },
 
   dropLinks(aEvent, aDisallowInherit) {
     return Services.droppedLinkHandler.dropLinks(aEvent, aDisallowInherit);
   },
 };
 
 var homeButtonObserver = {
@@ -3747,17 +3745,17 @@ var homeButtonObserver = {
           if (link.url.includes("|")) {
             urls.push(...link.url.split("|"));
           } else {
             urls.push(link.url);
           }
         }
 
         try {
-          browserDragAndDrop.validateURIsForDrop(aEvent, urls.length, urls);
+          browserDragAndDrop.validateURIsForDrop(aEvent, urls);
         } catch (e) {
           return;
         }
 
         setTimeout(openHomeDialog, 0, urls.join("|"));
       }
     },
 
--- a/dom/base/ContentAreaDropListener.jsm
+++ b/dom/base/ContentAreaDropListener.jsm
@@ -298,17 +298,17 @@ ContentAreaDropListener.prototype =
       }
     }
     if (aCount)
       aCount.value = links.length;
 
     return links;
   },
 
-  validateURIsForDrop: function(aEvent, aURIsCount, aURIs, aDisallowInherit)
+  validateURIsForDrop: function(aEvent, aURIs, aDisallowInherit)
   {
     let dataTransfer = aEvent.dataTransfer;
     let triggeringPrincipal = this._getTriggeringPrincipalFromDataTransfer(dataTransfer, false);
 
     for (let uri of aURIs) {
       this._validateURI(dataTransfer, uri, aDisallowInherit,
                         triggeringPrincipal);
     }
--- a/dom/base/nsIDroppedLinkHandler.idl
+++ b/dom/base/nsIDroppedLinkHandler.idl
@@ -82,18 +82,17 @@ interface nsIDroppedLinkHandler : nsISup
                  [retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);
 
   /**
    * Given a drop event aEvent, validate the extra URIs for the event,
    * this is used when the caller extracts yet another URIs from the dropped
    * text, like home button that splits the text with "|".
    */
   void validateURIsForDrop(in DragEvent aEvent,
-                           in unsigned long aURIsCount,
-                           [array, size_is(aURIsCount)] in wstring aURIs,
+                           in Array<AString> aURIs,
                            [optional] in boolean aDisallowInherit);
 
   /**
    * Given a dataTransfer, allows caller to determine and verify links being
    * dragged. Since drag/drop performs a roundtrip of parent, child, parent,
    * it allows the parent to verify that the child did not modify links
    * being dropped.
    */