Bug 1006671 - Remove unnecessary JSContext argument to nsContentUtils::GetContentSecurityPolicy. r=bholley

This commit is contained in:
Nathan Yee 2014-07-10 19:25:00 +02:00
parent 23d13553bc
commit da5b38f868
4 changed files with 4 additions and 8 deletions

View File

@ -476,8 +476,7 @@ public:
/**
* Get the ContentSecurityPolicy for a JS context.
**/
static bool GetContentSecurityPolicy(JSContext* aCx,
nsIContentSecurityPolicy** aCSP);
static bool GetContentSecurityPolicy(nsIContentSecurityPolicy** aCSP);
// Returns the subject principal. Guaranteed to return non-null. May only
// be called when nsContentUtils is initialized.

View File

@ -6359,11 +6359,9 @@ nsContentUtils::FindInternalContentViewer(const char* aType,
}
bool
nsContentUtils::GetContentSecurityPolicy(JSContext* aCx,
nsIContentSecurityPolicy** aCSP)
nsContentUtils::GetContentSecurityPolicy(nsIContentSecurityPolicy** aCSP)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
MOZ_ASSERT(aCx == GetCurrentJSContext());
nsCOMPtr<nsIContentSecurityPolicy> csp;
nsresult rv = SubjectPrincipal()->GetCsp(getter_AddRefs(csp));

View File

@ -3925,8 +3925,7 @@ WorkerPrivate::GetLoadInfo(JSContext* aCx, nsPIDOMWindow* aWindow,
MOZ_ASSERT(loadInfo.mPrincipal);
MOZ_ASSERT(isChrome || !loadInfo.mDomain.IsEmpty());
if (!nsContentUtils::GetContentSecurityPolicy(aCx,
getter_AddRefs(loadInfo.mCSP))) {
if (!nsContentUtils::GetContentSecurityPolicy(getter_AddRefs(loadInfo.mCSP))) {
NS_WARNING("Failed to get CSP!");
return NS_ERROR_FAILURE;
}

View File

@ -1902,7 +1902,7 @@ nsCrypto::GenerateCRMFRequest(JSContext* aContext,
}
nsCOMPtr<nsIContentSecurityPolicy> csp;
if (!nsContentUtils::GetContentSecurityPolicy(aContext, getter_AddRefs(csp))) {
if (!nsContentUtils::GetContentSecurityPolicy(getter_AddRefs(csp))) {
NS_ERROR("Error: failed to get CSP");
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;