From e4582843fbe48240ba1a87a4d4046d9680dd7b21 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Fri, 7 Sep 2018 20:28:40 -0400 Subject: backport mozbug 1350090: Turn off the spammy warning that goes off every time we create an about:blank content viewer; r=mystor During a debug session, log spam appears because we are trying to get the origin out of a principal for about:blank, which will throw, which is expected. --- extensions/cookie/nsPermissionManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'extensions') diff --git a/extensions/cookie/nsPermissionManager.cpp b/extensions/cookie/nsPermissionManager.cpp index 1f3c257dd..13ae7fd35 100644 --- a/extensions/cookie/nsPermissionManager.cpp +++ b/extensions/cookie/nsPermissionManager.cpp @@ -107,7 +107,11 @@ nsresult GetOriginFromPrincipal(nsIPrincipal* aPrincipal, nsACString& aOrigin) { nsresult rv = aPrincipal->GetOriginNoSuffix(aOrigin); - NS_ENSURE_SUCCESS(rv, rv); + // The principal may belong to the about:blank content viewer, so this can be + // expected to fail. + if (NS_FAILED(rv)) { + return rv; + } nsAutoCString suffix; rv = aPrincipal->GetOriginSuffix(suffix); -- cgit v1.2.3