336903 - feeds should not run with chrome privileges. Expose a currentDocumentChannel attribute on nsIDocShell to look at the channel of the currently loaded page (so that we can find out its actual real URI, etc vs. what webNavigation thinks it is (originalURI). r=bz sr=darin
git-svn-id: svn://10.0.0.236/trunk@201021 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1739,6 +1739,27 @@ nsDocShell::AddSessionStorage(const nsACString& aDomain,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetCurrentDocumentChannel(nsIChannel** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
if (!mContentViewer)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
nsresult rv = mContentViewer->GetDOMDocument(getter_AddRefs(domDoc));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
|
||||
if (doc) {
|
||||
*aResult = doc->GetChannel();
|
||||
NS_IF_ADDREF(*aResult);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsDocShell::nsIDocShellTreeItem
|
||||
//*****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user