Bug 1641270 - Part 6: Pass CookieJarSettings to nsIWebBrowserPersist.saveURI() and nsIWebBrowserPersist.savePrivacyAwareURI(). r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D95616
This commit is contained in:
Tim Huang
2020-11-11 18:19:27 +00:00
parent 7e87d0ee7f
commit c60a2bd45c
11 changed files with 74 additions and 33 deletions

View File

@@ -8,6 +8,7 @@
#include "nsIImageLoadingContent.h"
#include "mozilla/dom/Document.h"
#include "nsIContent.h"
#include "nsICookieJarSettings.h"
#include "nsIObserverService.h"
#include "nsIWebBrowserPersist.h"
#include "nsMacShellService.h"
@@ -153,8 +154,11 @@ nsMacShellService::SetDesktopBackground(Element* aElement, int32_t aPosition,
auto referrerInfo =
mozilla::MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
nsCOMPtr<nsICookieJarSettings> cookieJarSettings =
aElement->OwnerDoc()->CookieJarSettings();
return wbp->SaveURI(imageURI, aElement->NodePrincipal(), 0, referrerInfo,
nullptr, nullptr, mBackgroundFile,
cookieJarSettings, nullptr, nullptr, mBackgroundFile,
nsIContentPolicy::TYPE_IMAGE, loadContext);
}