Closed Bug 783407 Opened 12 years ago Closed 5 years ago

cookiejars: get channel or nsILoadContext for NPAPI cookie calls

Categories

(Core :: Networking: Cookies, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1334509

People

(Reporter: jduell.mcbugs, Unassigned)

References

Details

(Whiteboard: [necko-backlog])

nsNPAPIPlugin.cpp has calls to Get/SetCookieString w/o passing in an nsIChannel, so we can't get appID/inBrowser. Fix to pass channel (or add IDL version that takes nsILoadContext if channel not accessible). We can use GetDocumentFromNPP to get nsIDocument, and hopefully use .GetChannel to get channel to pass. Not needed until/unless we support NPAPI in child processes, and/or we want to allow plugins to access non-default cookie namespaces. I.e. not basecamp.
bz: do you know if nsIDocument.GetChannel ought to always return a non-null channel by the time an NPAPI plugin in that document calls _set/getvalueforurl?
Depends on: 756648
I don't think so. The exception is an about:blank synthetic document; I believe right now those can end up never getting an mChannel. We could try to fix that, though.
bz: how about GetLoadContext()? Will mDocumentContainer always be valid at this point? It would be easy to add a new cookie IDL function that takes a LoadContext directly instead of a channel.
I think that there should be a useful document container in all cases in which we're instantiating an NPAPI plugin, yes.
Whiteboard: [necko-backlog]
Priority: -- → P1
Priority: P1 → P3

nsNPAPIPlugin doesn't set cookie anymore. See bug 1334509.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.