Bug 1635094 - Cleanup the ReferrerInfo code. r=ckerschb
The cast in InitWithNode is wrong. AsElement() asserts instead of checking the flag, so we always pass an element (and if we didn't we'd have type confusion problems). I audited the callers and we're fine. Anyhow, always require an element, and add two convenience constructors for C++ code. Differential Revision: https://phabricator.services.mozilla.com/D73636
This commit is contained in:
@@ -1918,8 +1918,7 @@ nsresult nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol,
|
||||
getter_AddRefs(srcURI), imageSrc, doc, mContent->GetBaseURI());
|
||||
if (!srcURI) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIReferrerInfo> referrerInfo = new mozilla::dom::ReferrerInfo();
|
||||
referrerInfo->InitWithDocument(doc);
|
||||
auto referrerInfo = MakeRefPtr<mozilla::dom::ReferrerInfo>(*doc);
|
||||
|
||||
// XXXbz what's the origin principal for this stuff that comes from our
|
||||
// view? I guess we should assume that it's the node's principal...
|
||||
|
||||
Reference in New Issue
Block a user