making nsPresShell and nsDocument support weak references; using weak references to docs and pres shells within the editor
git-svn-id: svn://10.0.0.236/trunk@44483 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsICaret.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIXMLDocument.h"
|
||||
@@ -110,7 +111,7 @@ static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
|
||||
class PresShell : public nsIPresShell, public nsIViewObserver,
|
||||
private nsIDocumentObserver, public nsIFocusTracker,
|
||||
public nsIDOMSelectionListener
|
||||
public nsIDOMSelectionListener, public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
PresShell();
|
||||
@@ -432,6 +433,12 @@ PresShell::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(nsCOMTypeInfo<nsISupportsWeakReference>::GetIID())) {
|
||||
nsISupportsWeakReference* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
nsIPresShell* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
|
||||
Reference in New Issue
Block a user