Include triggering node in load info when doing prefetching

RESOLVED FIXED in Firefox 41

Status

()

defect
RESOLVED FIXED
4 years ago
4 months ago

People

(Reporter: billm, Assigned: billm)

Tracking

(Blocks 1 bug)

Trunk
mozilla41
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

Posted patch patchSplinter Review
When we see a <link rel="prefetch">, we don't associate the <link> node with the LoadInfo when we do the prefetch. I'm not sure if there's a reason why we don't, but it would be nice for add-ons. Chrome's webRequest extension API associates these prefetched loads with the frame that included the <link> element, so this change would make us more compatible with Chrome.
Attachment #8614947 - Flags: review?(mozilla)
Comment on attachment 8614947 [details] [diff] [review]
patch

Review of attachment 8614947 [details] [diff] [review]:
-----------------------------------------------------------------

::: uriloader/prefetch/nsPrefetchService.cpp
@@ +199,1 @@
>  

Thanks for looking at this. In fact that sounds like a great change to me. I am always happy to accept changes where we can replace the systemPrincipal with some more precise info. The loadingNode and the loadingPrincipal must match however, see [1]. But that's an easy fix:

nsresult rv = NS_NewChannelInternal(getter_AddRefs(mChannel),
                                    mURI,
                                    source,
                                    source->NodePrincipal(),
                                    nullptr, //aTriggeringPrincipal
                                    ...

That should do it.

[1] http://mxr.mozilla.org/mozilla-central/source/netwerk/base/LoadInfo.cpp#39
Attachment #8614947 - Flags: review?(mozilla) → review+
Please fix the indentation to not use tabs?
https://hg.mozilla.org/mozilla-central/rev/1f7eb3853f3c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.