Bug 1499384: add debug logging for expandedprincipals r=ckerschb
authorFrederik Braun <fbraun@mozilla.com>
Mon, 22 Oct 2018 12:49:10 +0000
changeset 442336 76763ce5587582f94bcdebd9efb3ce6f625085ea
parent 442335 e7d0ae555a8d4cf6068f84648253fafffe9bf498
child 442337 2e5b99d12a6daf88e4fffa8f80efb7b874f18379
push id71455
push userrvandermeulen@mozilla.com
push dateMon, 22 Oct 2018 14:35:27 +0000
treeherderautoland@76763ce55875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1499384
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499384: add debug logging for expandedprincipals r=ckerschb Extending the MOZ_LOGging for content security checks to provide a proper serialization of expanded principals Differential Revision: https://phabricator.services.mozilla.com/D8958
dom/security/nsContentSecurityManager.cpp
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -631,18 +631,21 @@ LogPrincipal(nsIPrincipal* aPrincipal, c
   }
   if (aPrincipal) {
     if (aPrincipal->GetIsNullPrincipal()) {
       MOZ_LOG(sCSMLog, LogLevel::Debug, ("  %s: NullPrincipal\n",
        NS_ConvertUTF16toUTF8(aPrincipalName).get()));
       return;
     }
     if (aPrincipal->GetIsExpandedPrincipal()) {
-      MOZ_LOG(sCSMLog, LogLevel::Debug, ("  %s: Expanded Principal\n",
-        NS_ConvertUTF16toUTF8(aPrincipalName).get()));
+      nsAutoCString origin;
+      aPrincipal->GetOrigin(origin);
+      MOZ_LOG(sCSMLog, LogLevel::Debug, ("  %s: %s\n",
+        NS_ConvertUTF16toUTF8(aPrincipalName).get(),
+        origin.get()));
       return;
     }
     nsCOMPtr<nsIURI> principalURI;
     nsAutoCString principalSpec;
     aPrincipal->GetURI(getter_AddRefs(principalURI));
     if (principalURI) {
       principalURI->GetSpec(principalSpec);
     }