Open Bug 1301637 Opened 8 years ago Updated 2 months ago

Replace SerializedLoadContext with LoadInfo

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

People

(Reporter: allstars.chh, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

Now when Necko child talks to Necko Parent, it uses SerializedLoadContext, which is generated from the nsILoadContext (docshell), hence SerializedLoadContext carries the origin attributes of the docshell, not the document.

In Bug 1125916 we make the origin attributes from the document to be stored on the loadInfo of the channel.
So if we can replace SerializedLoadContext with LoadInfo, then Necko parent could get the correct OA from the document.

The reason we want this feature is in FirstPartyIsolation, bug 1260931, the top-level document will have different OA then the top-level docshell, and also because those network requests are originated from the document, hence we could use the OA from document, instead of docshell.
Can we actually replace the SerializedLoadContext with the LoadInfo? Or do we just want to create the SerializedLoadContext using the document's OA?
I assume this needs to be decided quickly if we want to meet the Tor timeline.
Flags: needinfo?(jduell.mcbugs)
Flags: needinfo?(allstars.chh)
Whiteboard: [necko-active]
Assigning to Jason to decide the best person for this.
Assignee: nobody → jduell.mcbugs
Is there a reason that this is urgent? As of bug 1291652, we should already be getting the OriginAttributes from the nsILoadInfo when determining which cookies to send. At least I thought so?

So we should already be getting the right cookies for Tor.

We should still deprecated SerializedLoadContext/nsILoadContext and more relevant functionality into nsILoadInfo. However that is more of a code cleanup thing.
(In reply to Valentin Gosu [:valentin] from comment #1)
> Can we actually replace the SerializedLoadContext with the LoadInfo? Or do
> we just want to create the SerializedLoadContext using the document's OA?
> I assume this needs to be decided quickly if we want to meet the Tor
> timeline.
(In reply to Jonas Sicking (:sicking) No longer reading bugmail consistently from comment #3)
> Is there a reason that this is urgent? As of bug 1291652, we should already
> be getting the OriginAttributes from the nsILoadInfo when determining which
> cookies to send. At least I thought so?
> 
> So we should already be getting the right cookies for Tor.
> 
I also thought bug 1291652 fixed the problem, until we found Bug 1301406,
but I try to pass NeckoOriginAttributes directly in that case.

If replacing SerializedLoadContext still needs some work, we'll see if there are other alternative solution like bug 1301406, to pass NeckoOriginAttributes, or reuse loadInfoArgs to get the correct OA.
Flags: needinfo?(allstars.chh)
> If replacing SerializedLoadContext still needs some work, we'll see if there 
> are other alternative solution like bug 1301406, to pass NeckoOriginAttributes

It does seem like SerializedLoadContext is becoming a crufty, duplicate way of passing data to the parent, and I'm guessing we'll want to eventually replace it by passing either NeckoOriginAttributes or LoadInfo, like in bug 1301406. (Or maybe we already have all the info we need from SerializedLoadContext elsewhere?)

But it also looks like Jonas is right that this isn't urgent, especially now that the TOR bug seems to have been fixed without this happening.

I'm putting this on our TODO list, but not sure when we'll get to it.  Yoshi, if you're interested in fixing it feel free to take it.
Assignee: jduell.mcbugs → nobody
Flags: needinfo?(jduell.mcbugs)
Whiteboard: [necko-active] → [necko-next]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P2
Moving to p3 because no activity for at least 1 year(s).
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Severity: normal → S3
Whiteboard: [necko-next] → [necko-triaged]
You need to log in before you can comment on or make changes to this bug.