From 1c1e0c7bb41f648d993732c2453cc8d86014e778 Mon Sep 17 00:00:00 2001 From: "caillon%returnzero.com" Date: Sat, 21 Jun 2003 00:15:41 +0000 Subject: [PATCH] Bug 209852. Remove |dont_QueryInterface|. r=dbaron, sr=jag git-svn-id: svn://10.0.0.236/trunk@144011 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocumentViewer.cpp | 2 +- mozilla/content/base/src/nsSelection.cpp | 2 +- .../content/xul/content/src/nsXULElement.cpp | 2 +- .../xul/document/src/nsXULContentSink.cpp | 2 +- .../xul/document/src/nsXULDocument.cpp | 4 ++-- .../xul/templates/src/nsXULContentBuilder.cpp | 2 +- .../embedding/qa/mozembed/src/mozEmbed.cpp | 2 +- mozilla/embedding/tests/os2Embed/os2Embed.cpp | 2 +- mozilla/embedding/tests/winEmbed/winEmbed.cpp | 2 +- .../webclient/src_moz/NativeEventThread.cpp | 2 +- mozilla/layout/base/nsDocumentViewer.cpp | 2 +- mozilla/layout/generic/nsSelection.cpp | 2 +- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 2 +- .../base/src/nsCopyMessageStreamListener.cpp | 6 +++--- mozilla/mailnews/base/src/nsMsgAccount.cpp | 4 ++-- .../base/src/nsMsgAccountManagerDS.cpp | 4 ++-- mozilla/mailnews/base/util/nsMsgProtocol.cpp | 4 ++-- mozilla/mailnews/compose/src/nsSmtpUrl.cpp | 4 ++-- mozilla/mailnews/imap/src/nsImapProtocol.cpp | 4 ++-- mozilla/mailnews/imap/src/nsImapUrl.cpp | 4 ++-- mozilla/mailnews/local/src/nsMailboxUrl.cpp | 6 +++--- mozilla/mailnews/local/src/nsParseMailbox.cpp | 2 +- mozilla/mailnews/local/src/nsParseMailbox.h | 2 +- mozilla/mailnews/local/src/nsPop3URL.cpp | 2 +- mozilla/mailnews/news/src/nsNntpUrl.cpp | 2 +- .../rdf/base/src/nsCompositeDataSource.cpp | 6 ++---- .../rdf/base/src/nsContainerEnumerator.cpp | 6 +++--- mozilla/rdf/base/src/nsInMemoryDataSource.cpp | 6 ++---- mozilla/rdf/base/src/nsRDFContentSink.cpp | 2 +- mozilla/webshell/tests/viewer/nsViewerApp.cpp | 2 +- mozilla/xpcom/glue/nsCOMPtr.h | 19 ------------------- mozilla/xpcom/io/nsLocalFileUnix.cpp | 2 +- mozilla/xpcom/tests/TestCOMPtr.cpp | 16 ++-------------- .../related/src/nsRelatedLinksHandler.cpp | 2 +- 34 files changed, 49 insertions(+), 84 deletions(-) diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 069457d7fbd..410f75a3e11 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -803,7 +803,7 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget, nsresult rv = NS_OK; NS_ENSURE_TRUE(mDocument, NS_ERROR_NULL_POINTER); - mDeviceContext = dont_QueryInterface(aDeviceContext); + mDeviceContext = aDeviceContext; #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW) // Clear PrintPreview Alternate Device diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index 10e7435e64b..8a493765e39 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -4929,7 +4929,7 @@ nsTypedSelection::GetPrimaryFrameForRangeEndpoint(nsIDOMNode *aNode, PRInt32 aOf nsresult result = NS_OK; - nsCOMPtr node = dont_QueryInterface(aNode); + nsCOMPtr node = aNode; if (!node) return NS_ERROR_NULL_POINTER; diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index c78a9fd8766..c30efb95afa 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -4209,7 +4209,7 @@ nsXULElement::GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement) PRBool nsXULElement::IsAncestor(nsIDOMNode* aParentNode, nsIDOMNode* aChildNode) { - nsCOMPtr parent = dont_QueryInterface(aChildNode); + nsCOMPtr parent = aChildNode; while (parent && (parent != aParentNode)) { nsCOMPtr newParent; parent->GetParentNode(getter_AddRefs(newParent)); diff --git a/mozilla/content/xul/document/src/nsXULContentSink.cpp b/mozilla/content/xul/document/src/nsXULContentSink.cpp index 498ca568e63..c9a89ee3a87 100644 --- a/mozilla/content/xul/document/src/nsXULContentSink.cpp +++ b/mozilla/content/xul/document/src/nsXULContentSink.cpp @@ -1208,7 +1208,7 @@ XULContentSinkImpl::GetTopNameSpace(nsCOMPtr* aNameSpace) if (count == 0) return NS_ERROR_UNEXPECTED; - *aNameSpace = dont_QueryInterface(NS_REINTERPRET_CAST(nsINameSpace*, mNameSpaceStack[count - 1])); + *aNameSpace = NS_REINTERPRET_CAST(nsINameSpace*, mNameSpaceStack[count - 1]); return NS_OK; } diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 0884e5e3604..89f3ca05b1b 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1822,7 +1822,7 @@ nsXULDocument::GetTooltipNode(nsIDOMNode** aNode) NS_IMETHODIMP nsXULDocument::SetTooltipNode(nsIDOMNode* aNode) { - mTooltipNode = dont_QueryInterface(aNode); + mTooltipNode = aNode; return NS_OK; } @@ -2695,7 +2695,7 @@ PRBool nsXULDocument::ContextStack::IsInsideXULTemplate() { if (mDepth) { - nsCOMPtr element = dont_QueryInterface(mTop->mElement); + nsCOMPtr element = mTop->mElement; while (element) { PRInt32 nameSpaceID; element->GetNameSpaceID(&nameSpaceID); diff --git a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp index f9d9ce24395..725c11cad60 100644 --- a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp @@ -94,7 +94,7 @@ IsElementInBuilder(nsIContent *aContent, nsIXULTemplateBuilder *aBuilder) if (! xuldoc) return PR_FALSE; - nsCOMPtr content = dont_QueryInterface(aContent); + nsCOMPtr content = aContent; do { nsCOMPtr builder; xuldoc->GetTemplateBuilderFor(content, getter_AddRefs(builder)); diff --git a/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp b/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp index 1f4a5df76ad..6b0f36c51e1 100644 --- a/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp +++ b/mozilla/embedding/qa/mozembed/src/mozEmbed.cpp @@ -311,7 +311,7 @@ nsresult InitializeWindowCreator() WindowCreator *creatorCallback = new WindowCreator(); if (creatorCallback) { - nsCOMPtr windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback))); + nsCOMPtr windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback)); if (windowCreator) { nsCOMPtr wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); diff --git a/mozilla/embedding/tests/os2Embed/os2Embed.cpp b/mozilla/embedding/tests/os2Embed/os2Embed.cpp index 733fe87c445..0d2d6af93ad 100644 --- a/mozilla/embedding/tests/os2Embed/os2Embed.cpp +++ b/mozilla/embedding/tests/os2Embed/os2Embed.cpp @@ -269,7 +269,7 @@ nsresult InitializeWindowCreator() WindowCreator *creatorCallback = new WindowCreator(); if (creatorCallback) { - nsCOMPtr windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback))); + nsCOMPtr windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback)); if (windowCreator) { nsCOMPtr wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)); diff --git a/mozilla/embedding/tests/winEmbed/winEmbed.cpp b/mozilla/embedding/tests/winEmbed/winEmbed.cpp index f45750557c2..7551fd91853 100644 --- a/mozilla/embedding/tests/winEmbed/winEmbed.cpp +++ b/mozilla/embedding/tests/winEmbed/winEmbed.cpp @@ -293,7 +293,7 @@ nsresult InitializeWindowCreator() WindowCreator *creatorCallback = new WindowCreator(); if (creatorCallback) { - nsCOMPtr windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback))); + nsCOMPtr windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback)); if (windowCreator) { nsCOMPtr wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)); diff --git a/mozilla/java/webclient/src_moz/NativeEventThread.cpp b/mozilla/java/webclient/src_moz/NativeEventThread.cpp index fcf26860d95..21c293df70d 100644 --- a/mozilla/java/webclient/src_moz/NativeEventThread.cpp +++ b/mozilla/java/webclient/src_moz/NativeEventThread.cpp @@ -481,7 +481,7 @@ nsresult InitializeWindowCreator(WebShellInitContext * initContext) gCreatorCallback = new WindowCreator(initContext); if (gCreatorCallback) { - nsCOMPtr windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, gCreatorCallback))); + nsCOMPtr windowCreator(NS_STATIC_CAST(nsIWindowCreator *, gCreatorCallback)); if (windowCreator) { nsCOMPtr wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)); diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 069457d7fbd..410f75a3e11 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -803,7 +803,7 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget, nsresult rv = NS_OK; NS_ENSURE_TRUE(mDocument, NS_ERROR_NULL_POINTER); - mDeviceContext = dont_QueryInterface(aDeviceContext); + mDeviceContext = aDeviceContext; #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW) // Clear PrintPreview Alternate Device diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 10e7435e64b..8a493765e39 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -4929,7 +4929,7 @@ nsTypedSelection::GetPrimaryFrameForRangeEndpoint(nsIDOMNode *aNode, PRInt32 aOf nsresult result = NS_OK; - nsCOMPtr node = dont_QueryInterface(aNode); + nsCOMPtr node = aNode; if (!node) return NS_ERROR_NULL_POINTER; diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 2449b009af8..1ede27debe6 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1659,7 +1659,7 @@ nsMenuFrame::Execute(nsGUIEvent *aEvent) } // Get our own content node and hold on to it to keep it from going away. - nsCOMPtr content = dont_QueryInterface(mContent); + nsCOMPtr content = mContent; // Deselect ourselves. SelectMenu(PR_FALSE); diff --git a/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp b/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp index 0dbf31db396..8ecbcdea44f 100644 --- a/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp +++ b/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp @@ -104,9 +104,9 @@ nsCopyMessageStreamListener::~nsCopyMessageStreamListener() NS_IMETHODIMP nsCopyMessageStreamListener::Init(nsIMsgFolder *srcFolder, nsICopyMessageListener *destination, nsISupports *listenerData) { - mSrcFolder = dont_QueryInterface(srcFolder); - mDestination = dont_QueryInterface(destination); - mListenerData = dont_QueryInterface(listenerData); + mSrcFolder = srcFolder; + mDestination = destination; + mListenerData = listenerData; return NS_OK; } diff --git a/mozilla/mailnews/base/src/nsMsgAccount.cpp b/mozilla/mailnews/base/src/nsMsgAccount.cpp index 63c3dc655b1..2a151a7ecf0 100644 --- a/mozilla/mailnews/base/src/nsMsgAccount.cpp +++ b/mozilla/mailnews/base/src/nsMsgAccount.cpp @@ -184,7 +184,7 @@ nsMsgAccount::SetIncomingServer(nsIMsgIncomingServer * aIncomingServer) m_prefs->SetCharPref(serverPrefName.get(), key); } - m_incomingServer = dont_QueryInterface(aIncomingServer); + m_incomingServer = aIncomingServer; nsCOMPtr accountManager = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv); @@ -295,7 +295,7 @@ nsMsgAccount::SetDefaultIdentity(nsIMsgIdentity * aDefaultIdentity) if (m_identities->IndexOf(aDefaultIdentity) == -1) return NS_ERROR_UNEXPECTED; - m_defaultIdentity = dont_QueryInterface(aDefaultIdentity); + m_defaultIdentity = aDefaultIdentity; return NS_OK; } diff --git a/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp b/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp index d04bc93ac3e..25819a0c5e6 100644 --- a/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp +++ b/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp @@ -879,8 +879,8 @@ nsMsgAccountManagerDataSource::createServerResources(nsISupports *element, nsresult rv; // get parameters out of the data argument serverCreationParams *params = (serverCreationParams*)data; - nsCOMPtr servers = dont_QueryInterface(params->serverArray); - nsCOMPtr rdf = dont_QueryInterface(params->rdfService); + nsCOMPtr servers = params->serverArray; + nsCOMPtr rdf = params->rdfService; // the server itself is in the element argument nsCOMPtr server = do_QueryInterface(element, &rv); diff --git a/mozilla/mailnews/base/util/nsMsgProtocol.cpp b/mozilla/mailnews/base/util/nsMsgProtocol.cpp index 3398b37f1dd..ec96e75ec20 100644 --- a/mozilla/mailnews/base/util/nsMsgProtocol.cpp +++ b/mozilla/mailnews/base/util/nsMsgProtocol.cpp @@ -491,13 +491,13 @@ nsresult nsMsgProtocol::LoadUrl(nsIURI * aURL, nsISupports * aConsumer) nsresult nsMsgProtocol::SetUrl(nsIURI * aURL) { - m_url = dont_QueryInterface(aURL); + m_url = aURL; return NS_OK; } NS_IMETHODIMP nsMsgProtocol::SetLoadGroup(nsILoadGroup * aLoadGroup) { - m_loadGroup = dont_QueryInterface(aLoadGroup); + m_loadGroup = aLoadGroup; return NS_OK; } diff --git a/mozilla/mailnews/compose/src/nsSmtpUrl.cpp b/mozilla/mailnews/compose/src/nsSmtpUrl.cpp index 6b838975880..02eb7fcdc63 100644 --- a/mozilla/mailnews/compose/src/nsSmtpUrl.cpp +++ b/mozilla/mailnews/compose/src/nsSmtpUrl.cpp @@ -571,7 +571,7 @@ NS_IMETHODIMP nsSmtpUrl::SetPostMessageFile(nsIFileSpec * aFileSpec) { nsresult rv = NS_OK; if (aFileSpec) - m_fileName = dont_QueryInterface(aFileSpec); + m_fileName = aFileSpec; else rv = NS_ERROR_NULL_POINTER; @@ -607,7 +607,7 @@ nsSmtpUrl::SetSenderIdentity(nsIMsgIdentity * aSenderIdentity) { NS_ENSURE_ARG_POINTER(aSenderIdentity); - m_senderIdentity = dont_QueryInterface(aSenderIdentity); + m_senderIdentity = aSenderIdentity; return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index a9b0bd20659..603966987db 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -478,7 +478,7 @@ nsresult nsImapProtocol::Initialize(nsIImapHostSessionList * aHostSessionList, n NS_ADDREF(m_flagState); - m_sinkEventQueue = dont_QueryInterface(aSinkEventQueue); + m_sinkEventQueue = aSinkEventQueue; m_hostSessionList = aHostSessionList; // no ref count...host session list has life time > connection m_parser.SetHostSessionList(aHostSessionList); m_parser.SetFlagState(m_flagState); @@ -7666,7 +7666,7 @@ NS_IMETHODIMP nsImapMockChannel::GetChannelContext(nsISupports **aChannelContex NS_IMETHODIMP nsImapMockChannel::SetLoadGroup(nsILoadGroup * aLoadGroup) { - m_loadGroup = dont_QueryInterface(aLoadGroup); + m_loadGroup = aLoadGroup; return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapUrl.cpp b/mozilla/mailnews/imap/src/nsImapUrl.cpp index 47d1cf0b97c..25e37c6b67f 100644 --- a/mozilla/mailnews/imap/src/nsImapUrl.cpp +++ b/mozilla/mailnews/imap/src/nsImapUrl.cpp @@ -1231,7 +1231,7 @@ NS_IMETHODIMP nsImapUrl::GetMockChannel(nsIImapMockChannel ** aChannel) NS_IMETHODIMP nsImapUrl::SetMockChannel(nsIImapMockChannel * aChannel) { nsresult rv = NS_OK; - m_mockChannel = dont_QueryInterface(aChannel); + m_mockChannel = aChannel; return rv; } @@ -1369,7 +1369,7 @@ NS_IMETHODIMP nsImapUrl::SetMsgLoadingFromCache(PRBool loadingFromCache) NS_IMETHODIMP nsImapUrl::SetMessageFile(nsIFileSpec * aFileSpec) { - m_messageFileSpec = dont_QueryInterface(aFileSpec); + m_messageFileSpec = aFileSpec; return NS_OK; } diff --git a/mozilla/mailnews/local/src/nsMailboxUrl.cpp b/mozilla/mailnews/local/src/nsMailboxUrl.cpp index fe63a58292c..2b542ea5d1f 100644 --- a/mozilla/mailnews/local/src/nsMailboxUrl.cpp +++ b/mozilla/mailnews/local/src/nsMailboxUrl.cpp @@ -174,7 +174,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsMsgMailNewsUrl) nsresult nsMailboxUrl::SetMailboxParser(nsIStreamListener * aMailboxParser) { if (aMailboxParser) - m_mailboxParser = dont_QueryInterface(aMailboxParser); + m_mailboxParser = aMailboxParser; return NS_OK; } @@ -190,7 +190,7 @@ nsresult nsMailboxUrl::GetMailboxParser(nsIStreamListener ** aConsumer) nsresult nsMailboxUrl::SetMailboxCopyHandler(nsIStreamListener * aMailboxCopyHandler) { if (aMailboxCopyHandler) - m_mailboxCopyHandler = dont_QueryInterface(aMailboxCopyHandler); + m_mailboxCopyHandler = aMailboxCopyHandler; return NS_OK; } @@ -324,7 +324,7 @@ nsMailboxUrl::SetOriginalSpec(const char *aSpec) NS_IMETHODIMP nsMailboxUrl::SetMessageFile(nsIFileSpec * aFileSpec) { - m_messageFileSpec = dont_QueryInterface(aFileSpec); + m_messageFileSpec = aFileSpec; return NS_OK; } diff --git a/mozilla/mailnews/local/src/nsParseMailbox.cpp b/mozilla/mailnews/local/src/nsParseMailbox.cpp index 8e86abebbae..451a5212895 100644 --- a/mozilla/mailnews/local/src/nsParseMailbox.cpp +++ b/mozilla/mailnews/local/src/nsParseMailbox.cpp @@ -608,7 +608,7 @@ PRInt32 nsParseMailMessageState::ParseFolderLine(const char *line, PRUint32 line NS_IMETHODIMP nsParseMailMessageState::SetMailDB(nsIMsgDatabase *mailDB) { - m_mailDB = dont_QueryInterface(mailDB); + m_mailDB = mailDB; return NS_OK; } diff --git a/mozilla/mailnews/local/src/nsParseMailbox.h b/mozilla/mailnews/local/src/nsParseMailbox.h index 0f503ef9cb0..06f5ed43b45 100644 --- a/mozilla/mailnews/local/src/nsParseMailbox.h +++ b/mozilla/mailnews/local/src/nsParseMailbox.h @@ -177,7 +177,7 @@ public: NS_DECL_NSISTREAMLISTENER NS_DECL_NSIDBCHANGELISTENER - void SetDB (nsIMsgDatabase *mailDB) {m_mailDB = dont_QueryInterface(mailDB); } + void SetDB (nsIMsgDatabase *mailDB) {m_mailDB = mailDB; } // message socket libnet callbacks, which come through folder pane virtual int ProcessMailboxInputStream(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength); diff --git a/mozilla/mailnews/local/src/nsPop3URL.cpp b/mozilla/mailnews/local/src/nsPop3URL.cpp index ec184868a54..855e8b6ee11 100644 --- a/mozilla/mailnews/local/src/nsPop3URL.cpp +++ b/mozilla/mailnews/local/src/nsPop3URL.cpp @@ -65,7 +65,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsPop3URL, nsMsgMailNewsUrl, nsIPop3URL) nsresult nsPop3URL::SetPop3Sink(nsIPop3Sink* aPop3Sink) { if (aPop3Sink) - m_pop3Sink = dont_QueryInterface(aPop3Sink); + m_pop3Sink = aPop3Sink; return NS_OK; } diff --git a/mozilla/mailnews/news/src/nsNntpUrl.cpp b/mozilla/mailnews/news/src/nsNntpUrl.cpp index 053eac201b4..7c54271973a 100644 --- a/mozilla/mailnews/news/src/nsNntpUrl.cpp +++ b/mozilla/mailnews/news/src/nsNntpUrl.cpp @@ -229,7 +229,7 @@ NS_IMPL_GETSET(nsNntpUrl, CanonicalLineEnding, PRBool, m_canonicalLineEnding); NS_IMETHODIMP nsNntpUrl::SetMessageFile(nsIFileSpec * aFileSpec) { - m_messageFileSpec = dont_QueryInterface(aFileSpec); + m_messageFileSpec = aFileSpec; return NS_OK; } diff --git a/mozilla/rdf/base/src/nsCompositeDataSource.cpp b/mozilla/rdf/base/src/nsCompositeDataSource.cpp index 5ee95c1c034..28973869006 100644 --- a/mozilla/rdf/base/src/nsCompositeDataSource.cpp +++ b/mozilla/rdf/base/src/nsCompositeDataSource.cpp @@ -466,8 +466,7 @@ CompositeArcsInOutEnumeratorImpl::Destroy() { // Keep the datasource alive for the duration of the stack // frame so its allocator stays valid. - nsCOMPtr kungFuDeathGrip = - dont_QueryInterface(mCompositeDataSource); + nsCOMPtr kungFuDeathGrip = mCompositeDataSource; nsFixedSizeAllocator& pool = mCompositeDataSource->mAllocator; this->~CompositeArcsInOutEnumeratorImpl(); @@ -597,8 +596,7 @@ CompositeAssertionEnumeratorImpl::Destroy() { // Keep the datasource alive for the duration of the stack // frame so its allocator stays valid. - nsCOMPtr kungFuDeathGrip = - dont_QueryInterface(mCompositeDataSource); + nsCOMPtr kungFuDeathGrip = mCompositeDataSource; nsFixedSizeAllocator& pool = mCompositeDataSource->mAllocator; this->~CompositeAssertionEnumeratorImpl(); diff --git a/mozilla/rdf/base/src/nsContainerEnumerator.cpp b/mozilla/rdf/base/src/nsContainerEnumerator.cpp index 59344dbba5a..bc047a4e3ae 100644 --- a/mozilla/rdf/base/src/nsContainerEnumerator.cpp +++ b/mozilla/rdf/base/src/nsContainerEnumerator.cpp @@ -107,10 +107,10 @@ nsIRDFContainerUtils* ContainerEnumeratorImpl::gRDFC; ContainerEnumeratorImpl::ContainerEnumeratorImpl(nsIRDFDataSource* aDataSource, nsIRDFResource* aContainer) - : mNextIndex(1) + : mDataSource(aDataSource), + mContainer(aContainer), + mNextIndex(1) { - mDataSource = dont_QueryInterface(aDataSource); - mContainer = dont_QueryInterface(aContainer); } nsresult diff --git a/mozilla/rdf/base/src/nsInMemoryDataSource.cpp b/mozilla/rdf/base/src/nsInMemoryDataSource.cpp index da189afc47d..3fd6eaf290a 100644 --- a/mozilla/rdf/base/src/nsInMemoryDataSource.cpp +++ b/mozilla/rdf/base/src/nsInMemoryDataSource.cpp @@ -456,8 +456,7 @@ public: Destroy(InMemoryAssertionEnumeratorImpl* aEnumerator) { // Keep the datasource alive for the duration of the stack // frame so its allocator stays valid. - nsCOMPtr kungFuDeathGrip = - dont_QueryInterface(aEnumerator->mDataSource); + nsCOMPtr kungFuDeathGrip = aEnumerator->mDataSource; // Grab the pool from the datasource; since we keep the // datasource alive, this has to be safe. @@ -662,8 +661,7 @@ public: Destroy(InMemoryArcsEnumeratorImpl* aEnumerator) { // Keep the datasource alive for the duration of the stack // frame so its allocator stays valid. - nsCOMPtr kungFuDeathGrip = - dont_QueryInterface(aEnumerator->mDataSource); + nsCOMPtr kungFuDeathGrip = aEnumerator->mDataSource; // Grab the pool from the datasource; since we keep the // datasource alive, this has to be safe. diff --git a/mozilla/rdf/base/src/nsRDFContentSink.cpp b/mozilla/rdf/base/src/nsRDFContentSink.cpp index f8109e45a94..26f76e7a6c2 100644 --- a/mozilla/rdf/base/src/nsRDFContentSink.cpp +++ b/mozilla/rdf/base/src/nsRDFContentSink.cpp @@ -726,7 +726,7 @@ NS_IMETHODIMP RDFContentSinkImpl::SetDataSource(nsIRDFDataSource* aDataSource) { NS_PRECONDITION(aDataSource != nsnull, "SetDataSource null ptr"); - mDataSource = dont_QueryInterface(aDataSource); + mDataSource = aDataSource; NS_ASSERTION(mDataSource != nsnull,"Couldn't QI RDF DataSource"); return NS_OK; } diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.cpp b/mozilla/webshell/tests/viewer/nsViewerApp.cpp index b296fcb62eb..062506e563d 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.cpp +++ b/mozilla/webshell/tests/viewer/nsViewerApp.cpp @@ -340,7 +340,7 @@ nsViewerApp::InitializeWindowCreator() // create an nsWindowCreator and give it to the WindowWatcher service nsWindowCreator *creatorCallback = new nsWindowCreator(this); if (creatorCallback) { - nsCOMPtr windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback))); + nsCOMPtr windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback)); if (windowCreator) { nsCOMPtr wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)); if (wwatch) { diff --git a/mozilla/xpcom/glue/nsCOMPtr.h b/mozilla/xpcom/glue/nsCOMPtr.h index ffe89ee234a..c13239bb22e 100644 --- a/mozilla/xpcom/glue/nsCOMPtr.h +++ b/mozilla/xpcom/glue/nsCOMPtr.h @@ -305,25 +305,6 @@ dont_AddRef( const already_AddRefed aAlreadyAddRefedPtr ) - - /* - There used to be machinery to allow |dont_QueryInterface()| to work, but - since it is now equivalent to using a raw pointer ... all that machinery - has gone away. For pointer arguments, the following definition should - optimize away. This is better than using a |#define| because it is - scoped. - */ - -template -inline -T* -dont_QueryInterface( T* expr ) - { - return expr; - } - - - class nsCOMPtr_helper /* An |nsCOMPtr_helper| transforms commonly called getters into typesafe forms diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 58eee0008a3..cef0e3c7868 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -1415,7 +1415,7 @@ nsLocalFile::GetNativeTarget(nsACString &_retval) nsresult rv; PRBool isSymlink; - nsCOMPtr self(dont_QueryInterface(this)); + nsCOMPtr self(this); nsCOMPtr parent; while (NS_SUCCEEDED(rv = self->GetParent(getter_AddRefs(parent)))) { NS_ASSERTION(parent != nsnull, "no parent?!"); diff --git a/mozilla/xpcom/tests/TestCOMPtr.cpp b/mozilla/xpcom/tests/TestCOMPtr.cpp index 9cffaa832c3..98370967bfd 100644 --- a/mozilla/xpcom/tests/TestCOMPtr.cpp +++ b/mozilla/xpcom/tests/TestCOMPtr.cpp @@ -507,7 +507,7 @@ main() #if 1 cout << endl << "### Test 11.5: can you compare a |nsCOMPtr| with a raw interface pointer [==]?" << endl; - if ( nsCOMPtr( dont_QueryInterface(raw_foo2p) ) == foo2p ) + if ( nsCOMPtr( raw_foo2p ) == foo2p ) cout << "raw_foo2p == foo2p" << endl; else cout << "raw_foo2p != foo2p" << endl; @@ -619,18 +619,6 @@ main() cout << "### End Test 23" << endl; - { - cout << endl << "### setup for Test 24" << endl; - nsCOMPtr fooP; - IFoo* rawFooP = new IFoo; - - cout << "### Test 24: is |QueryInterface| _not_ called when explicitly barred?" << endl; - fooP = dont_QueryInterface(rawFooP); - cout << "### cleanup for Test 24" << endl; - } - cout << "### End Test 24" << endl; - - { nsCOMPtr fooP; @@ -648,7 +636,7 @@ main() } - cout << endl << "### Test 25: will a static |nsCOMPtr| |Release| before program termination?" << endl; + cout << endl << "### Test 24: will a static |nsCOMPtr| |Release| before program termination?" << endl; gFoop = do_QueryInterface(new IFoo); cout << "<