Bug 776140 - Add GetExtendedOrigin method to nsILoadContext. r=jlebar, sr=sicking
This commit is contained in:
@@ -11364,6 +11364,20 @@ nsDocShell::GetIsContent(bool *aIsContent)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDocShell::GetExtendedOrigin(nsIURI *aUri, nsACString &aResult)
|
||||||
|
{
|
||||||
|
bool isInBrowserElement;
|
||||||
|
GetIsInBrowserElement(&isInBrowserElement);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIScriptSecurityManager> ssmgr =
|
||||||
|
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);
|
||||||
|
NS_ENSURE_TRUE(ssmgr, false);
|
||||||
|
|
||||||
|
return ssmgr->GetExtendedOrigin(aUri, mAppId, isInBrowserElement, aResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsDocShell::IsOKToLoadURI(nsIURI* aURI)
|
nsDocShell::IsOKToLoadURI(nsIURI* aURI)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ public:
|
|||||||
NS_IMETHOD GetIsContent(bool*);
|
NS_IMETHOD GetIsContent(bool*);
|
||||||
NS_IMETHOD GetUsePrivateBrowsing(bool*);
|
NS_IMETHOD GetUsePrivateBrowsing(bool*);
|
||||||
NS_IMETHOD SetUsePrivateBrowsing(bool);
|
NS_IMETHOD SetUsePrivateBrowsing(bool);
|
||||||
|
NS_IMETHOD GetExtendedOrigin(nsIURI *uri, nsACString & retval);
|
||||||
|
|
||||||
// Restores a cached presentation from history (mLSHE).
|
// Restores a cached presentation from history (mLSHE).
|
||||||
// This method swaps out the content viewer and simulates loads for
|
// This method swaps out the content viewer and simulates loads for
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
|
|
||||||
interface nsIDOMWindow;
|
interface nsIDOMWindow;
|
||||||
|
interface nsIURI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An nsILoadContext represents the context of a load. This interface
|
* An nsILoadContext represents the context of a load. This interface
|
||||||
@@ -78,4 +79,19 @@ interface nsILoadContext : nsISupports
|
|||||||
*/
|
*/
|
||||||
readonly attribute unsigned long appId;
|
readonly attribute unsigned long appId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the extended origin of a channel in this load context.
|
||||||
|
* The extended origin is a string that has more information than the origin
|
||||||
|
* and can be used to isolate data or permissions between different
|
||||||
|
* principals while taking into account parameters like the app id or the
|
||||||
|
* fact that the load is taking place in a mozbrowser.
|
||||||
|
*
|
||||||
|
* In some cases this function will simply return the origin for the
|
||||||
|
* channel's URI.
|
||||||
|
*
|
||||||
|
* The extendedOrigin is intended to be an opaque identifier. It is
|
||||||
|
* currently "human-readable" but no callers should assume it will stay
|
||||||
|
* as-is and it might be crypto-hashed at some point.
|
||||||
|
*/
|
||||||
|
AUTF8String GetExtendedOrigin(in nsIURI channel);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user