Bug 1310023 - Use nsIArray rather than nsISupportsArray for window args in widget. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Fri, 14 Oct 2016 12:51:17 -0700
changeset 360975 8769351b980ee57e0d0b4436808a2e272d5fe59b
parent 360974 cb6b42803b04e80b7b1109813e535419d422e696
child 360976 acee3d0166dc3426e858930f9a3587122638446d
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1310023
milestone52.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 1310023 - Use nsIArray rather than nsISupportsArray for window args in widget. r=froydnj This just swaps out the usage nsISupportsArray with nsIArray when opening a window. |nsIWindowWatcher.OpenWindow| supports both interfaces, so no changes are needed there.
widget/android/nsWindow.cpp
widget/nsPrintOptionsImpl.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -30,17 +30,16 @@ using mozilla::dom::ContentChild;
 using mozilla::Unused;
 
 #include "nsWindow.h"
 
 #include "nsIBaseWindow.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsIObserverService.h"
 #include "nsISelection.h"
-#include "nsISupportsArray.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIWidgetListener.h"
 #include "nsIWindowWatcher.h"
 #include "nsIXULWindow.h"
 
 #include "nsAppShell.h"
 #include "nsFocusManager.h"
 #include "nsIdleService.h"
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -9,22 +9,22 @@
 #include "mozilla/layout/RemotePrintJobChild.h"
 #include "mozilla/RefPtr.h"
 #include "nsPrintingProxy.h"
 #include "nsReadableUtils.h"
 #include "nsPrintSettingsImpl.h"
 #include "nsIPrintSession.h"
 #include "nsServiceManagerUtils.h"
 
+#include "nsArray.h"
 #include "nsIDOMWindow.h"
 #include "nsIDialogParamBlock.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIWindowWatcher.h"
-#include "nsISupportsArray.h"
 #include "prprf.h"
 
 #include "nsIStringEnumerator.h"
 #include "nsISupportsPrimitives.h"
 #include "stdlib.h"
 #include "mozilla/Preferences.h"
 #include "nsPrintfCString.h"
 #include "nsIWebBrowserPrint.h"
@@ -331,35 +331,33 @@ nsPrintOptions::DeserializeToPrintSettin
 
 
 NS_IMETHODIMP
 nsPrintOptions::ShowPrintSetupDialog(nsIPrintSettings *aPS)
 {
   NS_ENSURE_ARG_POINTER(aPS);
   nsresult rv;
 
-  // create a nsISupportsArray of the parameters
+  // create a nsIArray of the parameters
   // being passed to the window
-  nsCOMPtr<nsISupportsArray> array;
-  rv = NS_NewISupportsArray(getter_AddRefs(array));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsCOMPtr<nsIMutableArray> array = nsArray::Create();
 
   nsCOMPtr<nsISupports> psSupports = do_QueryInterface(aPS);
   NS_ASSERTION(psSupports, "PrintSettings must be a supports");
-  array->AppendElement(psSupports);
+  array->AppendElement(psSupports, /*weak =*/ false);
 
   nsCOMPtr<nsIDialogParamBlock> ioParamBlock =
       do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   ioParamBlock->SetInt(0, 0);
 
   nsCOMPtr<nsISupports> blkSupps = do_QueryInterface(ioParamBlock);
   NS_ASSERTION(blkSupps, "IOBlk must be a supports");
-  array->AppendElement(blkSupps);
+  array->AppendElement(blkSupps, /*weak =*/ false);
 
   nsCOMPtr<nsIWindowWatcher> wwatch =
       do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<mozIDOMWindowProxy> parent;
   wwatch->GetActiveWindow(getter_AddRefs(parent));
   // null |parent| is non-fatal