Closed Bug 510041 Opened 15 years ago Closed 15 years ago

Subprotocols of sync protocols should implement the SyncChannelListener

Categories

(Core :: IPC, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: cjones)

Details

Currently subprotocols of sync protocols must also be sync, or you get build errors:

In file included from ../../../src/dom/ipc/ContentProcessChild.h:6,

                 from ../../../src/dom/ipc/ContentProcessThread.h:47,

                 from ../../../src/dom/ipc/ContentProcessThread.cpp:40:

../../ipc/ipdl/_ipdlheaders/mozilla/dom/ContentProcessProtocolChild.h: In member function ‘virtual<unnamed>::Result mozilla::dom::ContentProcessProtocolChild::OnMessageReceived(const IPC::Message&)’:

../../ipc/ipdl/_ipdlheaders/mozilla/dom/ContentProcessProtocolChild.h:94: error: no matching function for call to ‘mozilla::dom::ContentProcessProtocolChild::RegisterID(mozilla::dom::IFrameEmbeddingProtocolChild*&, int&)’

../../ipc/ipdl/_ipdlheaders/mozilla/dom/ContentProcessProtocolChild.h:161: note: candidates are: virtual int32 mozilla::dom::ContentProcessProtocolChild::RegisterID(mozilla::ipc::SyncChannel::SyncListener*, int32)

../../ipc/ipdl/_ipdlheaders/mozilla/dom/ContentProcessProtocolChild.h:95: error: cannot convert ‘mozilla::dom::ContentProcessProtocolChild* const’ to ‘mozilla::ipc::IProtocolManager<mozilla::ipc::AsyncChannel::AsyncListener>*’ in assignment

../../ipc/ipdl/_ipdlheaders/mozilla/dom/ContentProcessProtocolChild.h:115: error: invalid static_cast from type ‘mozilla::ipc::SyncChannel::SyncListener*’ to type ‘mozilla::dom::IFrameEmbeddingProtocolChild*’

As a bonus, I'd really like to statically enforce sync restriction separately in each direction, e.g. you can have sync messages child->parent, but only async messages parent->child.
This is just a C++ implementation detail.  It should be done irrespective of whether the subprotocol itself is sync or not --- the subprotocol does *not* have to sync if the parent is.

As bsmedberg points out, the workaround for this bug is to declare the subprotocol 'sync'.
Summary: Subprotocols of sync protocols must also be sync → Subprotocols of sync protocols should implement the SyncChannelListener
Pushed http://hg.mozilla.org/projects/electrolysis/rev/096c63f84069
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.