cookiejars: get channel or nsILoadContext for NPAPI cookie calls

NEW
Unassigned

Status

()

Core
Networking: Cookies
P3
normal
6 years ago
9 months ago

People

(Reporter: jduell, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

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.
(Reporter)

Comment 1

6 years ago
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?
(Reporter)

Updated

6 years ago
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.
(Reporter)

Comment 3

6 years ago
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]
You need to log in before you can comment on or make changes to this bug.