Bug 213602: Switch some users of NS_GetWeakReference over to do_GetWeakReference. r=bzbarsky, sr=dbaron

This commit is contained in:
jaggernaut%netscape.com 2003-07-25 19:06:59 +00:00
parent 47c65ca78c
commit 95899387f6
86 changed files with 140 additions and 143 deletions

View File

@ -681,9 +681,8 @@ nsAppRootAccessible::AddRootAccessible(nsRootAccessibleWrap *aRootAccWrap)
NS_ENSURE_ARG_POINTER(aRootAccWrap);
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleDocument> docAcc;
rv = aRootAccWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
getter_AddRefs(docAcc));
nsCOMPtr<nsIAccessibleDocument> docAcc =
do_QueryInterface(aRootAccWrap, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// add by weak reference
@ -711,14 +710,13 @@ nsAppRootAccessible::RemoveRootAccessible(nsRootAccessibleWrap *aRootAccWrap)
PRUint32 index = 0;
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleDocument> docAcc;
rv = aRootAccWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
getter_AddRefs(docAcc));
nsCOMPtr<nsIAccessibleDocument> docAcc =
do_QueryInterface(aRootAccWrap, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// we must use weak ref to get the index
nsCOMPtr<nsIWeakReference> weakPtr =
getter_AddRefs(NS_GetWeakReference(docAcc));
do_GetWeakReference(docAcc);
rv = mChildren->IndexOf(0, weakPtr, &index);
#ifdef MAI_LOGGING

View File

@ -731,7 +731,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup)
mDocumentBaseURL = mDocumentURL;
if (aLoadGroup) {
mDocumentLoadGroup = getter_AddRefs(NS_GetWeakReference(aLoadGroup));
mDocumentLoadGroup = do_GetWeakReference(aLoadGroup);
// there was an assertion here that aLoadGroup was not null. This
// is no longer valid nsWebShell::SetDocument does not create a
// load group, and it works just fine.
@ -4102,7 +4102,7 @@ nsDocument::RemoveReference(void *aKey, nsISupports **aOldReference)
NS_IMETHODIMP
nsDocument::SetContainer(nsISupports *aContainer)
{
mDocumentContainer = dont_AddRef(NS_GetWeakReference(aContainer));
mDocumentContainer = do_GetWeakReference(aContainer);
return NS_OK;
}

View File

@ -4703,7 +4703,7 @@ NS_IMPL_RELEASE(nsTypedSelection)
NS_IMETHODIMP
nsTypedSelection::SetPresShell(nsIPresShell *aPresShell)
{
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShellWeak = do_GetWeakReference(aPresShell);
return NS_OK;
}
@ -7035,7 +7035,7 @@ nsTypedSelection::GetPresShell(nsIPresShell **aPresShell)
nsCOMPtr<nsIPresShell> shell;
rv = presContext->GetShell(getter_AddRefs(shell));
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(shell)); // the presshell owns us, so no addref
mPresShellWeak = do_GetWeakReference(shell); // the presshell owns us, so no addref
if (mPresShellWeak)
NS_ADDREF(*aPresShell = shell);
return rv;

View File

@ -154,7 +154,7 @@ nsComputedDOMStyle::Init(nsIDOMElement *aElement,
NS_ENSURE_ARG_POINTER(aElement);
NS_ENSURE_ARG_POINTER(aPresShell);
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShellWeak = do_GetWeakReference(aPresShell);
mContent = do_QueryInterface(aElement);
if (!mContent) {

View File

@ -128,7 +128,7 @@ nsSVGLength::nsSVGLength(float value,
nsresult nsSVGLength::Init(nsIDOMSVGElement* owner)
{
NS_ASSERTION(owner, "need owner");
mOwnerElementRef = NS_GetWeakReference(owner);
mOwnerElementRef = do_GetWeakReference(owner);
NS_ENSURE_TRUE(mOwnerElementRef, NS_ERROR_FAILURE);
return NS_OK;
}

View File

@ -236,7 +236,7 @@ nsXBLPrototypeBinding::nsXBLPrototypeBinding(const nsACString& aID,
mID = ToNewCString(aID);
mXBLDocInfoWeak = getter_AddRefs(NS_GetWeakReference(aInfo));
mXBLDocInfoWeak = do_GetWeakReference(aInfo);
gRefCnt++;
// printf("REF COUNT UP: %d %s\n", gRefCnt, (const char*)mID);

View File

@ -277,7 +277,7 @@ nsXBLStreamListener::nsXBLStreamListener(nsXBLService* aXBLService,
/* member initializers and constructor code */
mXBLService = aXBLService;
mInner = aInner;
mDocument = getter_AddRefs(NS_GetWeakReference(aDocument));
mDocument = do_GetWeakReference(aDocument);
mBindingDocument = aBindingDocument;
#ifdef MOZ_XUL
gRefCnt++;

View File

@ -581,7 +581,7 @@ XULContentSinkImpl::Init(nsIDocument* aDocument, nsIXULPrototypeDocument* aProto
nsresult rv;
mDocument = getter_AddRefs(NS_GetWeakReference(aDocument));
mDocument = do_GetWeakReference(aDocument);
mPrototype = aPrototype;
rv = mPrototype->GetURI(getter_AddRefs(mDocumentURL));

View File

@ -124,7 +124,7 @@ nsXULControllers::GetCommandDispatcher(nsIDOMXULCommandDispatcher** _result)
NS_IMETHODIMP
nsXULControllers::SetCommandDispatcher(nsIDOMXULCommandDispatcher* aCommandDispatcher)
{
mCommandDispatcher = getter_AddRefs(NS_GetWeakReference(aCommandDispatcher));
mCommandDispatcher = do_GetWeakReference(aCommandDispatcher);
return NS_OK;
}

View File

@ -570,7 +570,7 @@ nsXULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsIStreamListener **aDocListener,
PRBool aReset, nsIContentSink* aSink)
{
mDocumentLoadGroup = getter_AddRefs(NS_GetWeakReference(aLoadGroup));
mDocumentLoadGroup = do_GetWeakReference(aLoadGroup);
mDocumentTitle.Truncate();

View File

@ -228,7 +228,7 @@ nsDSURIContentListener::SetParentContentListener(nsIURIContentListener*
// Store the parent listener as a weak ref. Parents not supporting
// nsISupportsWeakReference assert but may still be used.
mParentContentListener = nsnull;
mWeakParentContentListener = getter_AddRefs(NS_GetWeakReference(aParentListener));
mWeakParentContentListener = do_GetWeakReference(aParentListener);
if (!mWeakParentContentListener)
{
mParentContentListener = aParentListener;

View File

@ -7077,7 +7077,7 @@ nsDocShellFocusController::ClosingDown(nsIDocShell* aDocShell)
nsDocShell::InterfaceRequestorProxy::InterfaceRequestorProxy(nsIInterfaceRequestor* p)
{
if (p) {
mWeakPtr = getter_AddRefs(NS_GetWeakReference(p));
mWeakPtr = do_GetWeakReference(p);
}
}

View File

@ -268,7 +268,7 @@ ScrollbarsPropImpl::ScrollbarsPropImpl(GlobalWindowImpl *aWindow)
{
mDOMWindow = aWindow;
nsISupports *supwin = NS_STATIC_CAST(nsIScriptGlobalObject *, aWindow);
mDOMWindowWeakref = getter_AddRefs(NS_GetWeakReference(supwin));
mDOMWindowWeakref = do_GetWeakReference(supwin);
}
ScrollbarsPropImpl::~ScrollbarsPropImpl()

View File

@ -130,7 +130,7 @@ nsEditingSession::Init(nsIDOMWindow *aWindow)
nsresult rv = GetDocShellFromWindow(aWindow, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv;
mEditingShell = getter_AddRefs(NS_GetWeakReference(docShell));
mEditingShell = do_GetWeakReference(docShell);
if (!mEditingShell) return NS_ERROR_NO_INTERFACE;
return NS_OK;
@ -154,7 +154,7 @@ nsEditingSession::MakeWindowEditable(nsIDOMWindow *aWindow,
{
mEditorType.Truncate();
mEditorFlags = 0;
mWindowToBeEdited = getter_AddRefs(NS_GetWeakReference(aWindow));
mWindowToBeEdited = do_GetWeakReference(aWindow);
// disable plugins
nsCOMPtr<nsIDocShell> docShell;

View File

@ -286,7 +286,7 @@ NS_IMETHODIMP PlaceholderTxn::EndPlaceHolderBatch()
NS_IMETHODIMP PlaceholderTxn::ForwardEndBatchTo(nsIAbsorbingTransaction *aForwardingAddress)
{
mForwarding = getter_AddRefs( NS_GetWeakReference(aForwardingAddress) );
mForwarding = do_GetWeakReference(aForwardingAddress);
return NS_OK;
}

View File

@ -258,9 +258,9 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
return NS_ERROR_NULL_POINTER;
mFlags = aFlags;
mDocWeak = getter_AddRefs( NS_GetWeakReference(aDoc) ); // weak reference to doc
mPresShellWeak = getter_AddRefs( NS_GetWeakReference(aPresShell) ); // weak reference to pres shell
mSelConWeak = getter_AddRefs( NS_GetWeakReference(aSelCon) ); // weak reference to selectioncontroller
mDocWeak = do_GetWeakReference(aDoc); // weak reference to doc
mPresShellWeak = do_GetWeakReference(aPresShell); // weak reference to pres shell
mSelConWeak = do_GetWeakReference(aSelCon); // weak reference to selectioncontroller
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
if (!ps) return NS_ERROR_NOT_INITIALIZED;
@ -466,7 +466,7 @@ nsEditor::DoTransaction(nsITransaction *aTxn)
// due to our broken interface model for transactions.
// save off weak reference to placeholder txn
mPlaceHolderTxn = getter_AddRefs( NS_GetWeakReference(plcTxn) );
mPlaceHolderTxn = do_GetWeakReference(plcTxn);
plcTxn->Init(mPlaceHolderName, mSelState, this);
mSelState = nsnull; // placeholder txn took ownership of this pointer
@ -488,7 +488,7 @@ nsEditor::DoTransaction(nsITransaction *aTxn)
// either the one we just created, or an earlier one that we are now merging
// into. From here on out remember this placeholder instead of the one
// we just created.
mPlaceHolderTxn = getter_AddRefs( NS_GetWeakReference(plcTxn) );
mPlaceHolderTxn = do_GetWeakReference(plcTxn);
}
}
}

View File

@ -88,7 +88,7 @@
if (!theLoadGroup)
error;
nsCOMPtr<nsIStreamListener> listener(NS_STATIC_CAST(nsIStreamListener*, qaBrowserImpl));
//nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
//nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
//qaWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsIStreamListener));
// this calls nsIStreamListener::OnDataAvailable()

View File

@ -48,7 +48,7 @@ nsTransactionList::nsTransactionList(nsITransactionManager *aTxnMgr, nsTransacti
, mTxnItem(0)
{
if (aTxnMgr)
mTxnMgr = getter_AddRefs(NS_GetWeakReference(aTxnMgr));
mTxnMgr = do_GetWeakReference(aTxnMgr);
}
nsTransactionList::nsTransactionList(nsITransactionManager *aTxnMgr, nsTransactionItem *aTxnItem)
@ -56,7 +56,7 @@ nsTransactionList::nsTransactionList(nsITransactionManager *aTxnMgr, nsTransacti
, mTxnItem(aTxnItem)
{
if (aTxnMgr)
mTxnMgr = getter_AddRefs(NS_GetWeakReference(aTxnMgr));
mTxnMgr = do_GetWeakReference(aTxnMgr);
}
nsTransactionList::~nsTransactionList()

View File

@ -1173,7 +1173,7 @@ HRESULT CMozillaBrowser::CreateBrowser()
// Subscribe for progress notifications
nsCOMPtr<nsIWeakReference> listener(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mWebBrowserContainer))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mWebBrowserContainer)));
mWebBrowser->AddWebBrowserListener(listener, NS_GET_IID(nsIWebProgressListener));
// Visible

View File

@ -357,7 +357,7 @@ void CBrowserShell::FinishCreateSelf()
ThrowIfNil_(mEventSink);
// Hook up our progress listener
nsWeakPtr weakling(dont_AddRef(NS_GetWeakReference((nsIWebProgressListener *)mProgressListener)));
nsWeakPtr weakling(do_GetWeakReference((nsIWebProgressListener *)mProgressListener));
rv = mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "Call to AddWebBrowserListener failed");

View File

@ -538,7 +538,7 @@ NS_IMETHODIMP nsWebBrowserFind::SetCurrentSearchFrame(nsIDOMWindow * aCurrentSea
{
// is it ever valid to set this to null?
NS_ENSURE_ARG(aCurrentSearchFrame);
mCurrentSearchFrame = getter_AddRefs(NS_GetWeakReference(aCurrentSearchFrame));
mCurrentSearchFrame = do_GetWeakReference(aCurrentSearchFrame);
return NS_OK;
}
@ -555,7 +555,7 @@ NS_IMETHODIMP nsWebBrowserFind::SetRootSearchFrame(nsIDOMWindow * aRootSearchFra
{
// is it ever valid to set this to null?
NS_ENSURE_ARG(aRootSearchFrame);
mRootSearchFrame = getter_AddRefs(NS_GetWeakReference(aRootSearchFrame));
mRootSearchFrame = do_GetWeakReference(aRootSearchFrame);
return NS_OK;
}
@ -758,7 +758,7 @@ nsresult nsWebBrowserFind::OnFind(nsIDOMWindow *aFoundWindow)
{
nsCOMPtr<nsIDOMWindowInternal> windowInt = do_QueryInterface(aFoundWindow);
focusController->SetFocusedWindow(windowInt);
mLastFocusedWindow = getter_AddRefs(NS_GetWeakReference(aFoundWindow));
mLastFocusedWindow = do_GetWeakReference(aFoundWindow);
}
return NS_OK;

View File

@ -114,7 +114,7 @@ struct nsWatcherWindowEntry {
nsWatcherWindowEntry(nsIDOMWindow *inWindow, nsIWebBrowserChrome *inChrome) {
#ifdef USEWEAKREFS
mWindow = getter_AddRefs(NS_GetWeakReference(inWindow));
mWindow = do_GetWeakReference(inWindow);
#else
mWindow = inWindow;
#endif

View File

@ -135,7 +135,7 @@ nsQABrowserView::CreateBrowser(nativeWindow aNativeWnd, nsIWebBrowserChrome * aC
// Register the QABrowserChrome object to receive progress messages
// These callbacks will be used to update the status/progress bars
nsWeakPtr weakling(dont_AddRef(NS_GetWeakReference(aChrome)));
nsWeakPtr weakling(do_GetWeakReference(aChrome));
(void)mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
// Finally, show the web browser window

View File

@ -259,7 +259,7 @@ HRESULT CBrowserView::CreateBrowser()
/* // from WinEmbed.cpp
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));
@ -290,7 +290,7 @@ HRESULT CBrowserView::DestroyBrowser()
}
/*
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl)));
nsresult rv;
rv = mWebBrowser->RemoveWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
if (NS_FAILED(rv))

View File

@ -240,7 +240,7 @@ HRESULT CBrowserView::CreateBrowser()
// Register the BrowserImpl object to receive progress messages
// These callbacks will be used to update the status/progress bars
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl)));
rv = mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
if (NS_FAILED(rv))
@ -275,7 +275,7 @@ HRESULT CBrowserView::DestroyBrowser()
}
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl)));
nsresult rv;
rv = mWebBrowser->RemoveWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
if (NS_FAILED(rv))
@ -1509,7 +1509,7 @@ void CBrowserView::OnInterfacesNsishistory()
// addSHistoryListener test
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, mpBrowserImpl)));
rv = mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsISHistoryListener));
if (NS_FAILED(rv))
@ -1549,7 +1549,7 @@ void CBrowserView::OnInterfacesNsishistory()
// RemoveSHistoryListener test
/*
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, mpBrowserImpl)));
rv = theSessionHistory->RemoveSHistoryListener(weakling);
*/
}

View File

@ -486,7 +486,7 @@ void CTests::OnTestsCreateprofile()
void CTests::OnTestsAddTooltipListener()
{
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsITooltipListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsITooltipListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsITooltipListener));
RvTestResult(rv, "AddWebBrowserListener(). Add Tooltip Listener test", 2);
@ -497,7 +497,7 @@ void CTests::OnTestsAddTooltipListener()
void CTests::OnTestsAddWebProgListener()
{
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
RvTestResult(rv, "AddWebBrowserListener(). Add Web Prog Lstnr test", 2);
@ -510,7 +510,7 @@ void CTests::OnTestsAddHistoryListener()
// addSHistoryListener test
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsISHistoryListener));
RvTestResult(rv, "AddWebBrowserListener(). Add History Lstnr test", 2);
@ -523,7 +523,7 @@ void CTests::OnTestsRemovehistorylistener()
// RemoveSHistoryListener test
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, qaBrowserImpl)));
rv = qaWebBrowser->RemoveWebBrowserListener(weakling, NS_GET_IID(nsISHistoryListener));
RvTestResult(rv, "RemoveWebBrowserListener(). Remove History Lstnr test", 2);
@ -534,7 +534,7 @@ void CTests::OnTestsRemovehistorylistener()
void CTests::OnTestsAddUriContentListenerByWebBrowser()
{
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIURIContentListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIURIContentListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIURIContentListener));
RvTestResult(rv, "AddWebBrowserListener(). add nsIURIContentListener test", 2);
@ -624,7 +624,7 @@ void CTests::OnTestsNSNewChannelAndAsyncOpen()
QAOutput("AynchOpen() test.", 2);
nsCOMPtr<nsIStreamListener> listener(NS_STATIC_CAST(nsIStreamListener*, qaBrowserImpl));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
qaWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsIStreamListener));
if (!listener)
@ -809,7 +809,7 @@ void CTests::OnVerifybugs70228()
void CTests::OnVerifybugs90195()
{
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsITooltipListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsITooltipListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsITooltipListener));
RvTestResult(rv, "AddWebBrowserListener(). Add Tool Tip Lstnr test", 2);

View File

@ -73,7 +73,7 @@ void CNsIWebBrowser::WBAddListener(PRInt16 displayMode)
{
// AddWebBrowserListener
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl)));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIContextMenuListener));
RvTestResult(rv, "AddWebBrowserListener(). nsIContextMenuListener test", displayMode);
RvTestResultDlg(rv, "AddWebBrowserListener(). nsIContextMenuListener test", true);
@ -83,7 +83,7 @@ void CNsIWebBrowser::WBRemoveListener(PRInt16 displayMode)
{
// RemoveWebBrowserListener
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl)));
rv = qaWebBrowser->RemoveWebBrowserListener(weakling, NS_GET_IID(nsIContextMenuListener));
RvTestResult(rv, "RemoveWebBrowserListener(). nsIContextMenuListener test", displayMode);

View File

@ -355,7 +355,7 @@ void CnsIChannelTests::OpenTest(nsIChannel *theChannel, PRInt16 displayMode)
void CnsIChannelTests::AsyncOpenTest(nsIChannel *theChannel, PRInt16 displayMode)
{
nsCOMPtr<nsIStreamListener> listener(NS_STATIC_CAST(nsIStreamListener*, qaBrowserImpl));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
qaWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsIStreamListener));
if (!theChannel)
{

View File

@ -254,7 +254,7 @@ nsIChannel * CNsIRequest::GetTheChannel(int i, nsILoadGroup *theLoadGroup)
}
nsCOMPtr<nsIStreamListener> listener(NS_STATIC_CAST(nsIStreamListener*, qaBrowserImpl));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
qaWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsIStreamListener));
if (!listener) {

View File

@ -252,7 +252,7 @@ HRESULT CBrowserView::CreateBrowser()
// Register the BrowserImpl object to receive progress messages
// These callbacks will be used to update the status/progress bars
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl))));
do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl)));
(void)mWebBrowser->AddWebBrowserListener(weakling,
NS_GET_IID(nsIWebProgressListener));

View File

@ -94,7 +94,7 @@ nsresult WebBrowserChrome::CreateBrowser(PRInt32 aX, PRInt32 aY,
browserBaseWindow->Create();
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));

View File

@ -94,7 +94,7 @@ nsresult WebBrowserChrome::CreateBrowser(PRInt32 aX, PRInt32 aY,
browserBaseWindow->Create();
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));

View File

@ -98,7 +98,7 @@ nsresult GeckoContainer::CreateBrowser(PRInt32 aX, PRInt32 aY,
browserBaseWindow->Create();
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));

View File

@ -66,7 +66,7 @@ NS_IMETHODIMP nsBasicStreamGenerator::Setup(PRUint32 salt, nsISupports *consumer
/* reestablish setup */
if (consumer) {
mWeakPasswordSink = getter_AddRefs(NS_GetWeakReference(consumer, &rv));
mWeakPasswordSink = do_GetWeakReference(consumer, &rv);
if (NS_FAILED(rv)) return rv;
}
mSalt = salt;

View File

@ -524,7 +524,7 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream,
// Register as a load listener on the document
nsCOMPtr<nsIDOMEventReceiver> target(do_QueryInterface(domDocument));
if (target) {
nsWeakPtr requestWeak(getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIDOMParser*, this))));
nsWeakPtr requestWeak(do_GetWeakReference(NS_STATIC_CAST(nsIDOMParser*, this)));
nsLoadListenerProxy* proxy = new nsLoadListenerProxy(requestWeak);
if (!proxy) return NS_ERROR_OUT_OF_MEMORY;

View File

@ -1252,7 +1252,7 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
// Register as a load listener on the document
nsCOMPtr<nsIDOMEventReceiver> target(do_QueryInterface(mDocument));
if (target) {
nsWeakPtr requestWeak(getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIXMLHttpRequest*, this))));
nsWeakPtr requestWeak(do_GetWeakReference(NS_STATIC_CAST(nsIXMLHttpRequest*, this)));
nsLoadListenerProxy* proxy = new nsLoadListenerProxy(requestWeak);
if (!proxy) return NS_ERROR_OUT_OF_MEMORY;

View File

@ -205,7 +205,7 @@ NS_IMETHODIMP mozXMLTerminal::Init(nsIDocShell* aDocShell,
mInitialized = PR_TRUE;
// Containing docshell
mDocShell = getter_AddRefs(NS_GetWeakReference(aDocShell)); // weak ref
mDocShell = do_GetWeakReference(aDocShell); // weak ref
mXMLTermShell = aXMLTermShell; // containing xmlterm shell; no addref
@ -423,8 +423,8 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void)
return NS_ERROR_FAILURE;
// Save weak references to presentation shell and DOMDocument
mPresShell = getter_AddRefs(NS_GetWeakReference(presShell)); // weak ref
mDOMDocument = getter_AddRefs(NS_GetWeakReference(domDoc)); // weak ref
mPresShell = do_GetWeakReference(presShell); // weak ref
mDOMDocument = do_GetWeakReference(domDoc); // weak ref
// Show caret
ShowCaret();

View File

@ -129,7 +129,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintSession(nsIPrintSession *aPrintSession)
// use a weak ref so that it doesn't have to be cleared.
NS_ENSURE_ARG(aPrintSession);
mSession = getter_AddRefs(NS_GetWeakReference(aPrintSession));
mSession = do_GetWeakReference(aPrintSession);
if (!mSession) {
// This may happen if the implementation of this object does
// not support weak references - programmer error.

View File

@ -111,7 +111,7 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
{
NS_ENSURE_ARG(inPresShell);
mPresShell = getter_AddRefs(NS_GetWeakReference(inPresShell)); // the presshell owns us, so no addref
mPresShell = do_GetWeakReference(inPresShell); // the presshell owns us, so no addref
NS_ASSERTION(mPresShell, "Hey, pres shell should support weak refs");
// get nsILookAndFeel from the pres context, which has one cached.
@ -149,7 +149,7 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
nsCOMPtr<nsISelectionPrivate> privateSelection = do_QueryInterface(domSelection);
if (privateSelection)
privateSelection->AddSelectionListener(this);
mDomSelectionWeak = getter_AddRefs(NS_GetWeakReference(domSelection));
mDomSelectionWeak = do_GetWeakReference(domSelection);
// set up the blink timer
if (mVisible)
@ -218,7 +218,7 @@ NS_IMETHODIMP nsCaret::GetCaretDOMSelection(nsISelection **aDOMSel)
NS_IMETHODIMP nsCaret::SetCaretDOMSelection(nsISelection *aDOMSel)
{
NS_ENSURE_ARG_POINTER(aDOMSel);
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDOMSel) ); // weak reference to pres shell
mDomSelectionWeak = do_GetWeakReference(aDOMSel); // weak reference to pres shell
return NS_OK;
}

View File

@ -1209,7 +1209,7 @@ nsresult CantRenderReplacedElementEvent::AddLoadGroupRequest(nsIPresShell* aPres
rv = mDummyLayoutRequest->SetLoadGroup(loadGroup);
if (NS_FAILED(rv)) return rv;
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
return loadGroup->AddRequest(mDummyLayoutRequest, nsnull);
}

View File

@ -798,7 +798,7 @@ nsDummyLayoutRequest::nsDummyLayoutRequest(nsIPresShell* aPresShell)
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create about:layout-dummy-request");
}
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
}
@ -6354,7 +6354,7 @@ ReflowEvent::ReflowEvent(nsIPresShell* aPresShell)
{
NS_ASSERTION(aPresShell, "Null parameters!");
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
PL_InitEvent(this, aPresShell,
(PLHandleEventProc) ::HandlePLEvent,

View File

@ -111,7 +111,7 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
{
NS_ENSURE_ARG(inPresShell);
mPresShell = getter_AddRefs(NS_GetWeakReference(inPresShell)); // the presshell owns us, so no addref
mPresShell = do_GetWeakReference(inPresShell); // the presshell owns us, so no addref
NS_ASSERTION(mPresShell, "Hey, pres shell should support weak refs");
// get nsILookAndFeel from the pres context, which has one cached.
@ -149,7 +149,7 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
nsCOMPtr<nsISelectionPrivate> privateSelection = do_QueryInterface(domSelection);
if (privateSelection)
privateSelection->AddSelectionListener(this);
mDomSelectionWeak = getter_AddRefs(NS_GetWeakReference(domSelection));
mDomSelectionWeak = do_GetWeakReference(domSelection);
// set up the blink timer
if (mVisible)
@ -218,7 +218,7 @@ NS_IMETHODIMP nsCaret::GetCaretDOMSelection(nsISelection **aDOMSel)
NS_IMETHODIMP nsCaret::SetCaretDOMSelection(nsISelection *aDOMSel)
{
NS_ENSURE_ARG_POINTER(aDOMSel);
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDOMSel) ); // weak reference to pres shell
mDomSelectionWeak = do_GetWeakReference(aDOMSel); // weak reference to pres shell
return NS_OK;
}

View File

@ -515,7 +515,7 @@ nsTextInputSelectionImpl::nsTextInputSelectionImpl(nsIFrameSelection *aSel, nsIP
nsCOMPtr<nsIFocusTracker> tracker = do_QueryInterface(aShell);
mLimiter = aLimiter;
mFrameSelection->Init(tracker, mLimiter);
mPresShellWeak = getter_AddRefs( NS_GetWeakReference(aShell) );
mPresShellWeak = do_GetWeakReference(aShell);
#ifdef IBMBIDI
mBidiKeyboard = do_GetService("@mozilla.org/widget/bidikeyboard;1");
#endif

View File

@ -999,7 +999,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
if (prefBranch) {
nsCOMPtr<nsIPrefBranchInternal> prefBranchInternal(do_QueryInterface(prefBranch));
if (prefBranchInternal) {
mPrefBranchWeakRef = getter_AddRefs(NS_GetWeakReference(prefBranchInternal));
mPrefBranchWeakRef = do_GetWeakReference(prefBranchInternal);
prefBranchInternal->AddObserver(kFrameResizePref, this, PR_FALSE);
}
prefBranch->GetBoolPref(kFrameResizePref, &mForceFrameResizability);

View File

@ -4703,7 +4703,7 @@ NS_IMPL_RELEASE(nsTypedSelection)
NS_IMETHODIMP
nsTypedSelection::SetPresShell(nsIPresShell *aPresShell)
{
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShellWeak = do_GetWeakReference(aPresShell);
return NS_OK;
}
@ -7035,7 +7035,7 @@ nsTypedSelection::GetPresShell(nsIPresShell **aPresShell)
nsCOMPtr<nsIPresShell> shell;
rv = presContext->GetShell(getter_AddRefs(shell));
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(shell)); // the presshell owns us, so no addref
mPresShellWeak = do_GetWeakReference(shell); // the presshell owns us, so no addref
if (mPresShellWeak)
NS_ADDREF(*aPresShell = shell);
return rv;

View File

@ -1209,7 +1209,7 @@ nsresult CantRenderReplacedElementEvent::AddLoadGroupRequest(nsIPresShell* aPres
rv = mDummyLayoutRequest->SetLoadGroup(loadGroup);
if (NS_FAILED(rv)) return rv;
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
return loadGroup->AddRequest(mDummyLayoutRequest, nsnull);
}

View File

@ -798,7 +798,7 @@ nsDummyLayoutRequest::nsDummyLayoutRequest(nsIPresShell* aPresShell)
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create about:layout-dummy-request");
}
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
}
@ -6354,7 +6354,7 @@ ReflowEvent::ReflowEvent(nsIPresShell* aPresShell)
{
NS_ASSERTION(aPresShell, "Null parameters!");
mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShell = do_GetWeakReference(aPresShell);
PL_InitEvent(this, aPresShell,
(PLHandleEventProc) ::HandlePLEvent,

View File

@ -999,7 +999,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
if (prefBranch) {
nsCOMPtr<nsIPrefBranchInternal> prefBranchInternal(do_QueryInterface(prefBranch));
if (prefBranchInternal) {
mPrefBranchWeakRef = getter_AddRefs(NS_GetWeakReference(prefBranchInternal));
mPrefBranchWeakRef = do_GetWeakReference(prefBranchInternal);
prefBranchInternal->AddObserver(kFrameResizePref, this, PR_FALSE);
}
prefBranch->GetBoolPref(kFrameResizePref, &mForceFrameResizability);

View File

@ -515,7 +515,7 @@ nsTextInputSelectionImpl::nsTextInputSelectionImpl(nsIFrameSelection *aSel, nsIP
nsCOMPtr<nsIFocusTracker> tracker = do_QueryInterface(aShell);
mLimiter = aLimiter;
mFrameSelection->Init(tracker, mLimiter);
mPresShellWeak = getter_AddRefs( NS_GetWeakReference(aShell) );
mPresShellWeak = do_GetWeakReference(aShell);
#ifdef IBMBIDI
mBidiKeyboard = do_GetService("@mozilla.org/widget/bidikeyboard;1");
#endif

View File

@ -154,7 +154,7 @@ nsComputedDOMStyle::Init(nsIDOMElement *aElement,
NS_ENSURE_ARG_POINTER(aElement);
NS_ENSURE_ARG_POINTER(aPresShell);
mPresShellWeak = getter_AddRefs(NS_GetWeakReference(aPresShell));
mPresShellWeak = do_GetWeakReference(aPresShell);
mContent = do_QueryInterface(aElement);
if (!mContent) {

View File

@ -1433,7 +1433,7 @@ nsMsgSearchScopeTerm::nsMsgSearchScopeTerm (nsIMsgSearchSession *session,
m_attribute = attribute;
m_folder = folder;
m_searchServer = PR_TRUE;
m_searchSession = getter_AddRefs(NS_GetWeakReference(session));
m_searchSession = do_GetWeakReference(session);
}
nsMsgSearchScopeTerm::nsMsgSearchScopeTerm ()

View File

@ -1570,7 +1570,7 @@ NS_IMPL_ISUPPORTS1(SendLaterListener, nsIMsgSendLaterListener)
SendLaterListener::SendLaterListener(nsIMessenger *aMessenger)
{
m_messenger = getter_AddRefs(NS_GetWeakReference(aMessenger));
m_messenger = do_GetWeakReference(aMessenger);
}
SendLaterListener::~SendLaterListener()

View File

@ -291,7 +291,7 @@ nsMsgAccountManagerDataSource::Init()
// get a weak ref to the account manager
if (!mAccountManager) {
am = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
mAccountManager = getter_AddRefs(NS_GetWeakReference(am));
mAccountManager = do_GetWeakReference(am);
} else
am = do_QueryReferent(mAccountManager);

View File

@ -158,7 +158,7 @@ nsMsgQuickSearchDBView::GetSearchSession(nsIMsgSearchSession* *aSession)
NS_IMETHODIMP
nsMsgQuickSearchDBView::SetSearchSession(nsIMsgSearchSession *aSession)
{
m_searchSession = getter_AddRefs(NS_GetWeakReference(aSession));
m_searchSession = do_GetWeakReference(aSession);
return NS_OK;
}

View File

@ -131,7 +131,7 @@ void nsMsgWindow::GetMessageWindowDocShell(nsIDocShell ** aDocShell)
docShell = do_QueryInterface(msgDocShellItem);
// we don't own mMessageWindowDocShell so don't try to keep a reference to it!
mMessageWindowDocShellWeak = getter_AddRefs(NS_GetWeakReference(docShell));
mMessageWindowDocShellWeak = do_GetWeakReference(docShell);
}
}
@ -290,7 +290,7 @@ NS_IMETHODIMP nsMsgWindow::SetRootDocShell(nsIDocShell * aDocShell)
mRootDocShellWeak = nsnull;
if (aDocShell)
{
mRootDocShellWeak = getter_AddRefs(NS_GetWeakReference(aDocShell));
mRootDocShellWeak = do_GetWeakReference(aDocShell);
aDocShell->SetParentURIContentListener(this);
// be sure to set the application flag on the root docshell
// so it knows we are a mail application.

View File

@ -465,7 +465,7 @@ NS_IMETHODIMP nsMsgFolder::RemoveFolderListener(nsIFolderListener * listener)
NS_IMETHODIMP nsMsgFolder::SetParent(nsIFolder *aParent)
{
mParent = getter_AddRefs(NS_GetWeakReference(aParent));
mParent = do_GetWeakReference(aParent);
if (aParent) {
nsresult rv;
@ -482,7 +482,7 @@ NS_IMETHODIMP nsMsgFolder::SetParent(nsIFolder *aParent)
nsCOMPtr<nsIMsgIncomingServer> server;
rv = parentMsgFolder->GetServer(getter_AddRefs(server));
if (NS_SUCCEEDED(rv) && server)
mServer = getter_AddRefs(NS_GetWeakReference(server));
mServer = do_GetWeakReference(server);
}
}
@ -675,7 +675,7 @@ nsMsgFolder::parseURI(PRBool needServer)
}
mServer = getter_AddRefs(NS_GetWeakReference(server));
mServer = do_GetWeakReference(server);
} /* !mServer */

View File

@ -2276,7 +2276,7 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnDataAvailable(nsIRequest *request,
nsresult
QuotingOutputStreamListener::SetComposeObj(nsIMsgCompose *obj)
{
mWeakComposeObj = getter_AddRefs(NS_GetWeakReference(obj));
mWeakComposeObj = do_GetWeakReference(obj);
return NS_OK;
}
@ -2634,7 +2634,7 @@ nsMsgComposeSendListener::~nsMsgComposeSendListener(void)
NS_IMETHODIMP nsMsgComposeSendListener::SetMsgCompose(nsIMsgCompose *obj)
{
mWeakComposeObj = getter_AddRefs(NS_GetWeakReference(obj));
mWeakComposeObj = do_GetWeakReference(obj);
return NS_OK;
}

View File

@ -699,7 +699,7 @@ nsresult nsImapProtocol::SetupWithUrl(nsIURI * aURL, nsISupports* aConsumer)
{
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_runningUrl);
rv = mailnewsUrl->GetServer(getter_AddRefs(server));
m_server = getter_AddRefs(NS_GetWeakReference(server));
m_server = do_GetWeakReference(server);
}
nsCOMPtr<nsIImapIncomingServer> imapServer = do_QueryInterface(server);

View File

@ -73,8 +73,8 @@ nsImapMoveCopyMsgTxn::Init(
m_srcMsgIdString = srcMsgIdString;
m_idsAreUids = idsAreUids;
m_isMove = isMove;
m_srcFolder = getter_AddRefs(NS_GetWeakReference(srcFolder));
m_dstFolder = getter_AddRefs(NS_GetWeakReference(dstFolder));
m_srcFolder = do_GetWeakReference(srcFolder);
m_dstFolder = do_GetWeakReference(dstFolder);
m_eventQueue = do_QueryInterface(eventQueue, &rv);
if (urlListener)
m_urlListener = do_QueryInterface(urlListener, &rv);

View File

@ -206,7 +206,7 @@ NS_IMETHODIMP nsImapUrl::GetFolder(nsIMsgFolder **aMsgFolder)
NS_IMETHODIMP nsImapUrl::SetFolder(nsIMsgFolder * aMsgFolder)
{
nsresult rv;
m_imapFolder = getter_AddRefs(NS_GetWeakReference(aMsgFolder, &rv));
m_imapFolder = do_GetWeakReference(aMsgFolder, &rv);
return rv;
}
@ -226,7 +226,7 @@ NS_IMETHODIMP nsImapUrl::GetImapMailFolderSink(nsIImapMailFolderSink **
NS_IMETHODIMP nsImapUrl::SetImapMailFolderSink(nsIImapMailFolderSink * aImapMailFolderSink)
{
nsresult rv;
m_imapMailFolderSink = getter_AddRefs(NS_GetWeakReference(aImapMailFolderSink, &rv));
m_imapMailFolderSink = do_GetWeakReference(aImapMailFolderSink, &rv);
return rv;
}
@ -244,7 +244,7 @@ NS_IMETHODIMP nsImapUrl::GetImapMessageSink(nsIImapMessageSink ** aImapMessageSi
NS_IMETHODIMP nsImapUrl::SetImapMessageSink(nsIImapMessageSink * aImapMessageSink)
{
nsresult rv;
m_imapMessageSink = getter_AddRefs(NS_GetWeakReference(aImapMessageSink, &rv));
m_imapMessageSink = do_GetWeakReference(aImapMessageSink, &rv);
return rv;
}
@ -262,7 +262,7 @@ NS_IMETHODIMP nsImapUrl::GetImapServerSink(nsIImapServerSink ** aImapServerSink)
NS_IMETHODIMP nsImapUrl::SetImapServerSink(nsIImapServerSink * aImapServerSink)
{
nsresult rv;
m_imapServerSink = getter_AddRefs(NS_GetWeakReference(aImapServerSink, &rv));
m_imapServerSink = do_GetWeakReference(aImapServerSink, &rv);
return rv;
}
@ -280,7 +280,7 @@ NS_IMETHODIMP nsImapUrl::GetImapExtensionSink(nsIImapExtensionSink ** aImapExten
NS_IMETHODIMP nsImapUrl::SetImapExtensionSink(nsIImapExtensionSink * aImapExtensionSink)
{
nsresult rv;
m_imapExtensionSink = getter_AddRefs(NS_GetWeakReference(aImapExtensionSink, &rv));
m_imapExtensionSink = do_GetWeakReference(aImapExtensionSink, &rv);
return rv;
}
@ -300,7 +300,7 @@ NS_IMETHODIMP nsImapUrl::SetImapMiscellaneousSink(nsIImapMiscellaneousSink *
aImapMiscellaneousSink)
{
nsresult rv;
m_imapMiscellaneousSink = getter_AddRefs(NS_GetWeakReference(aImapMiscellaneousSink, &rv));
m_imapMiscellaneousSink = do_GetWeakReference(aImapMiscellaneousSink, &rv);
return rv;
}

View File

@ -124,7 +124,7 @@ nsLocalMoveCopyMsgTxn::SetSrcFolder(nsIMsgFolder* srcFolder)
{
nsresult rv = NS_ERROR_NULL_POINTER;
if (srcFolder)
m_srcFolder = getter_AddRefs(NS_GetWeakReference(srcFolder, &rv));
m_srcFolder = do_GetWeakReference(srcFolder, &rv);
return rv;
}
@ -133,7 +133,7 @@ nsLocalMoveCopyMsgTxn::SetDstFolder(nsIMsgFolder* dstFolder)
{
nsresult rv = NS_ERROR_NULL_POINTER;
if (dstFolder)
m_dstFolder = getter_AddRefs(NS_GetWeakReference(dstFolder, &rv));
m_dstFolder = do_GetWeakReference(dstFolder, &rv);
return rv;
}

View File

@ -227,7 +227,7 @@ nsMsgMailboxParser::nsMsgMailboxParser() : nsMsgLineBuffer(nsnull, PR_FALSE)
nsMsgMailboxParser::nsMsgMailboxParser(nsIMsgFolder *aFolder) : nsMsgLineBuffer(nsnull, PR_FALSE)
{
Init();
m_folder = getter_AddRefs(NS_GetWeakReference(aFolder));
m_folder = do_GetWeakReference(aFolder);
}
nsMsgMailboxParser::~nsMsgMailboxParser()

View File

@ -73,7 +73,7 @@ NS_IMETHODIMP imgContainerGIF::Init(nscoord aWidth, nscoord aHeight,
mSize.SizeTo(aWidth, aHeight);
mObserver = getter_AddRefs(NS_GetWeakReference(aObserver));
mObserver = do_GetWeakReference(aObserver);
return NS_OK;
}

View File

@ -1435,7 +1435,7 @@ nsPluginStreamInfo::RequestRead(nsByteRange* rangeList)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWeakReference> pWeakRefPluginStreamListenerPeer =
getter_AddRefs(NS_GetWeakReference(suppWeakRef));
do_GetWeakReference(suppWeakRef);
if (!pWeakRefPluginStreamListenerPeer)
return NS_ERROR_FAILURE;
@ -2006,12 +2006,12 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo
nsCOMPtr<nsIInterfaceRequestor> callbacks;
channel->GetNotificationCallbacks(getter_AddRefs(callbacks));
if (callbacks)
mWeakPtrChannelCallbacks = getter_AddRefs(NS_GetWeakReference(callbacks));
mWeakPtrChannelCallbacks = do_GetWeakReference(callbacks);
nsCOMPtr<nsILoadGroup> loadGroup;
channel->GetLoadGroup(getter_AddRefs(loadGroup));
if (loadGroup)
mWeakPtrChannelLoadGroup = getter_AddRefs(NS_GetWeakReference(loadGroup));
mWeakPtrChannelLoadGroup = do_GetWeakReference(loadGroup);
}
PRInt32 length;
@ -3713,7 +3713,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
if (document == currentdocument)
return rv;
mCurrentDocument = getter_AddRefs(NS_GetWeakReference(document));
mCurrentDocument = do_GetWeakReference(document);
// ReloadPlugins will do the job smartly: nothing will be done
// if no changes detected, in such a case just return

View File

@ -280,7 +280,7 @@ nsIOService::CacheProtocolHandler(const char *scheme, nsIProtocolHandler *handle
#endif /* DEBUG_dp */
return NS_ERROR_FAILURE;
}
mWeakHandler[i] = getter_AddRefs(NS_GetWeakReference(handler));
mWeakHandler[i] = do_GetWeakReference(handler);
return NS_OK;
}
}

View File

@ -746,7 +746,7 @@ nsLoadGroup::GetRequests(nsISimpleEnumerator * *aRequests)
NS_IMETHODIMP
nsLoadGroup::SetGroupObserver(nsIRequestObserver* aObserver)
{
mObserver = getter_AddRefs(NS_GetWeakReference(aObserver));
mObserver = do_GetWeakReference(aObserver);
return NS_OK;
}

View File

@ -1235,7 +1235,7 @@ nsDNSService::InstallPrefObserver()
if (NS_FAILED(rv)) return rv;
// save for later
mPrefService = getter_AddRefs( NS_GetWeakReference(prefs));
mPrefService = do_GetWeakReference(prefs);
nsCOMPtr<nsIPrefBranchInternal> prefInternal = do_QueryInterface(prefs, &rv);
if (NS_FAILED(rv)) return rv;

View File

@ -386,7 +386,7 @@ LocalStoreImpl::Init()
// for later
if (!gRDF)
gRDF = getter_AddRefs(NS_GetWeakReference(rdf));
gRDF = do_GetWeakReference(rdf);
rdf->RegisterDataSource(this, PR_FALSE);

View File

@ -889,7 +889,7 @@ nsDocLoaderImpl::AddProgressListener(nsIWebProgressListener *aListener,
PRUint32 aNotifyMask)
{
nsresult rv;
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
nsWeakPtr listener = do_GetWeakReference(aListener);
if (!listener) {
return NS_ERROR_INVALID_ARG;
}
@ -913,7 +913,7 @@ NS_IMETHODIMP
nsDocLoaderImpl::RemoveProgressListener(nsIWebProgressListener *aListener)
{
nsresult rv;
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
nsWeakPtr listener = do_GetWeakReference(aListener);
if (!listener) {
return NS_ERROR_INVALID_ARG;
}

View File

@ -1417,7 +1417,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
NS_ENSURE_SUCCESS(EnsureWebBrowserChrome(), NS_ERROR_FAILURE);
mWebBrowser->SetContainerWindow(mWebBrowserChrome);
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference((nsIWebProgressListener*)mWebBrowserChrome)));
do_GetWeakReference((nsIWebProgressListener*)mWebBrowserChrome));
mWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
webBrowserWin->Create();

View File

@ -440,7 +440,7 @@ nsEventStatus
nsMenuBarX::MenuConstruct( const nsMenuEvent & aMenuEvent, nsIWidget* aParentWindow,
void * menubarNode, void * aWebShell )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell)));
mWebShellWeakRef = do_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell));
nsIDOMNode* aDOMNode = NS_STATIC_CAST(nsIDOMNode*, menubarNode);
mMenuBarContent = do_QueryInterface(aDOMNode); // strong ref
NS_ASSERTION ( mMenuBarContent, "No content specified for this menubar" );

View File

@ -98,7 +98,7 @@ NS_METHOD nsMenuItemX::Create ( nsIMenu* aParent, const nsString & aLabel, PRBoo
{
mContent = aNode; // addref
mMenuParent = aParent; // weak
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mEnabled = aEnabled;
mMenuType = aItemType;

View File

@ -150,7 +150,7 @@ NS_METHOD
nsMenuX::Create(nsISupports * aParent, const nsAString &aLabel, const nsAString &aAccessKey,
nsIChangeManager* aManager, nsIWebShell* aShell, nsIContent* aNode )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mMenuContent = aNode;
// register this menu to be notified when changes are made to our content object

View File

@ -936,7 +936,7 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
}
gRollupListener = aListener;
gRollupWidget = getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWidget*,this)));
gRollupWidget = do_GetWeakReference(NS_STATIC_CAST(nsIWidget*,this));
} else {
// make sure that the grab window is marked as released
if (sGrabWindow == this) {

View File

@ -1082,9 +1082,8 @@ nsWindow::CaptureRollupEvents(nsIRollupListener *aListener,
if (aDoCapture) {
gRollupListener = aListener;
gRollupWindow =
getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWidget*,
this)));
gRollupWindow = do_GetWeakReference(NS_STATIC_CAST(nsIWidget*,
this));
gtk_grab_add(widget);
GrabPointer();
GrabKeyboard();

View File

@ -421,7 +421,7 @@ void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
gPreviousTopLevelMenuHandle = theMenu;
gPreviousTopLevelMenu = menu;
gPreviousMenuBar = getter_AddRefs(NS_GetWeakReference(menubar));
gPreviousMenuBar = do_GetWeakReference(menubar);
//printf("exit BuildMenu \n");
return;
}

View File

@ -205,7 +205,7 @@ NS_METHOD
nsMenu::Create( nsISupports * aParent, const nsAString &aLabel, const nsAString &aAccessKey,
nsIChangeManager* aManager, nsIWebShell* aShell, nsIContent* aNode )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mMenuContent = aNode;
// register this menu to be notified when changes are made to our content object

View File

@ -127,7 +127,7 @@ nsMenuBar::nsMenuBar()
::ClearMenuBar();
mRefCnt = 1; // NS_GetWeakReference does an addref then a release, so this +1 is needed
gMacMenubar = getter_AddRefs(NS_GetWeakReference((nsIMenuBar *)this));
gMacMenubar = do_GetWeakReference((nsIMenuBar *)this);
mRefCnt = 0;
// copy from nsMenu.cpp
ScriptCode ps[1];
@ -298,12 +298,12 @@ nsEventStatus
nsMenuBar::MenuConstruct( const nsMenuEvent & aMenuEvent, nsIWidget* aParentWindow,
void * menubarNode, void * aWebShell )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell)));
mWebShellWeakRef = do_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell));
nsIDOMNode* aDOMNode = NS_STATIC_CAST(nsIDOMNode*, menubarNode);
mMenuBarContent = do_QueryInterface(aDOMNode); // strong ref
if(gFirstMenuBar) {
gOriginalMenuBar = getter_AddRefs(NS_GetWeakReference((nsIMenuBar *)this));
gOriginalMenuBar = do_GetWeakReference((nsIMenuBar *)this);
gFirstMenuBar = false;
// Add the 4 Golden Hierarchical Menus to the MenuList
@ -579,7 +579,7 @@ NS_METHOD nsMenuBar::SetNativeData(void* aData)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::Paint()
{
gMacMenubar = getter_AddRefs(NS_GetWeakReference((nsIMenuBar *)this));
gMacMenubar = do_GetWeakReference((nsIMenuBar *)this);
::SetMenuBar(mMacMBarHandle);
// Now we have blown away the merged Help menu, so we have to rebuild it

View File

@ -450,7 +450,7 @@ nsEventStatus
nsMenuBarX::MenuConstruct( const nsMenuEvent & aMenuEvent, nsIWidget* aParentWindow,
void * menubarNode, void * aWebShell )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell)));
mWebShellWeakRef = do_GetWeakReference(NS_STATIC_CAST(nsIWebShell*, aWebShell));
nsIDOMNode* aDOMNode = NS_STATIC_CAST(nsIDOMNode*, menubarNode);
mMenuBarContent = do_QueryInterface(aDOMNode); // strong ref
NS_ASSERTION ( mMenuBarContent, "No content specified for this menubar" );

View File

@ -100,7 +100,7 @@ NS_METHOD nsMenuItem::Create ( nsIMenu* aParent, const nsString & aLabel, PRBool
{
mContent = aNode; // addref
mMenuParent = aParent; // weak
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mEnabled = aEnabled;
mMenuType = aItemType;

View File

@ -99,7 +99,7 @@ NS_METHOD nsMenuItemX::Create ( nsIMenu* aParent, const nsString & aLabel, PRBoo
{
mContent = aNode; // addref
mMenuParent = aParent; // weak
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mEnabled = aEnabled;
mMenuType = aItemType;

View File

@ -156,7 +156,7 @@ NS_METHOD
nsMenuX::Create(nsISupports * aParent, const nsAString &aLabel, const nsAString &aAccessKey,
nsIChangeManager* aManager, nsIWebShell* aShell, nsIContent* aNode )
{
mWebShellWeakRef = getter_AddRefs(NS_GetWeakReference(aShell));
mWebShellWeakRef = do_GetWeakReference(aShell);
mMenuContent = aNode;
// register this menu to be notified when changes are made to our content object

View File

@ -349,7 +349,7 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
gRollupConsumeRollupEvent = PR_TRUE;
gRollupListener = aListener;
gRollupWidget = getter_AddRefs(NS_GetWeakReference(NS_STATIC_CAST(nsIWidget*, this)));
gRollupWidget = do_GetWeakReference(NS_STATIC_CAST(nsIWidget*, this));
}else{
// Release Grab
if (sGrabWindow == this)

View File

@ -272,7 +272,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
nsCOMPtr<nsIBaseWindow> parentAsWin(do_QueryInterface(aParent));
if (parentAsWin) {
parentAsWin->GetMainWidget(getter_AddRefs(parentWidget));
mParentWindow = getter_AddRefs(NS_GetWeakReference(aParent));
mParentWindow = do_GetWeakReference(aParent);
}
mWindow->SetClientData(this);

View File

@ -429,7 +429,7 @@ nsBrowserInstance::ReinitializeContentVariables()
nsCOMPtr<nsIDocShell> docShell;
globalObj->GetDocShell(getter_AddRefs(docShell));
mContentAreaDocShellWeak = dont_AddRef(NS_GetWeakReference(docShell)); // Weak reference
mContentAreaDocShellWeak = do_GetWeakReference(docShell); // Weak reference
if (APP_DEBUG) {
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(docShell));

View File

@ -397,7 +397,7 @@ nsSHistory::AddSHistoryListener(nsISHistoryListener * aListener)
// Check if the listener supports Weak Reference. This is a must.
// This listener functionality is used by embedders and we want to
// have the right ownership with who ever listens to SHistory
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
nsWeakPtr listener = do_GetWeakReference(aListener);
if (!listener) return NS_ERROR_FAILURE;
mListener = listener;
return NS_OK;
@ -409,7 +409,7 @@ nsSHistory::RemoveSHistoryListener(nsISHistoryListener * aListener)
{
// Make sure the listener that wants to be removed is the
// one we have in store.
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
nsWeakPtr listener = do_GetWeakReference(aListener);
if (listener == mListener) {
mListener = nsnull;
return NS_OK;