mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=539406 retain existing listener in AyncChannel for GeckoChildProcessHost::OnChannelConnected r=cjones
This commit is contained in:
parent
f61df0bf35
commit
7354faf277
@ -72,7 +72,11 @@ class Channel : public Message::Sender {
|
||||
void Close();
|
||||
|
||||
// Modify the Channel's listener.
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
Listener* set_listener(Listener* listener);
|
||||
#else
|
||||
void set_listener(Listener* listener);
|
||||
#endif
|
||||
|
||||
// Send a message over the Channel to the listener on the other end.
|
||||
//
|
||||
|
@ -807,9 +807,15 @@ void Channel::Close() {
|
||||
channel_impl_->Close();
|
||||
}
|
||||
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
Channel::Listener* Channel::set_listener(Listener* listener) {
|
||||
return channel_impl_->set_listener(listener);
|
||||
}
|
||||
#else
|
||||
void Channel::set_listener(Listener* listener) {
|
||||
channel_impl_->set_listener(listener);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Channel::Send(Message* message) {
|
||||
return channel_impl_->Send(message);
|
||||
|
@ -27,7 +27,15 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
|
||||
~ChannelImpl() { Close(); }
|
||||
bool Connect();
|
||||
void Close();
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
Listener* set_listener(Listener* listener) {
|
||||
Listener* old = listener_;
|
||||
listener_ = listener;
|
||||
return old;
|
||||
}
|
||||
#else
|
||||
void set_listener(Listener* listener) { listener_ = listener; }
|
||||
#endif
|
||||
bool Send(Message* message);
|
||||
void GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) const;
|
||||
|
||||
|
@ -430,9 +430,15 @@ void Channel::Close() {
|
||||
channel_impl_->Close();
|
||||
}
|
||||
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
Channel::Listener* Channel::set_listener(Listener* listener) {
|
||||
return channel_impl_->set_listener(listener);
|
||||
}
|
||||
#else
|
||||
void Channel::set_listener(Listener* listener) {
|
||||
channel_impl_->set_listener(listener);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Channel::Send(Message* message) {
|
||||
return channel_impl_->Send(message);
|
||||
|
@ -23,7 +23,15 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler {
|
||||
~ChannelImpl() { Close(); }
|
||||
bool Connect();
|
||||
void Close();
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
Listener* set_listener(Listener* listener) {
|
||||
Listener* old = listener_;
|
||||
listener_ = listener;
|
||||
return old;
|
||||
}
|
||||
#else
|
||||
void set_listener(Listener* listener) { listener_ = listener; }
|
||||
#endif
|
||||
bool Send(Message* message);
|
||||
private:
|
||||
const std::wstring PipeName(const std::wstring& channel_id) const;
|
||||
|
@ -92,7 +92,8 @@ AsyncChannel::AsyncChannel(AsyncListener* aListener)
|
||||
mIOLoop(),
|
||||
mWorkerLoop(),
|
||||
mChild(false),
|
||||
mChannelErrorTask(NULL)
|
||||
mChannelErrorTask(NULL),
|
||||
mExistingListener(NULL)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AsyncChannel);
|
||||
}
|
||||
@ -112,7 +113,7 @@ AsyncChannel::Open(Transport* aTransport, MessageLoop* aIOLoop)
|
||||
// FIXME need to check for valid channel
|
||||
|
||||
mTransport = aTransport;
|
||||
mTransport->set_listener(this);
|
||||
mExistingListener = mTransport->set_listener(this);
|
||||
|
||||
// FIXME figure out whether we're in parent or child, grab IO loop
|
||||
// appropriately
|
||||
@ -432,9 +433,14 @@ AsyncChannel::OnChannelConnected(int32 peer_pid)
|
||||
{
|
||||
AssertIOThread();
|
||||
|
||||
MutexAutoLock lock(mMutex);
|
||||
mChannelState = ChannelConnected;
|
||||
mCvar.Notify();
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
mChannelState = ChannelConnected;
|
||||
mCvar.Notify();
|
||||
}
|
||||
|
||||
if(mExistingListener)
|
||||
mExistingListener->OnChannelConnected(peer_pid);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -191,6 +191,7 @@ protected:
|
||||
MessageLoop* mWorkerLoop; // thread where work is done
|
||||
bool mChild; // am I the child or parent?
|
||||
CancelableTask* mChannelErrorTask; // NotifyMaybeChannelError runnable
|
||||
IPC::Channel::Listener* mExistingListener; // channel's previous listener
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user