Bug 1627707 - Rename LoadInfo::LoadingPrincipal to GetLoadingPrincipal as it can return null. r=ckerschb
Mostly a matter of: rg -l '\->LoadingPrincipal' | xargs sed -i 's/->LoadingPrincipal/->GetLoadingPrincipal/g' And then clang-format. But I tweaked manually nsHttpChannelAuthProvider (move the variable where it's used, don't take a useless strong ref), AddonContentPolicy (move the declaration of the variable to the if condition), and BackgroundUtils (same). Differential Revision: https://phabricator.services.mozilla.com/D69828
This commit is contained in:
@@ -446,7 +446,7 @@ static inline bool IsSystemPrincipal(nsIPrincipal* aPrincipal) {
|
||||
|
||||
bool ChannelWrapper::IsSystemLoad() const {
|
||||
if (nsCOMPtr<nsILoadInfo> loadInfo = GetLoadInfo()) {
|
||||
if (nsIPrincipal* prin = loadInfo->LoadingPrincipal()) {
|
||||
if (nsIPrincipal* prin = loadInfo->GetLoadingPrincipal()) {
|
||||
return IsSystemPrincipal(prin);
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ bool ChannelWrapper::CanModify() const {
|
||||
}
|
||||
|
||||
if (nsCOMPtr<nsILoadInfo> loadInfo = GetLoadInfo()) {
|
||||
if (nsIPrincipal* prin = loadInfo->LoadingPrincipal()) {
|
||||
if (nsIPrincipal* prin = loadInfo->GetLoadingPrincipal()) {
|
||||
if (IsSystemPrincipal(prin)) {
|
||||
return false;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ already_AddRefed<nsIURI> ChannelWrapper::GetOriginURI() const {
|
||||
already_AddRefed<nsIURI> ChannelWrapper::GetDocumentURI() const {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
if (nsCOMPtr<nsILoadInfo> loadInfo = GetLoadInfo()) {
|
||||
if (nsIPrincipal* prin = loadInfo->LoadingPrincipal()) {
|
||||
if (nsIPrincipal* prin = loadInfo->GetLoadingPrincipal()) {
|
||||
if (prin->GetIsContentPrincipal()) {
|
||||
Unused << prin->GetURI(getter_AddRefs(uri));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user