Commit 060270c6 authored by Tom Schuster's avatar Tom Schuster Committed by tschuster@mozilla.com
Browse files

Bug 1967261 - Create channel with the correct nsILoadInfo from the beginning...

Bug 1967261 - Create channel with the correct nsILoadInfo from the beginning in PageIconProtocolHandler. r=necko-reviewers,places-reviewers,kershaw,Standard8

Differential Revision: https://phabricator.services.mozilla.com/D250124
parent f1c9ab02
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -220,19 +220,9 @@ nsresult PageIconProtocolHandler::NewChannelInternal(nsIURI* aURI,

  // Create our channel.
  nsCOMPtr<nsIChannel> channel;
  {
    // We override the channel's loadinfo below anyway, so using a null
    // principal here is alright.
    nsCOMPtr<nsIPrincipal> loadingPrincipal =
        NullPrincipal::CreateWithoutOriginAttributes();
    nsresult rv = NS_NewInputStreamChannel(
        getter_AddRefs(channel), aURI, pipeIn.forget(), loadingPrincipal,
        nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
        nsIContentPolicy::TYPE_INTERNAL_IMAGE);
    NS_ENSURE_SUCCESS(rv, rv);
  }

  nsresult rv = channel->SetLoadInfo(aLoadInfo);
  nsresult rv = NS_NewInputStreamChannelInternal(
      getter_AddRefs(channel), aURI, pipeIn.forget(), /* aContentType */ ""_ns,
      /* aContentCharset */ ""_ns, aLoadInfo);
  NS_ENSURE_SUCCESS(rv, rv);

  GetFaviconData(aURI)->Then(