Bug 83536.
Merge script principal implementations into one class. Should reduce footprint, speed up calls to caps a little bit, and fixes several memory leaks. Also fixes bugs 211174 and 211263 r=jst@netscape.com sr=bzbarsky@mit.edu moa=mstoltz@netscape.com (he looked at an earlier patch and said it looked fine, and will do a retroactive review when he returns from vacation as well) git-svn-id: svn://10.0.0.236/trunk@145137 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -868,18 +868,16 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||
if (channel) {
|
||||
nsCOMPtr<nsISupports> owner;
|
||||
channel->GetOwner(getter_AddRefs(owner));
|
||||
nsCOMPtr<nsIPrincipal> prin;
|
||||
|
||||
if (owner) {
|
||||
prin = do_QueryInterface(owner, &rv);
|
||||
}
|
||||
|
||||
rv = mDocument->AddPrincipal(prin);
|
||||
if (NS_FAILED(rv)) {
|
||||
mPendingRequests.RemoveObject(request);
|
||||
FireScriptAvailable(rv, request, NS_LITERAL_STRING(""));
|
||||
ProcessPendingReqests();
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIPrincipal> principal = do_QueryInterface(owner);
|
||||
|
||||
if (principal) {
|
||||
rv = mDocument->AddPrincipal(principal);
|
||||
if (NS_FAILED(rv)) {
|
||||
mPendingRequests.RemoveObject(request);
|
||||
FireScriptAvailable(rv, request, NS_LITERAL_STRING(""));
|
||||
ProcessPendingReqests();
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user