зеркало из https://github.com/mozilla/gecko-dev.git
Changed GetDocumentLoadGroup(...) to be XPCom complient. THis helps prevent leaks when using nsCOMPtrs.
This commit is contained in:
Родитель
69eebbead3
Коммит
f7a23e30ca
|
@ -1829,11 +1829,12 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
|
|||
NS_ADDREF(this);
|
||||
|
||||
nsIUnicharStreamLoader* loader;
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
|
||||
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
|
||||
rv = NS_NewUnicharStreamLoader(&loader,
|
||||
url,
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
|
||||
#endif
|
||||
loadGroup,
|
||||
(nsStreamCompleteFunc)nsDoneLoadingScript,
|
||||
(void *)this);
|
||||
NS_RELEASE(url);
|
||||
|
|
|
@ -538,7 +538,7 @@ public:
|
|||
|
||||
virtual nsIPrincipal* GetDocumentPrincipal() const;
|
||||
|
||||
virtual nsILoadGroup* GetDocumentLoadGroup() const;
|
||||
NS_IMETHOD GetDocumentLoadGroup(nsILoadGroup **aGroup) const;
|
||||
|
||||
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
|
||||
|
||||
|
@ -1525,13 +1525,12 @@ XULDocumentImpl::GetDocumentPrincipal() const
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
nsILoadGroup*
|
||||
XULDocumentImpl::GetDocumentLoadGroup() const
|
||||
NS_IMETHODIMP
|
||||
XULDocumentImpl::GetDocumentLoadGroup(nsILoadGroup **aGroup) const
|
||||
{
|
||||
nsILoadGroup* result = mDocumentLoadGroup;
|
||||
NS_IF_ADDREF(result);
|
||||
return result;
|
||||
*aGroup = mDocumentLoadGroup;
|
||||
NS_IF_ADDREF(*aGroup);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -783,7 +783,7 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
|
|||
if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) {
|
||||
NS_ASSERTION(doc, "expect document here");
|
||||
if (doc) {
|
||||
loadGroup = doc->GetDocumentLoadGroup();
|
||||
doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -783,7 +783,7 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
|
|||
if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) {
|
||||
NS_ASSERTION(doc, "expect document here");
|
||||
if (doc) {
|
||||
loadGroup = doc->GetDocumentLoadGroup();
|
||||
doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -1829,11 +1829,12 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
|
|||
NS_ADDREF(this);
|
||||
|
||||
nsIUnicharStreamLoader* loader;
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
|
||||
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
|
||||
rv = NS_NewUnicharStreamLoader(&loader,
|
||||
url,
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
|
||||
#endif
|
||||
loadGroup,
|
||||
(nsStreamCompleteFunc)nsDoneLoadingScript,
|
||||
(void *)this);
|
||||
NS_RELEASE(url);
|
||||
|
|
|
@ -538,7 +538,7 @@ public:
|
|||
|
||||
virtual nsIPrincipal* GetDocumentPrincipal() const;
|
||||
|
||||
virtual nsILoadGroup* GetDocumentLoadGroup() const;
|
||||
NS_IMETHOD GetDocumentLoadGroup(nsILoadGroup **aGroup) const;
|
||||
|
||||
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
|
||||
|
||||
|
@ -1525,13 +1525,12 @@ XULDocumentImpl::GetDocumentPrincipal() const
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
nsILoadGroup*
|
||||
XULDocumentImpl::GetDocumentLoadGroup() const
|
||||
NS_IMETHODIMP
|
||||
XULDocumentImpl::GetDocumentLoadGroup(nsILoadGroup **aGroup) const
|
||||
{
|
||||
nsILoadGroup* result = mDocumentLoadGroup;
|
||||
NS_IF_ADDREF(result);
|
||||
return result;
|
||||
*aGroup = mDocumentLoadGroup;
|
||||
NS_IF_ADDREF(*aGroup);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1597,11 +1597,12 @@ XULContentSinkImpl::OpenScript(const nsIParserNode& aNode)
|
|||
mCurrentScriptURL = url;
|
||||
|
||||
nsIUnicharStreamLoader* loader;
|
||||
nsCOMPtr<nsILoadGroup> group;
|
||||
|
||||
mDocument->GetDocumentLoadGroup(getter_AddRefs(group));
|
||||
rv = NS_NewUnicharStreamLoader(&loader,
|
||||
url,
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
|
||||
#endif
|
||||
group,
|
||||
(nsStreamCompleteFunc)DoneLoadingScript,
|
||||
(void *)this);
|
||||
NS_RELEASE(url);
|
||||
|
|
Загрузка…
Ссылка в новой задаче