mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 780818 - Remove getExtendedOrigin from nsILoadContext. r=smaug, sr=sicking
This commit is contained in:
parent
6b41ad6972
commit
8c13f6d202
@ -97,14 +97,4 @@ LoadContext::GetAppId(PRUint32* aAppId)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LoadContext::GetExtendedOrigin(nsIURI* aUri, nsACString& aResult)
|
||||
{
|
||||
MOZ_ASSERT(mIsNotNull);
|
||||
|
||||
nsIScriptSecurityManager* ssmgr = nsContentUtils::GetSecurityManager();
|
||||
|
||||
return ssmgr->GetExtendedOrigin(aUri, mAppId, mIsInBrowserElement, aResult);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -11395,20 +11395,6 @@ nsDocShell::GetIsContent(bool *aIsContent)
|
||||
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, NS_ERROR_FAILURE);
|
||||
|
||||
return ssmgr->GetExtendedOrigin(aUri, mAppId, isInBrowserElement, aResult);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
nsDocShell::IsOKToLoadURI(nsIURI* aURI)
|
||||
{
|
||||
|
@ -228,7 +228,6 @@ public:
|
||||
NS_IMETHOD GetIsContent(bool*);
|
||||
NS_IMETHOD GetUsePrivateBrowsing(bool*);
|
||||
NS_IMETHOD SetUsePrivateBrowsing(bool);
|
||||
NS_IMETHOD GetExtendedOrigin(nsIURI *uri, nsACString & retval);
|
||||
|
||||
// Restores a cached presentation from history (mLSHE).
|
||||
// This method swaps out the content viewer and simulates loads for
|
||||
|
@ -7,14 +7,13 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMWindow;
|
||||
interface nsIURI;
|
||||
|
||||
/**
|
||||
* An nsILoadContext represents the context of a load. This interface
|
||||
* can be queried for various information about where the load is
|
||||
* happening.
|
||||
*/
|
||||
[scriptable, uuid(386806c3-c4cb-4b3d-b05d-c08ea10f5585)]
|
||||
[scriptable, uuid(48b5bf16-e0c7-11e1-b28e-91726188709b)]
|
||||
interface nsILoadContext : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -79,19 +78,4 @@ interface nsILoadContext : nsISupports
|
||||
*/
|
||||
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);
|
||||
};
|
||||
|
@ -1330,27 +1330,6 @@ NS_UsePrivateBrowsing(nsIChannel *channel)
|
||||
return loadContext && loadContext->UsePrivateBrowsing();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets ExtendedOrigin value for given channel's nsILoadContext.
|
||||
* Returns false if error or channel's callbacks don't implement nsILoadContext.
|
||||
*/
|
||||
inline bool
|
||||
NS_GetExtendedOrigin(nsIChannel *aChannel, nsACString &aResult)
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
NS_QueryNotificationCallbacks(aChannel, loadContext);
|
||||
if (!loadContext) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = aChannel->GetURI(getter_AddRefs(uri));
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
rv = loadContext->GetExtendedOrigin(uri, aResult);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets AppId and isInBrowserElement from channel's nsILoadContext.
|
||||
* Returns false if error or channel's callbacks don't implement nsILoadContext.
|
||||
|
Loading…
x
Reference in New Issue
Block a user