Bug 1305037 - simplify the declaration of loadFlags r?franziskus draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 23 Sep 2016 15:06:52 +0200
changeset 417007 3ce676a5cafc3c932760e85e09f5c2bc7b8431c6
parent 417006 5135aeb9ada0e440f4d84e2526690c5b00cc7bd6
child 532005 e9b36b755dab9261dde0d8e88c14574ef9a36588
push id30308
push userbmo:sledru@mozilla.com
push dateFri, 23 Sep 2016 13:19:36 +0000
reviewersfranziskus
bugs1305037
milestone51.0a1
Bug 1305037 - simplify the declaration of loadFlags r?franziskus MozReview-Commit-ID: GNpwDjPp631
browser/components/about/AboutRedirector.cpp
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -140,17 +140,16 @@ AboutRedirector::NewChannel(nsIURI* aURI
 
   nsresult rv;
   nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (int i = 0; i < kRedirTotal; i++) {
     if (!strcmp(path.get(), kRedirMap[i].id)) {
       nsAutoCString url;
-      nsLoadFlags loadFlags = static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL);
 
       if (path.EqualsLiteral("newtab")) {
         // let the aboutNewTabService decide where to redirect
         nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
           do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         rv = aboutNewTabService->GetDefaultURL(url);
         NS_ENSURE_SUCCESS(rv, rv);
@@ -158,17 +157,16 @@ AboutRedirector::NewChannel(nsIURI* aURI
         // if about:newtab points to an external resource we have to make sure
         // the content is signed and trusted
         bool remoteEnabled = false;
         rv = aboutNewTabService->GetRemoteEnabled(&remoteEnabled);
         NS_ENSURE_SUCCESS(rv, rv);
         if (remoteEnabled) {
           NS_ENSURE_ARG_POINTER(aLoadInfo);
           aLoadInfo->SetVerifySignedContent(true);
-          loadFlags = static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);
         }
       }
       // fall back to the specified url in the map
       if (url.IsEmpty()) {
         url.AssignASCII(kRedirMap[i].url);
       }
 
       nsCOMPtr<nsIChannel> tempChannel;
@@ -180,17 +178,17 @@ AboutRedirector::NewChannel(nsIURI* aURI
       // chrome:// or resource://) then set the LOAD_REPLACE flag on the
       // channel which forces the channel owner to reflect the displayed
       // URL rather then being the systemPrincipal.
       bool isUIResource = false;
       rv = NS_URIChainHasFlags(tempURI, nsIProtocolHandler::URI_IS_UI_RESOURCE,
                                &isUIResource);
       NS_ENSURE_SUCCESS(rv, rv);
 
-      loadFlags = isUIResource
+      nsLoadFlags loadFlags = isUIResource
                     ? static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL)
                     : static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);
 
       rv = NS_NewChannelInternal(getter_AddRefs(tempChannel),
                                  tempURI,
                                  aLoadInfo,
                                  nullptr, // aLoadGroup
                                  nullptr, // aCallbacks