Backed out changeset ff17250bcb88 (bug 904720 and bug 915757) because of build bustage
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 28 Oct 2013 10:18:50 -0400
changeset 160906 cb69d5ffd60fda8441b6cd910b2af2554c382bb9
parent 160905 ff17250bcb8818884b33d0a4a0b51317a79a822b
child 160907 b76070f9b0842a26289e0bf7cae336a3d04f880a
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs904720, 915757
milestone26.0a2
backs outff17250bcb8818884b33d0a4a0b51317a79a822b
Backed out changeset ff17250bcb88 (bug 904720 and bug 915757) because of build bustage
caps/src/nsPrincipal.cpp
content/base/src/nsCSPService.cpp
content/base/src/nsContentAreaDragDrop.cpp
content/base/src/nsHostObjectURI.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/document/src/nsXULPrototypeDocument.cpp
content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/src/jsurl/nsJSProtocolHandler.cpp
js/xpconnect/src/nsXPConnect.cpp
layout/mathml/nsMathMLOperators.cpp
layout/svg/nsSVGGlyphFrame.cpp
layout/svg/nsSVGGlyphFrame.h
layout/svg/nsSVGTextContainerFrame.cpp
layout/svg/nsSVGTextContainerFrame.h
layout/svg/nsSVGTextFrame.cpp
layout/svg/nsSVGTextFrame.h
modules/libjar/nsJARURI.cpp
modules/libpref/src/Preferences.cpp
netwerk/base/src/nsSimpleNestedURI.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/streamconv/src/nsStreamConverterService.cpp
toolkit/components/intl/nsCharsetMenu.cpp
toolkit/components/places/Database.cpp
toolkit/components/url-classifier/Classifier.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/base/nsMemoryImpl.cpp
xpcom/base/nsMemoryInfoDumper.cpp
xpcom/base/nsMemoryReporterManager.cpp
xpcom/glue/nsCOMPtr.h
xpcom/io/nsLocalFileUnix.cpp
xpcom/tests/TestCOMPtr.cpp
xpcom/tests/TestObserverService.cpp
xpfe/components/windowds/nsWindowDataSource.cpp
--- a/caps/src/nsPrincipal.cpp
+++ b/caps/src/nsPrincipal.cpp
@@ -494,33 +494,28 @@ nsPrincipal::GetBaseDomain(nsACString& a
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrincipal::Read(nsIObjectInputStream* aStream)
 {
-  nsCOMPtr<nsISupports> supports;
   nsCOMPtr<nsIURI> codebase;
-  nsresult rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
+  nsresult rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(codebase));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  codebase = do_QueryInterface(supports);
-
   nsCOMPtr<nsIURI> domain;
-  rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
+  rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(domain));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  domain = do_QueryInterface(supports);
-
   uint32_t appId;
   rv = aStream->Read32(&appId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool inMozBrowser;
   rv = aStream->ReadBoolean(&inMozBrowser);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/content/base/src/nsCSPService.cpp
+++ b/content/base/src/nsCSPService.cpp
@@ -288,20 +288,18 @@ CSPService::AsyncOnChannelRedirect(nsICh
                                 NS_GET_IID(nsISupports),
                                 getter_AddRefs(policyContainer));
 
   // see if we have a valid nsIChannelPolicy containing CSP and load type
   nsCOMPtr<nsIChannelPolicy> channelPolicy(do_QueryInterface(policyContainer));
   if (!channelPolicy)
     return NS_OK;
 
-  nsCOMPtr<nsISupports> supports;
   nsCOMPtr<nsIContentSecurityPolicy> csp;
-  channelPolicy->GetContentSecurityPolicy(getter_AddRefs(supports));
-  csp = do_QueryInterface(supports);
+  channelPolicy->GetContentSecurityPolicy(getter_AddRefs(csp));
   uint32_t loadType;
   channelPolicy->GetLoadType(&loadType);
 
   // if no CSP in the channelPolicy, nothing for us to add to the channel
   if (!csp)
     return NS_OK;
 
   /* Since redirecting channels don't call into nsIContentPolicy, we call our
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -667,40 +667,31 @@ DragDataProducer::Produce(nsDOMDataTrans
                                                       getter_AddRefs(transferable));
     }
     else {
       rv = nsCopySupport::GetTransferableForNode(nodeToSerialize, doc,
                                                  getter_AddRefs(transferable));
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsISupportsString> data;
     uint32_t dataSize;
-    rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(supports),
-                                       &dataSize);
-    data = do_QueryInterface(supports);
+    rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(data), &dataSize);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mHtmlString);
     }
-    rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(supports),
-                                       &dataSize);
-    data = do_QueryInterface(supports);
+    rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(data), &dataSize);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mContextString);
     }
-    rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(supports),
-                                       &dataSize);
-    data = do_QueryInterface(supports);
+    rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(data), &dataSize);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mInfoString);
     }
-    rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(supports),
-                                       &dataSize);
-    data = do_QueryInterface(supports);
+    rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(data), &dataSize);
     NS_ENSURE_SUCCESS(rv, rv); // require plain text at a minimum
     data->GetData(mTitleString);
   }
 
   // default text value is the URL
   if (mTitleString.IsEmpty()) {
     mTitleString = mUrlString;
   }
--- a/content/base/src/nsHostObjectURI.cpp
+++ b/content/base/src/nsHostObjectURI.cpp
@@ -57,22 +57,17 @@ nsHostObjectURI::GetPrincipalUri(nsIURI*
 // nsISerializable methods:
 
 NS_IMETHODIMP
 nsHostObjectURI::Read(nsIObjectInputStream* aStream)
 {
   nsresult rv = nsSimpleURI::Read(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsISupports> supports;
-  rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  mPrincipal = do_QueryInterface(supports, &rv);
-  return rv;
+  return NS_ReadOptionalObject(aStream, true, getter_AddRefs(mPrincipal));
 }
 
 NS_IMETHODIMP
 nsHostObjectURI::Write(nsIObjectOutputStream* aStream)
 {
   nsresult rv = nsSimpleURI::Write(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -2226,19 +2226,17 @@ nsXULPrototypeElement::Deserialize(nsIOb
                 }
                 if (! script->mOutOfLine) {
                     tmp = script->Deserialize(aStream, aProtoDoc, aDocumentURI,
                                               aNodeInfos);
                     if (NS_FAILED(tmp)) {
                       rv = tmp;
                     }
                 } else {
-                    nsCOMPtr<nsISupports> supports;
-                    tmp = aStream->ReadObject(true, getter_AddRefs(supports));
-                    script->mSrcURI = do_QueryInterface(supports);
+                    tmp = aStream->ReadObject(true, getter_AddRefs(script->mSrcURI));
                     if (NS_FAILED(tmp)) {
                       rv = tmp;
                     }
 
                     tmp = script->DeserializeOutOfLine(aStream, aProtoDoc);
                     if (NS_FAILED(tmp)) {
                       rv = tmp;
                     }
--- a/content/xul/document/src/nsXULPrototypeDocument.cpp
+++ b/content/xul/document/src/nsXULPrototypeDocument.cpp
@@ -229,45 +229,41 @@ nsXULPrototypeDocument::NewXULPDGlobalOb
 // nsISerializable methods
 //
 
 NS_IMETHODIMP
 nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
 {
     nsresult rv;
 
-    nsCOMPtr<nsISupports> supports;
-    rv = aStream->ReadObject(true, getter_AddRefs(supports));
-    mURI = do_QueryInterface(supports);
+    rv = aStream->ReadObject(true, getter_AddRefs(mURI));
 
     uint32_t count, i;
     nsCOMPtr<nsIURI> styleOverlayURI;
 
     nsresult tmp = aStream->Read32(&count);
     if (NS_FAILED(tmp)) {
       return tmp;
     }
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     for (i = 0; i < count; ++i) {
-        tmp = aStream->ReadObject(true, getter_AddRefs(supports));
+        tmp = aStream->ReadObject(true, getter_AddRefs(styleOverlayURI));
         if (NS_FAILED(tmp)) {
           rv = tmp;
         }
-        styleOverlayURI = do_QueryInterface(supports);
         mStyleSheetReferences.AppendObject(styleOverlayURI);
     }
 
 
     // nsIPrincipal mNodeInfoManager->mPrincipal
     nsCOMPtr<nsIPrincipal> principal;
-    tmp = aStream->ReadObject(true, getter_AddRefs(supports));
-    principal = do_QueryInterface(supports);
+    tmp = aStream->ReadObject(true, getter_AddRefs(principal));
     if (NS_FAILED(tmp)) {
       rv = tmp;
     }
     // Better safe than sorry....
     mNodeInfoManager->SetDocumentPrincipal(principal);
 
 
     // nsIScriptGlobalObject mGlobalObject
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
@@ -311,22 +311,20 @@ nsXULTemplateQueryProcessorXML::Generate
         return NS_ERROR_INVALID_ARG;
 
     mGenerationStarted = true;
 
     nsCOMPtr<nsXMLQuery> xmlquery = do_QueryInterface(aQuery);
     if (!xmlquery)
         return NS_ERROR_INVALID_ARG;
 
-    nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsIDOMNode> context;
     if (aRef)
       aRef->GetBindingObjectFor(xmlquery->GetMemberVariable(),
-                                getter_AddRefs(supports));
-    context = do_QueryInterface(supports);
+                                getter_AddRefs(context));
     if (!context)
         context = mRoot;
 
     nsIDOMXPathExpression* expr = xmlquery->GetResultsExpression();
     if (!expr)
         return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsISupports> exprsupportsresults;
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -453,19 +453,18 @@ ContentChild::RecvPMemoryReportRequestCo
     // MemoryReport.
     nsCOMPtr<nsISimpleEnumerator> e;
     mgr->EnumerateReporters(getter_AddRefs(e));
     nsRefPtr<MemoryReportsWrapper> wrappedReports =
         new MemoryReportsWrapper(&reports);
     nsRefPtr<MemoryReportCallback> cb = new MemoryReportCallback(process);
     bool more;
     while (NS_SUCCEEDED(e->HasMoreElements(&more)) && more) {
-      nsCOMPtr<nsISupports> supports;
-      e->GetNext(getter_AddRefs(supports));
-      nsCOMPtr<nsIMemoryReporter> r = do_QueryInterface(supports);
+      nsCOMPtr<nsIMemoryReporter> r;
+      e->GetNext(getter_AddRefs(r));
       r->CollectReports(cb, wrappedReports);
     }
 
     child->Send__delete__(child, reports);
     return true;
 }
 
 bool
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2501,19 +2501,17 @@ ContentParent::RecvShowFilePicker(const 
 
     if (mode == nsIFilePicker::modeOpenMultiple) {
         nsCOMPtr<nsISimpleEnumerator> fileIter;
         *result = filePicker->GetFiles(getter_AddRefs(fileIter));
 
         nsCOMPtr<nsIFile> singleFile;
         bool loop = true;
         while (NS_SUCCEEDED(fileIter->HasMoreElements(&loop)) && loop) {
-            nsCOMPtr<nsISupports> supports;
-            fileIter->GetNext(getter_AddRefs(supports));
-            singleFile = do_QueryInterface(supports);
+            fileIter->GetNext(getter_AddRefs(singleFile));
             if (singleFile) {
                 nsAutoString filePath;
                 singleFile->GetPath(filePath);
                 files->AppendElement(filePath);
             }
         }
         return true;
     }
--- a/dom/src/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/src/jsurl/nsJSProtocolHandler.cpp
@@ -1294,20 +1294,18 @@ nsJSURI::Read(nsIObjectInputStream* aStr
     nsresult rv = nsSimpleURI::Read(aStream);
     if (NS_FAILED(rv)) return rv;
 
     bool haveBase;
     rv = aStream->ReadBoolean(&haveBase);
     if (NS_FAILED(rv)) return rv;
 
     if (haveBase) {
-        nsCOMPtr<nsISupports> supports;
-        rv = aStream->ReadObject(true, getter_AddRefs(supports));
+        rv = aStream->ReadObject(true, getter_AddRefs(mBaseURI));
         if (NS_FAILED(rv)) return rv;
-        mBaseURI = do_QueryInterface(supports);
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJSURI::Write(nsIObjectOutputStream* aStream)
 {
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -1545,32 +1545,28 @@ ReadScriptOrFunction(nsIObjectInputStrea
     uint8_t flags;
     nsresult rv = stream->Read8(&flags);
     if (NS_FAILED(rv))
         return rv;
 
     nsJSPrincipals* principal = nullptr;
     nsCOMPtr<nsIPrincipal> readPrincipal;
     if (flags & HAS_PRINCIPALS_FLAG) {
-        nsCOMPtr<nsISupports> supports;
-        rv = stream->ReadObject(true, getter_AddRefs(supports));
+        rv = stream->ReadObject(true, getter_AddRefs(readPrincipal));
         if (NS_FAILED(rv))
             return rv;
-        readPrincipal = do_QueryInterface(supports);
         principal = nsJSPrincipals::get(readPrincipal);
     }
 
     nsJSPrincipals* originPrincipal = nullptr;
     nsCOMPtr<nsIPrincipal> readOriginPrincipal;
     if (flags & HAS_ORIGIN_PRINCIPALS_FLAG) {
-        nsCOMPtr<nsISupports> supports;
-        rv = stream->ReadObject(true, getter_AddRefs(supports));
+        rv = stream->ReadObject(true, getter_AddRefs(readOriginPrincipal));
         if (NS_FAILED(rv))
             return rv;
-        readOriginPrincipal = do_QueryInterface(supports);
         originPrincipal = nsJSPrincipals::get(readOriginPrincipal);
     }
 
     uint32_t size;
     rv = stream->Read32(&size);
     if (NS_FAILED(rv))
         return rv;
 
--- a/layout/mathml/nsMathMLOperators.cpp
+++ b/layout/mathml/nsMathMLOperators.cpp
@@ -259,20 +259,18 @@ InitOperators(void)
     OperatorData* operatorData = &dummyData;
     nsCOMPtr<nsISimpleEnumerator> iterator;
     if (NS_SUCCEEDED(mathfontProp->Enumerate(getter_AddRefs(iterator)))) {
       bool more;
       uint32_t index = 0;
       nsAutoCString name;
       nsAutoString attributes;
       while ((NS_SUCCEEDED(iterator->HasMoreElements(&more))) && more) {
-        nsCOMPtr<nsISupports> supports;
         nsCOMPtr<nsIPropertyElement> element;
-        if (NS_SUCCEEDED(iterator->GetNext(getter_AddRefs(supports)))) {
-          element = do_QueryInterface(supports);
+        if (NS_SUCCEEDED(iterator->GetNext(getter_AddRefs(element)))) {
           if (NS_SUCCEEDED(element->GetKey(name)) &&
               NS_SUCCEEDED(element->GetValue(attributes))) {
             // expected key: operator.\uNNNN.{infix,postfix,prefix}
             if ((21 <= name.Length()) && (0 == name.Find("operator.\\u"))) {
               name.Cut(0, 9); // 9 is the length of "operator.";
               int32_t len = name.Length();
               nsOperatorFlags form = 0;
               if (kNotFound != name.RFind(".infix")) {
--- a/layout/svg/nsSVGGlyphFrame.cpp
+++ b/layout/svg/nsSVGGlyphFrame.cpp
@@ -1218,31 +1218,31 @@ nsSVGGlyphFrame::SetGlyphPosition(gfxPoi
   }
   for (uint32_t i = 0; i < dycount; i++) {
     aPosition->y += dyList[i] * pathScale;
   }
 }
 
 nsresult
 nsSVGGlyphFrame::GetStartPositionOfChar(uint32_t charnum,
-                                        nsISVGPoint **_retval)
+                                        nsISupports **_retval)
 {
   *_retval = nullptr;
 
   CharacterIterator iter(this, false);
   if (!iter.AdvanceToCharacter(charnum))
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
 
   NS_ADDREF(*_retval = new DOMSVGPoint(iter.GetPositionData().pos));
   return NS_OK;
 }
 
 nsresult
 nsSVGGlyphFrame::GetEndPositionOfChar(uint32_t charnum,
-                                      nsISVGPoint **_retval)
+                                      nsISupports **_retval)
 {
   *_retval = nullptr;
 
   CharacterIterator iter(this, false);
   if (!iter.AdvanceToCharacter(charnum))
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
 
   nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
--- a/layout/svg/nsSVGGlyphFrame.h
+++ b/layout/svg/nsSVGGlyphFrame.h
@@ -129,20 +129,18 @@ protected:
     ClearTextRun();
   }
 
 public:
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // These do not use the global transform if NS_STATE_NONDISPLAY_CHILD
-  nsresult GetStartPositionOfChar(uint32_t charnum,
-                                  mozilla::nsISVGPoint **_retval);
-  nsresult GetEndPositionOfChar(uint32_t charnum,
-                                mozilla::nsISVGPoint **_retval);
+  nsresult GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
+  nsresult GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
   nsresult GetExtentOfChar(uint32_t charnum, dom::SVGIRect **_retval);
   nsresult GetRotationOfChar(uint32_t charnum, float *_retval);
   /**
    * @param aForceGlobalTransform controls whether to use the
    * global transform even when NS_STATE_NONDISPLAY_CHILD
    */
   float GetAdvance(bool aForceGlobalTransform);
 
--- a/layout/svg/nsSVGTextContainerFrame.cpp
+++ b/layout/svg/nsSVGTextContainerFrame.cpp
@@ -86,18 +86,17 @@ nsSVGTextContainerFrame::RemoveFrame(Chi
 
   if (textFrame)
     textFrame->NotifyGlyphMetricsChange();
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsSVGTextContainerFrame::GetStartPositionOfChar(uint32_t charnum,
-                                                nsISVGPoint **_retval)
+nsSVGTextContainerFrame::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
 {
   *_retval = nullptr;
 
   if (charnum >= GetNumberOfChars()) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsISVGGlyphFragmentNode *node = GetFirstGlyphFragmentChildNode();
@@ -110,18 +109,17 @@ nsSVGTextContainerFrame::GetStartPositio
   if (!frame) {
     return NS_ERROR_FAILURE;
   }
 
   return frame->GetStartPositionOfChar(charnum - offset, _retval);
 }
 
 NS_IMETHODIMP
-nsSVGTextContainerFrame::GetEndPositionOfChar(uint32_t charnum,
-                                              nsISVGPoint **_retval)
+nsSVGTextContainerFrame::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
 {
   *_retval = nullptr;
 
   if (charnum >= GetNumberOfChars()) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsISVGGlyphFragmentNode *node = GetFirstGlyphFragmentChildNode();
--- a/layout/svg/nsSVGTextContainerFrame.h
+++ b/layout/svg/nsSVGTextContainerFrame.h
@@ -30,35 +30,33 @@ class SVGIRect;
 
 class nsSVGTextContainerFrame : public nsSVGDisplayContainerFrame
 {
 protected:
   nsSVGTextContainerFrame(nsStyleContext* aContext) :
     nsSVGDisplayContainerFrame(aContext) {}
 
 public:
-  typedef mozilla::nsISVGPoint nsISVGPoint;
-
   void NotifyGlyphMetricsChange();
   virtual void GetXY(SVGUserUnitList *aX, SVGUserUnitList *aY);
   virtual void GetDxDy(SVGUserUnitList *aDx, SVGUserUnitList *aDy);
   virtual const SVGNumberList *GetRotate();
   
   NS_DECL_QUERYFRAME_TARGET(nsSVGTextContainerFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame
   NS_IMETHOD InsertFrames(ChildListID     aListID,
                           nsIFrame*       aPrevFrame,
                           nsFrameList&    aFrameList) MOZ_OVERRIDE;
   NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame *aOldFrame) MOZ_OVERRIDE;
 
-  NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISVGPoint **_retval);
-  NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISVGPoint **_retval);
+  NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
+  NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
   NS_IMETHOD GetExtentOfChar(uint32_t charnum, mozilla::dom::SVGIRect **_retval);
   NS_IMETHOD GetRotationOfChar(uint32_t charnum, float *_retval);
 
   /*
    * Returns the number of characters in a string
    */
   virtual uint32_t GetNumberOfChars();
 
--- a/layout/svg/nsSVGTextFrame.cpp
+++ b/layout/svg/nsSVGTextFrame.cpp
@@ -118,25 +118,25 @@ int32_t
 nsSVGTextFrame::GetCharNumAtPosition(nsISVGPoint *point)
 {
   UpdateGlyphPositioning(false);
 
   return nsSVGTextFrameBase::GetCharNumAtPosition(point);
 }
 
 NS_IMETHODIMP
-nsSVGTextFrame::GetStartPositionOfChar(uint32_t charnum, nsISVGPoint **_retval)
+nsSVGTextFrame::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
 {
   UpdateGlyphPositioning(false);
 
   return nsSVGTextFrameBase::GetStartPositionOfChar(charnum,  _retval);
 }
 
 NS_IMETHODIMP
-nsSVGTextFrame::GetEndPositionOfChar(uint32_t charnum, nsISVGPoint **_retval)
+nsSVGTextFrame::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
 {
   UpdateGlyphPositioning(false);
 
   return nsSVGTextFrameBase::GetEndPositionOfChar(charnum,  _retval);
 }
 
 NS_IMETHODIMP
 nsSVGTextFrame::GetExtentOfChar(uint32_t charnum, dom::SVGIRect **_retval)
--- a/layout/svg/nsSVGTextFrame.h
+++ b/layout/svg/nsSVGTextFrame.h
@@ -80,20 +80,18 @@ public:
                                 nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
   
   // nsSVGTextContainerFrame methods:
   virtual uint32_t GetNumberOfChars() MOZ_OVERRIDE;
   virtual float GetComputedTextLength() MOZ_OVERRIDE;
   virtual float GetSubStringLength(uint32_t charnum, uint32_t nchars) MOZ_OVERRIDE;
   virtual int32_t GetCharNumAtPosition(mozilla::nsISVGPoint *point) MOZ_OVERRIDE;
 
-  NS_IMETHOD GetStartPositionOfChar(uint32_t charnum,
-                                    mozilla::nsISVGPoint **_retval) MOZ_OVERRIDE;
-  NS_IMETHOD GetEndPositionOfChar(uint32_t charnum,
-                                  mozilla::nsISVGPoint **_retval) MOZ_OVERRIDE;
+  NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval) MOZ_OVERRIDE;
+  NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval) MOZ_OVERRIDE;
   NS_IMETHOD GetExtentOfChar(uint32_t charnum, mozilla::dom::SVGIRect **_retval) MOZ_OVERRIDE;
   NS_IMETHOD GetRotationOfChar(uint32_t charnum, float *_retval) MOZ_OVERRIDE;
 
   // nsSVGTextFrame
   void NotifyGlyphMetricsChange();
 
 private:
   /**
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -115,27 +115,20 @@ nsJARURI::CreateEntryURL(const nsACStrin
 ////////////////////////////////////////////////////////////////////////////////
 // nsISerializable methods:
 
 NS_IMETHODIMP
 nsJARURI::Read(nsIObjectInputStream* aInputStream)
 {
     nsresult rv;
 
-    nsCOMPtr<nsISupports> supports;
-    rv = aInputStream->ReadObject(true, getter_AddRefs(supports));
+    rv = aInputStream->ReadObject(true, getter_AddRefs(mJARFile));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    mJARFile = do_QueryInterface(supports, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = aInputStream->ReadObject(true, getter_AddRefs(supports));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    mJAREntry = do_QueryInterface(supports);
+    rv = aInputStream->ReadObject(true, getter_AddRefs(mJAREntry));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = aInputStream->ReadCString(mCharsetHint);
     return rv;
 }
 
 NS_IMETHODIMP
 nsJARURI::Write(nsIObjectOutputStream* aOutputStream)
--- a/modules/libpref/src/Preferences.cpp
+++ b/modules/libpref/src/Preferences.cpp
@@ -1025,19 +1025,17 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
 
   nsCOMArray<nsIFile> prefFiles(INITIAL_PREF_FILES);
   nsCOMArray<nsIFile> specialFiles(aSpecialFilesCount);
   nsCOMPtr<nsIFile> prefFile;
 
   while (hasMoreElements && NS_SUCCEEDED(rv)) {
     nsAutoCString leafName;
 
-    nsCOMPtr<nsISupports> supports;
-    rv = dirIterator->GetNext(getter_AddRefs(supports));
-    prefFile = do_QueryInterface(supports);
+    rv = dirIterator->GetNext(getter_AddRefs(prefFile));
     if (NS_FAILED(rv)) {
       break;
     }
 
     prefFile->GetNativeLeafName(leafName);
     NS_ASSERTION(!leafName.IsEmpty(), "Failure in default prefs: directory enumerator returned empty file?");
 
     // Skip non-js files
--- a/netwerk/base/src/nsSimpleNestedURI.cpp
+++ b/netwerk/base/src/nsSimpleNestedURI.cpp
@@ -24,21 +24,17 @@ nsSimpleNestedURI::nsSimpleNestedURI(nsI
 NS_IMETHODIMP
 nsSimpleNestedURI::Read(nsIObjectInputStream* aStream)
 {
     nsresult rv = nsSimpleURI::Read(aStream);
     if (NS_FAILED(rv)) return rv;
 
     NS_ASSERTION(!mMutable, "How did that happen?");
 
-    nsCOMPtr<nsISupports> supports;
-    rv = aStream->ReadObject(true, getter_AddRefs(supports));
-    if (NS_FAILED(rv)) return rv;
-
-    mInnerURI = do_QueryInterface(supports, &rv);
+    rv = aStream->ReadObject(true, getter_AddRefs(mInnerURI));
     if (NS_FAILED(rv)) return rv;
 
     NS_TryToSetImmutable(mInnerURI);
 
     return rv;
 }
 
 NS_IMETHODIMP
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -3968,23 +3968,20 @@ nsCookieService::RemoveCookiesForApp(uin
   nsCOMPtr<nsISimpleEnumerator> enumerator;
   nsresult rv = GetCookiesForApp(aAppId, aOnlyBrowserElement,
                                  getter_AddRefs(enumerator));
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore;
   while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
-    nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsICookie> cookie;
-    rv = enumerator->GetNext(getter_AddRefs(supports));
+    rv = enumerator->GetNext(getter_AddRefs(cookie));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    cookie = do_QueryInterface(supports);
-
     nsAutoCString host;
     cookie->GetHost(host);
 
     nsAutoCString name;
     cookie->GetName(name);
 
     nsAutoCString path;
     cookie->GetPath(path);
--- a/netwerk/streamconv/src/nsStreamConverterService.cpp
+++ b/netwerk/streamconv/src/nsStreamConverterService.cpp
@@ -92,36 +92,34 @@ nsStreamConverterService::BuildGraph() {
     nsCOMPtr<nsICategoryManager> catmgr(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsISimpleEnumerator> entries;
     rv = catmgr->EnumerateCategory(NS_ISTREAMCONVERTER_KEY, getter_AddRefs(entries));
     if (NS_FAILED(rv)) return rv;
 
     // go through each entry to build the graph
-    nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsISupportsCString> entry;
-    rv = entries->GetNext(getter_AddRefs(supports));
+    rv = entries->GetNext(getter_AddRefs(entry));
     while (NS_SUCCEEDED(rv)) {
-        entry = do_QueryInterface(supports);
 
         // get the entry string
         nsAutoCString entryString;
         rv = entry->GetData(entryString);
         if (NS_FAILED(rv)) return rv;
         
         // cobble the entry string w/ the converter key to produce a full contractID.
         nsAutoCString contractID(NS_ISTREAMCONVERTER_KEY);
         contractID.Append(entryString);
 
         // now we've got the CONTRACTID, let's parse it up.
         rv = AddAdjacency(contractID.get());
         if (NS_FAILED(rv)) return rv;
 
-        rv = entries->GetNext(getter_AddRefs(supports));
+        rv = entries->GetNext(getter_AddRefs(entry));
     }
 
     return NS_OK;
 }
 
 
 // XXX currently you can not add the same adjacency (i.e. you can't have multiple
 // XXX stream converters registering to handle the same from-to combination. It's
--- a/toolkit/components/intl/nsCharsetMenu.cpp
+++ b/toolkit/components/intl/nsCharsetMenu.cpp
@@ -605,19 +605,18 @@ nsresult nsCharsetMenu::RefreshMaileditM
   res = NewRDFContainer(mInner, kNC_MaileditCharsetMenuRoot, getter_AddRefs(container));
   NS_ENSURE_SUCCESS(res, res);
 
   nsCOMPtr<nsISimpleEnumerator> enumerator;
   res = container->GetElements(getter_AddRefs(enumerator));
   NS_ENSURE_SUCCESS(res, res);
 
   // clear the menu
-  nsCOMPtr<nsISupports> supports;
-  while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(supports)))) {
-    nsCOMPtr<nsIRDFNode> node = do_QueryInterface(supports);
+  nsCOMPtr<nsIRDFNode> node;
+  while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(node)))) {
 
     res = mInner->Unassert(kNC_MaileditCharsetMenuRoot, kNC_Name, node);
     NS_ENSURE_SUCCESS(res, res);
 
     res = container->RemoveElement(node, false);
     NS_ENSURE_SUCCESS(res, res);
   }
 
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -1960,19 +1960,18 @@ Database::Observe(nsISupports *aSubject,
     // the connection does not exist anymore.  Removing those observers would
     // be less expensive but may cause their RemoveObserver calls to throw.
     // Thus notify the topic now, so they stop listening for it.
     nsCOMPtr<nsISimpleEnumerator> e;
     if (NS_SUCCEEDED(os->EnumerateObservers(TOPIC_PLACES_INIT_COMPLETE,
                      getter_AddRefs(e))) && e) {
       bool hasMore = false;
       while (NS_SUCCEEDED(e->HasMoreElements(&hasMore)) && hasMore) {
-	nsCOMPtr<nsISupports> supports;
-        if (NS_SUCCEEDED(e->GetNext(getter_AddRefs(supports)))) {
-          nsCOMPtr<nsIObserver> observer = do_QueryInterface(supports);
+        nsCOMPtr<nsIObserver> observer;
+        if (NS_SUCCEEDED(e->GetNext(getter_AddRefs(observer)))) {
           (void)observer->Observe(observer, TOPIC_PLACES_INIT_COMPLETE, nullptr);
         }
       }
     }
 
     // Notify all Places users that we are about to shutdown.
     (void)os->NotifyObservers(nullptr, TOPIC_PLACES_SHUTDOWN, nullptr);
   }
--- a/toolkit/components/url-classifier/Classifier.cpp
+++ b/toolkit/components/url-classifier/Classifier.cpp
@@ -409,22 +409,20 @@ nsresult
 Classifier::ScanStoreDir(nsTArray<nsCString>& aTables)
 {
   nsCOMPtr<nsISimpleEnumerator> entries;
   nsresult rv = mStoreDirectory->GetDirectoryEntries(getter_AddRefs(entries));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore;
   while (NS_SUCCEEDED(rv = entries->HasMoreElements(&hasMore)) && hasMore) {
-    nsCOMPtr<nsISupports> supports;
-    rv = entries->GetNext(getter_AddRefs(supports));
+    nsCOMPtr<nsIFile> file;
+    rv = entries->GetNext(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<nsIFile> file = do_QueryInterface(supports);
-
     nsCString leafName;
     rv = file->GetNativeLeafName(leafName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCString suffix(NS_LITERAL_CSTRING(".sbstore"));
 
     int32_t dot = leafName.RFind(suffix, 0);
     if (dot != -1) {
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2001,30 +2001,29 @@ SetCurrentProfileAsDefault(nsIToolkitPro
   NS_ENSURE_ARG_POINTER(aProfileSvc);
 
   nsCOMPtr<nsISimpleEnumerator> profiles;
   nsresult rv = aProfileSvc->GetProfiles(getter_AddRefs(profiles));
   if (NS_FAILED(rv))
     return rv;
 
   bool foundMatchingProfile = false;
-  nsCOMPtr<nsISupports> supports;
-  rv = profiles->GetNext(getter_AddRefs(supports));
+  nsCOMPtr<nsIToolkitProfile> profile;
+  rv = profiles->GetNext(getter_AddRefs(profile));
   while (NS_SUCCEEDED(rv)) {
-    nsCOMPtr<nsIToolkitProfile> profile = do_QueryInterface(supports);
     nsCOMPtr<nsIFile> profileRoot;
     profile->GetRootDir(getter_AddRefs(profileRoot));
     profileRoot->Equals(aCurrentProfileRoot, &foundMatchingProfile);
     if (foundMatchingProfile && profile) {
       rv = aProfileSvc->SetSelectedProfile(profile);
       if (NS_SUCCEEDED(rv))
         rv = aProfileSvc->Flush();
       return rv;
     }
-    rv = profiles->GetNext(getter_AddRefs(supports));
+    rv = profiles->GetNext(getter_AddRefs(profile));
   }
   return rv;
 }
 
 static bool gDoMigration = false;
 static bool gDoProfileReset = false;
 
 // Pick a profile. We need to end up with a profile lock.
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -157,24 +157,21 @@ nsMemoryImpl::RunFlushers(const PRUnicha
         os->EnumerateObservers("memory-pressure", getter_AddRefs(e));
 
         if ( e ) {
           nsCOMPtr<nsIObserver> observer;
           bool loop = true;
 
           while (NS_SUCCEEDED(e->HasMoreElements(&loop)) && loop) 
           {
-              nsCOMPtr<nsISupports> supports;
-              e->GetNext(getter_AddRefs(supports));
+              e->GetNext(getter_AddRefs(observer));
 
-              if (!supports)
+              if (!observer)
                   continue;
 
-              observer = do_QueryInterface(supports);
-
               observer->Observe(observer, "memory-pressure", aReason);
           }
         }
     }
 
     sIsFlushing = 0;
     return NS_OK;
 }
--- a/xpcom/base/nsMemoryInfoDumper.cpp
+++ b/xpcom/base/nsMemoryInfoDumper.cpp
@@ -817,20 +817,18 @@ DumpProcessMemoryReportsToGZFileWriter(n
 
   // Process reporters.
   bool isFirst = true;
   bool more;
   nsCOMPtr<nsISimpleEnumerator> e;
   mgr->EnumerateReporters(getter_AddRefs(e));
   nsRefPtr<DumpReporterCallback> cb = new DumpReporterCallback(&isFirst);
   while (NS_SUCCEEDED(e->HasMoreElements(&more)) && more) {
-    nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsIMemoryReporter> r;
-    e->GetNext(getter_AddRefs(supports));
-    r = do_QueryInterface(supports);
+    e->GetNext(getter_AddRefs(r));
     r->CollectReports(cb, aWriter);
   }
 
   DUMP(aWriter, "\n  ]\n}\n");
 
   return NS_OK;
 }
 
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -1032,20 +1032,18 @@ nsMemoryReporterManager::GetExplicit(int
     // trouble than it was worth.
 
     nsRefPtr<ExplicitCallback> cb = new ExplicitCallback();
     nsRefPtr<Int64Wrapper> wrappedExplicitSize = new Int64Wrapper();
 
     nsCOMPtr<nsISimpleEnumerator> e;
     EnumerateReporters(getter_AddRefs(e));
     while (NS_SUCCEEDED(e->HasMoreElements(&more)) && more) {
-        nsCOMPtr<nsISupports> supports;
         nsCOMPtr<nsIMemoryReporter> r;
-        e->GetNext(getter_AddRefs(supports));
-        r = do_QueryInterface(supports);
+        e->GetNext(getter_AddRefs(r));
         r->CollectReports(cb, wrappedExplicitSize);
     }
 
     *aExplicit = wrappedExplicitSize->mValue;
 
     return NS_OK;
 #endif // HAVE_JEMALLOC_STATS
 }
@@ -1203,20 +1201,18 @@ RunReporters()
         do_GetService("@mozilla.org/memory-reporter-manager;1");
 
     nsRefPtr<NullReporterCallback> cb = new NullReporterCallback();
 
     bool more;
     nsCOMPtr<nsISimpleEnumerator> e;
     mgr->EnumerateReporters(getter_AddRefs(e));
     while (NS_SUCCEEDED(e->HasMoreElements(&more)) && more) {
-        nsCOMPtr<nsISupports> supports;
         nsCOMPtr<nsIMemoryReporter> r;
-        e->GetNext(getter_AddRefs(supports));
-        r = do_QueryInterface(supports);
+        e->GetNext(getter_AddRefs(r));
         r->CollectReports(cb, nullptr);
     }
 }
 
 } // namespace dmd
 } // namespace mozilla
 
 #endif  // defined(MOZ_DMD)
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -1328,22 +1328,22 @@ class nsGetterAddRefs
 #endif
         }
 #endif
 
       operator void**()
         {
           return reinterpret_cast<void**>(mTargetSmartPtr.StartAssignment());
         }
-    /*
+
       operator nsISupports**()
         {
           return reinterpret_cast<nsISupports**>(mTargetSmartPtr.StartAssignment());
         }
-    */
+
       operator T**()
         {
           return mTargetSmartPtr.StartAssignment();
         }
 
       T*&
       operator*()
         {
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -665,21 +665,19 @@ nsLocalFile::CopyDirectoryTo(nsIFile *ne
     }
 
     nsCOMPtr<nsISimpleEnumerator> dirIterator;
     if (NS_FAILED(rv = GetDirectoryEntries(getter_AddRefs(dirIterator))))
         return rv;
 
     bool hasMore = false;
     while (dirIterator->HasMoreElements(&hasMore), hasMore) {
-        nsCOMPtr<nsISupports> supports;
         nsCOMPtr<nsIFile> entry;
-        rv = dirIterator->GetNext(getter_AddRefs(supports));
-        entry = do_QueryInterface(supports);
-        if (NS_FAILED(rv) || !entry)
+        rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(entry));
+        if (NS_FAILED(rv)) 
             continue;
         if (NS_FAILED(rv = entry->IsSymlink(&isSymlink)))
             return rv;
         if (NS_FAILED(rv = entry->IsDirectory(&dirCheck)))
             return rv;
         if (dirCheck && !isSymlink) {
             nsCOMPtr<nsIFile> destClone;
             rv = newParent->Clone(getter_AddRefs(destClone));
--- a/xpcom/tests/TestCOMPtr.cpp
+++ b/xpcom/tests/TestCOMPtr.cpp
@@ -538,16 +538,17 @@ main()
 		}
     printf("### End Test 24\n");
 
 		{
 			nsCOMPtr<IFoo> fooP;
 
 			AnIFooPtrPtrContext( getter_AddRefs(fooP) );
 			AVoidPtrPtrContext( getter_AddRefs(fooP) );
+			AnISupportsPtrPtrContext( getter_AddRefs(fooP) );
 		}
 
 
 		{
 			nsCOMPtr<nsISupports> supportsP;
 
 			AVoidPtrPtrContext( getter_AddRefs(supportsP) );
 			AnISupportsPtrPtrContext( getter_AddRefs(supportsP) );
--- a/xpcom/tests/TestObserverService.cpp
+++ b/xpcom/tests/TestObserverService.cpp
@@ -115,19 +115,17 @@ int main(int argc, char *argv[])
         testResult(rv);
 
         printf("Enumerating observers of topic-A...\n");
         if ( e ) {
           nsCOMPtr<nsIObserver> observer;
           bool loop = true;
           while( NS_SUCCEEDED(e->HasMoreElements(&loop)) && loop) 
           {
-              nsCOMPtr<nsISupports> supports;
-              e->GetNext(getter_AddRefs(supports));
-              observer = do_QueryInterface(supports);
+              e->GetNext(getter_AddRefs(observer));
               printf("Calling observe on enumerated observer ");
               printString(reinterpret_cast<TestObserver*>
                                           (reinterpret_cast<void*>(observer.get()))->mName);
               printf("...\n");
               rv = observer->Observe( observer, 
                                       topicA.get(), 
                                       NS_LITERAL_STRING("during enumeration").get() );
               testResult(rv);
--- a/xpfe/components/windowds/nsWindowDataSource.cpp
+++ b/xpfe/components/windowds/nsWindowDataSource.cpp
@@ -191,22 +191,19 @@ nsWindowDataSource::OnOpenWindow(nsIXULW
 NS_IMETHODIMP
 nsWindowDataSource::OnCloseWindow(nsIXULWindow *window)
 {
     nsVoidKey key(window);
     nsCOMPtr<nsIRDFResource> resource;
 
     nsresult rv;
 
-    nsCOMPtr<nsISupports> supports;
-    if (!mWindowResources.Remove(&key, getter_AddRefs(supports)))
+    if (!mWindowResources.Remove(&key, getter_AddRefs(resource)))
         return NS_ERROR_UNEXPECTED;
 
-    resource = do_QueryInterface(supports);
-
     // make sure we're not shutting down
     if (!mContainer) return NS_OK;
     
     nsCOMPtr<nsIRDFNode> oldKeyNode;
     nsCOMPtr<nsIRDFInt> oldKeyInt;
     
     // get the old keyIndex, if any
     rv = GetTarget(resource, kNC_KeyIndex, true,