Decouple the execution of javascript: URIs from the question of whether they

have known subject principals.  Make it possible for callers to control
execution on a per-channel basis.  Bug 369244, r=jst, sr=brendan
This commit is contained in:
bzbarsky@mit.edu
2007-02-16 01:01:39 +00:00
parent 742a1d5618
commit 3df2131832
4 changed files with 163 additions and 51 deletions

View File

@@ -103,6 +103,7 @@
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsIScrollableView.h"
#include "nsIScriptChannel.h"
// we want to explore making the document own the load group
// so we can associate the document URI with the load group.
@@ -6963,6 +6964,12 @@ nsDocShell::DoURILoad(nsIURI * aURI,
rv = URIInheritsSecurityContext(aURI, &inherit);
if (NS_SUCCEEDED(rv) && (inherit || IsAboutBlank(aURI))) {
channel->SetOwner(aOwner);
nsCOMPtr<nsIScriptChannel> scriptChannel = do_QueryInterface(channel);
if (scriptChannel) {
// Allow execution against our context if the principals match
scriptChannel->
SetExecutionPolicy(nsIScriptChannel::EXECUTE_NORMAL);
}
}
if (aIsNewWindowTarget) {