Bug 341915: can we move nsIScriptContext(Owner) from dom to xpconnect

r=timeless, sr=jst
This commit is contained in:
mhammond%skippinet.com.au 2006-07-19 04:15:50 +00:00
parent 59bf00c8eb
commit ca11f368e4
4 changed files with 12 additions and 9 deletions

View File

@ -54,7 +54,6 @@ class nsIVariant;
class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsScriptObjectHolder;
class nsIDOMDocument;
typedef void (*nsScriptTerminationFunc)(nsISupports* aRef);
@ -443,9 +442,10 @@ public:
/**
* Tell the context our global has a new document, and the scope
* used by it.
* used by it. Use nsISupports to avoid dependency issues - but expect
* a QI for nsIDOMDocument and/or nsIDocument.
*/
virtual void DidSetDocument(nsIDOMDocument *aDoc, void *aGlobal) = 0;
virtual void DidSetDocument(nsISupports *aDoc, void *aGlobal) = 0;
/* Memory managment for script objects. Used by the implementation of
* nsScriptObjectHolder to manage the lifetimes of the held script objects.

View File

@ -154,7 +154,7 @@ public:
virtual void WillInitializeContext();
virtual void DidInitializeContext();
virtual void DidSetDocument(nsIDOMDocument *aDocdoc, void *aGlobal) {;}
virtual void DidSetDocument(nsISupports *aDocdoc, void *aGlobal) {;}
virtual nsresult Serialize(nsIObjectOutputStream* aStream, void *aScriptObject);
virtual nsresult Deserialize(nsIObjectInputStream* aStream,

View File

@ -288,7 +288,7 @@ nsPythonContext::InitContext(nsIScriptGlobalObject *aGlobalObject)
}
void
nsPythonContext::DidSetDocument(nsIDOMDocument *aDoc, void *aGlobal)
nsPythonContext::DidSetDocument(nsISupports *aSupDoc, void *aGlobal)
{
NS_TIMELINE_MARK_FUNCTION("nsPythonContext::DidSetDocument");
NS_ASSERTION(mDelegate != NULL, "No delegate");
@ -298,9 +298,12 @@ nsPythonContext::DidSetDocument(nsIDOMDocument *aDoc, void *aGlobal)
CEnterLeavePython _celp;
PyObject *obDoc;
if (aDoc) {
obDoc = PyObject_FromNSDOMInterface(mDelegate, aDoc,
NS_GET_IID(nsIDOMDocument));
if (aSupDoc) {
nsCOMPtr<nsIDOMDocument> doc(do_QueryInterface(aSupDoc));
NS_ASSERTION(nsnull != doc, "not an nsIDOMDocument!?");
if (nsnull != doc)
obDoc = PyObject_FromNSDOMInterface(mDelegate, aSupDoc,
NS_GET_IID(nsIDOMDocument));
if (!obDoc) {
HandlePythonError();
return;

View File

@ -204,7 +204,7 @@ public:
virtual void WillInitializeContext();
virtual void DidInitializeContext();
virtual void DidSetDocument(nsIDOMDocument *aDocdoc, void *aGlobal);
virtual void DidSetDocument(nsISupports *aDocdoc, void *aGlobal);
virtual nsresult Serialize(nsIObjectOutputStream* aStream, void *aScriptObject);
virtual nsresult Deserialize(nsIObjectInputStream* aStream,