Bug 1497658 part 1. Remove a useless GetCurrentJSContext check in MakeScriptDialogTitle. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 09 Oct 2018 17:02:13 -0400
changeset 496100 b635e6611d125ec4ba09fa7733ffb6124784b276
parent 496099 27220a0817340817fbaec8f9227e01836279a9d5
child 496101 296fa4a869ae27297569005bb09b5bc4f3750ca0
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1497658
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 1497658 part 1. Remove a useless GetCurrentJSContext check in MakeScriptDialogTitle. r=mccr8 We want to just use the subject principal URI. In practice, all our callers are script anyway, it turns out...
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -4449,20 +4449,17 @@ nsGlobalWindowOuter::MakeScriptDialogTit
 
   aOutTitle.Truncate();
 
   // Try to get a host from the running principal -- this will do the
   // right thing for javascript: and data: documents.
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = aSubjectPrincipal->GetURI(getter_AddRefs(uri));
-  // Note - The check for the current JSContext here isn't necessarily sensical.
-  // It's just designed to preserve existing behavior during a mass-conversion
-  // patch.
-  if (NS_SUCCEEDED(rv) && uri && nsContentUtils::GetCurrentJSContext()) {
+  if (NS_SUCCEEDED(rv) && uri) {
     // remove user:pass for privacy and spoof prevention
 
     nsCOMPtr<nsIURIFixup> fixup(do_GetService(NS_URIFIXUP_CONTRACTID));
     if (fixup) {
       nsCOMPtr<nsIURI> fixedURI;
       rv = fixup->CreateExposableURI(uri, getter_AddRefs(fixedURI));
       if (NS_SUCCEEDED(rv) && fixedURI) {
         nsAutoCString host;