Bug 1695050 - Part 9: Update the call-site of CookieJarSettings::Create() for WebExecutorSupport. r=esawin

The WebExecutorSupport::CreateStreamLoader() would need the
cookieJarSettings. This patch updates the call-site to pass the correct
enum according to the fact that if the request from the private mode.

Differential Revision: https://phabricator.services.mozilla.com/D109052
This commit is contained in:
Tim Huang 2021-03-29 11:01:54 +00:00
parent 5a8c1b586c
commit 025dcb0651

View File

@ -381,14 +381,15 @@ nsresult WebExecutorSupport::CreateStreamLoader(
channel->SetLoadFlags(nsIRequest::LOAD_ANONYMOUS);
}
nsCOMPtr<nsICookieJarSettings> cookieJarSettings;
if (aFlags & java::GeckoWebExecutor::FETCH_FLAGS_PRIVATE) {
nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(channel);
NS_ENSURE_TRUE(pbChannel, NS_ERROR_FAILURE);
pbChannel->SetPrivate(true);
cookieJarSettings = CookieJarSettings::Create(CookieJarSettings::ePrivate);
} else {
cookieJarSettings = CookieJarSettings::Create(CookieJarSettings::eRegular);
}
nsCOMPtr<nsICookieJarSettings> cookieJarSettings =
CookieJarSettings::Create();
MOZ_ASSERT(cookieJarSettings);
nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();