Bug 1357208 - No warning message when the creation of the principal origin fails, r=bholley
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 19 Apr 2017 08:00:11 +0200
changeset 565148 58c4711b8ca2cf89a74368f93c93d8fcd2b5c6f0
parent 565147 600f9d60d76ffa8498a32fcf6ddf5b2856a6fbb0
child 565149 0510315b5641dbab766002a58b306eb8b880569c
push id54802
push userdgottwald@mozilla.com
push dateWed, 19 Apr 2017 15:26:27 +0000
reviewersbholley
bugs1357208
milestone55.0a1
Bug 1357208 - No warning message when the creation of the principal origin fails, r=bholley
caps/BasePrincipal.cpp
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -372,17 +372,17 @@ already_AddRefed<BasePrincipal>
 BasePrincipal::CreateCodebasePrincipal(nsIURI* aURI,
                                        const OriginAttributes& aAttrs)
 {
   MOZ_ASSERT(aURI);
 
   nsAutoCString originNoSuffix;
   nsresult rv =
     ContentPrincipal::GenerateOriginNoSuffixFromURI(aURI, originNoSuffix);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
+  if (NS_FAILED(rv)) {
     // If the generation of the origin fails, we still want to have a valid
     // principal. Better to return a null principal here.
     return NullPrincipal::Create(aAttrs);
   }
 
   return CreateCodebasePrincipal(aURI, aAttrs, originNoSuffix);
 }