diff --git a/xpfe/components/find/public/nsISearchContext.idl b/xpfe/components/find/public/nsISearchContext.idl index d64c7e741d53..b076176273bb 100644 --- a/xpfe/components/find/public/nsISearchContext.idl +++ b/xpfe/components/find/public/nsISearchContext.idl @@ -38,7 +38,8 @@ class nsIWebShell; | default implementation of the find component. | | | | This interface is very simple: it provides 5 attributes that control the | -| Find and FindNext methods of nsFindComponent. | +| Find and FindNext methods of nsFindComponent. In addition, it provides | +| two additional attributes used for implementation purposes. | ------------------------------------------------------------------------------*/ [scriptable, uuid(31ABA0F0-2D93-11d3-8069-00600811A9C3)] interface nsISearchContext : nsISupports { @@ -49,6 +50,4 @@ interface nsISearchContext : nsISupports { attribute boolean wrapSearch; readonly attribute nsIDOMWindow targetWindow; attribute nsIDOMWindow findDialog; - void ConvertToWeakReference(); - void ConvertToOwningReference(); }; diff --git a/xpfe/components/find/resources/finddialog.js b/xpfe/components/find/resources/finddialog.js index 4dfc41a4c8d0..db0d63d8aa1c 100644 --- a/xpfe/components/find/resources/finddialog.js +++ b/xpfe/components/find/resources/finddialog.js @@ -95,9 +95,6 @@ // Tell search context about this dialog. data.findDialog = window; - // Turn "data" into weak reference. - data.ConvertToWeakReference(); - // Fill dialog. loadDialog(); @@ -106,10 +103,6 @@ } function onUnload() { - // Turn "data" back to owning reference (since xpconnect - // will do Release() regardless). - data.ConvertToOwningReference(); - // Disconnect context from this dialog. data.findDialog = null; } diff --git a/xpfe/components/find/src/nsFindComponent.cpp b/xpfe/components/find/src/nsFindComponent.cpp index 9fc96dfc8471..d2043aaf304a 100644 --- a/xpfe/components/find/src/nsFindComponent.cpp +++ b/xpfe/components/find/src/nsFindComponent.cpp @@ -62,11 +62,11 @@ nsFindComponent::Context::Context() nsFindComponent::Context::~Context() { + #ifdef DEBUG_law + printf( "\nnsFindComponent::Context destructor called\n\n" ); + #endif // Close the dialog (if there is one). if ( mFindDialog ) { - // Bump refcnt so cleanup of the bogus owning reference in JS doesn't - // cause re-entry. - this->AddRef(); mFindDialog->Close(); mFindDialog = 0; } @@ -668,16 +668,16 @@ nsFindComponent::Context::SetWrapSearch(PRBool aBool) NS_IMETHODIMP nsFindComponent::Context::GetTargetWindow( nsIDOMWindow * *aWindow) { - NS_ENSURE_ARG_POINTER(aWindow); - NS_IF_ADDREF(*aWindow = mTargetWindow); + NS_ENSURE_ARG_POINTER(aWindow); + NS_IF_ADDREF(*aWindow = mTargetWindow); return NS_OK; } NS_IMETHODIMP nsFindComponent::Context::GetFindDialog( nsIDOMWindow * *aDialog) { - NS_ENSURE_ARG_POINTER(aDialog); - NS_IF_ADDREF(*aDialog = mFindDialog); + NS_ENSURE_ARG_POINTER(aDialog); + NS_IF_ADDREF(*aDialog = mFindDialog); return NS_OK; } @@ -688,21 +688,6 @@ nsFindComponent::Context::SetFindDialog( nsIDOMWindow *aDialog ) return NS_OK; } -NS_IMETHODIMP -nsFindComponent::Context::ConvertToWeakReference() -{ - NS_ASSERTION( mRefCnt >= 1, "Can't convert last reference to a weak one!" ); - this->Release(); - return NS_OK; -}; - -NS_IMETHODIMP -nsFindComponent::Context::ConvertToOwningReference() -{ - this->AddRef(); - return NS_OK; -}; - #ifdef XP_MAC #pragma mark - #endif