Explicit response to destructor messages before the destructor is actually called

Benjamin Smedberg <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
I have two protocols:

protocol NPP
{
  manages NPBrowserStream;

child:
  NPBrowserStream(...);

both:
  ~NPBrowserStream();
};

protocol NPBrowserStream
{
  manager NPP;
  ...
};

The two-way ~NPBrowserStream destructor models two different calls in NPAPI:

NPP_DestroyStream -- the browser closes the stream
NPN_DestroyStream -- the plugin closes the stream

I'm writing bits of NPPInstanceParent right now, and I don't think I can
respond to these messages differently the way I need to:

* If I'm receving NPBrowserStreamDestructor from the other side, I need to
call NPN_DestroyStream
* If I'm sending NPBrowserStreamDestructor, I'm being called from
NPP_DestroyStream

But as far as I can tell there's no
NPPInstanceProtocolParent::RecvNPBrowserStreamDestructor method I can
override... I think I want one before the IPDL machinery calls
NPBrowserStreamDestructor directly.

--BDS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.