Make content grab the cached security manager off of nsContentUtils rather than ask the service manager to find one.

Bug 223192; r+sr=bzbarsky
This commit is contained in:
caillon@returnzero.com
2003-10-30 03:01:25 +00:00
parent 5af7749956
commit 5e556dfe05
20 changed files with 70 additions and 126 deletions

View File

@@ -57,6 +57,7 @@
#include "nsIDocShellLoadInfo.h"
#include "nsIBaseWindow.h"
#include "nsIWebShell.h"
#include "nsContentUtils.h"
#include "nsIScriptSecurityManager.h"
@@ -182,15 +183,13 @@ nsFrameLoader::LoadFrame()
PromiseFlatCString(doc_charset).get(), base_uri);
NS_ENSURE_SUCCESS(rv, rv);
// Check for security
nsCOMPtr<nsIScriptSecurityManager> secMan =
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
mDocShell->CreateLoadInfo(getter_AddRefs(loadInfo));
NS_ENSURE_TRUE(loadInfo, NS_ERROR_FAILURE);
// Check for security
nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
// Get referring URL
nsCOMPtr<nsIURI> referrer;
nsCOMPtr<nsIPrincipal> principal;