Skip to content

Commit

Permalink
Bug 780818 - Remove getExtendedOrigin from nsILoadContext. r=smaug, s…
Browse files Browse the repository at this point in the history
…r=sicking
  • Loading branch information
jduell committed Aug 8, 2012
1 parent 5f0ec98 commit c7d0e89
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 63 deletions.
10 changes: 0 additions & 10 deletions docshell/base/LoadContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 0 additions & 14 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion docshell/base/nsDocShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ class nsDocShell : public nsDocLoader,
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
Expand Down
18 changes: 1 addition & 17 deletions docshell/base/nsILoadContext.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down Expand Up @@ -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);
};
21 changes: 0 additions & 21 deletions netwerk/base/public/nsNetUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c7d0e89

Please sign in to comment.