Closed Bug 520302 Opened 15 years ago Closed 14 years ago

Consider using IPDL to enforce valid NPIdentifiers in OOP plugin code

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bent.mozilla, Unassigned)

Details

Spun off from bug 516524, bsmedberg wants to make IPDL responsible for verifying valid identifiers rather than doing it manually. He says:

---

I'm a little queasy about the serialization of NPIdentifier. In some ways I'd
prefer for it to be a protocol, or at least have IPDL enforce that it be
sanity-checked rather than spreading calls to EnsureValidIdentifier in each
method which receives an NPIdentifier. e.g.:

protocol PPluginModule
{
parent:
  check NPIdentifier;
};

Which translates into a signature

bool
PPluginModuleParent::CheckNPIdentifier(NPIdentifier value) = 0;

And IPDL calls this signature whenever an NPIdentifier comes across the wire.
Do we still want this?  bent and I discussed it a while back, and IIRC we thought that invalid NPIdentifiers wouldn't cause enough problems to make a feature like this worthwhile.  I think it's a neat idea in general though.
I think we really do want this: relying on EnsureValidIdentifier is mistake-prone. In addition, silverlight especially has a lot of extra RPC traffic relating to identifiers... they call NPN_UTF8FromIdentifier a lot, and that really has lifetime issues. I'd really like the non-first NPN_GetStringIdentifier and NPN_GetIntIdentifier to be IPC-free.
Any reason this is still open?  We have PPluginIdentifier now.
Nope, this is done.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.