mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
This commit is contained in:
parent
58c8c1a2c1
commit
9ae1129462
@ -1971,12 +1971,6 @@ void ContentParent::OnChannelError() {
|
||||
PContentParent::OnChannelError();
|
||||
}
|
||||
|
||||
void ContentParent::OnChannelConnected(int32_t pid) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
SetOtherProcessId(pid);
|
||||
}
|
||||
|
||||
void ContentParent::ProcessingError(Result aCode, const char* aReason) {
|
||||
if (MsgDropped == aCode) {
|
||||
return;
|
||||
|
@ -716,8 +716,6 @@ class ContentParent final
|
||||
bool CheckBrowsingContextEmbedder(CanonicalBrowsingContext* aBC,
|
||||
const char* aOperation) const;
|
||||
|
||||
void OnChannelConnected(int32_t pid) override;
|
||||
|
||||
void ActorDestroy(ActorDestroyReason why) override;
|
||||
void ActorDealloc() override;
|
||||
|
||||
|
@ -145,16 +145,20 @@ void VRManagerParent::Shutdown() {
|
||||
|
||||
void VRManagerParent::ActorDestroy(ActorDestroyReason why) {}
|
||||
|
||||
void VRManagerParent::ActorAlloc() {
|
||||
// FIXME: This actor should probably use proper refcounting instead of manual
|
||||
// reference management, and probably shouldn't manage
|
||||
// `mCompositorThreadHolder` in the alloc/dealloc methods.
|
||||
PVRManagerParent::ActorAlloc();
|
||||
mCompositorThreadHolder = CompositorThreadHolder::GetSingleton();
|
||||
}
|
||||
|
||||
void VRManagerParent::ActorDealloc() {
|
||||
UnregisterFromManager();
|
||||
mCompositorThreadHolder = nullptr;
|
||||
mSelfRef = nullptr;
|
||||
}
|
||||
|
||||
void VRManagerParent::OnChannelConnected(int32_t aPid) {
|
||||
mCompositorThreadHolder = CompositorThreadHolder::GetSingleton();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult VRManagerParent::RecvDetectRuntimes() {
|
||||
// Detect runtime capabilities. This will return the presense of VR and/or AR
|
||||
// runtime software, without enumerating or activating any hardware devices.
|
||||
|
@ -48,7 +48,6 @@ class VRManagerParent final : public PVRManagerParent {
|
||||
bool DeallocPVRLayerParent(PVRLayerParent* actor);
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
void OnChannelConnected(int32_t pid) override;
|
||||
|
||||
mozilla::ipc::IPCResult RecvDetectRuntimes();
|
||||
mozilla::ipc::IPCResult RecvRefreshDisplays();
|
||||
@ -74,6 +73,7 @@ class VRManagerParent final : public PVRManagerParent {
|
||||
mozilla::ipc::IPCResult RecvResetPuppet();
|
||||
|
||||
private:
|
||||
void ActorAlloc() override;
|
||||
void ActorDealloc() override;
|
||||
void RegisterWithManager();
|
||||
void UnregisterFromManager();
|
||||
|
@ -583,8 +583,6 @@ MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener)
|
||||
mAbortOnError(false),
|
||||
mNotifiedChannelDone(false),
|
||||
mFlags(REQUIRE_DEFAULT),
|
||||
mPeerPidSet(false),
|
||||
mPeerPid(-1),
|
||||
mIsPostponingSends(false),
|
||||
mBuildIDsConfirmedMatch(false),
|
||||
mIsSameThreadChannel(false) {
|
||||
@ -593,13 +591,7 @@ MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener)
|
||||
#ifdef OS_WIN
|
||||
mTopFrame = nullptr;
|
||||
mIsSyncWaitingOnNonMainThread = false;
|
||||
#endif
|
||||
|
||||
mOnChannelConnectedTask = NewNonOwningCancelableRunnableMethod(
|
||||
"ipc::MessageChannel::DispatchOnChannelConnected", this,
|
||||
&MessageChannel::DispatchOnChannelConnected);
|
||||
|
||||
#ifdef OS_WIN
|
||||
mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr);
|
||||
MOZ_RELEASE_ASSERT(mEvent, "CreateEvent failed! Nothing is going to work!");
|
||||
#endif
|
||||
@ -773,8 +765,6 @@ void MessageChannel::Clear() {
|
||||
mLink = nullptr;
|
||||
}
|
||||
|
||||
mOnChannelConnectedTask->Cancel();
|
||||
|
||||
if (mChannelErrorTask) {
|
||||
mChannelErrorTask->Cancel();
|
||||
mChannelErrorTask = nullptr;
|
||||
@ -2386,20 +2376,6 @@ void MessageChannel::SetReplyTimeoutMs(int32_t aTimeoutMs) {
|
||||
(aTimeoutMs <= 0) ? kNoTimeout : (int32_t)ceil((double)aTimeoutMs / 2.0);
|
||||
}
|
||||
|
||||
void MessageChannel::OnChannelConnected(int32_t peer_id) {
|
||||
MOZ_RELEASE_ASSERT(!mPeerPidSet);
|
||||
mPeerPidSet = true;
|
||||
mPeerPid = peer_id;
|
||||
RefPtr<CancelableRunnable> task = mOnChannelConnectedTask;
|
||||
mWorkerThread->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void MessageChannel::DispatchOnChannelConnected() {
|
||||
AssertWorkerThread();
|
||||
MOZ_RELEASE_ASSERT(mPeerPidSet);
|
||||
mListener->OnChannelConnected(mPeerPid);
|
||||
}
|
||||
|
||||
void MessageChannel::ReportMessageRouteError(const char* channelName) const {
|
||||
PrintErrorMessage(mSide, channelName, "Need a route");
|
||||
mListener->ProcessingError(MsgRouteError, "MsgRouteError");
|
||||
|
@ -394,9 +394,6 @@ class MessageChannel : HasResultCodes {
|
||||
|
||||
void Clear();
|
||||
|
||||
// Send OnChannelConnected notification to listeners.
|
||||
void DispatchOnChannelConnected();
|
||||
|
||||
bool InterruptEventOccurred();
|
||||
bool HasPendingEvents();
|
||||
|
||||
@ -531,8 +528,6 @@ class MessageChannel : HasResultCodes {
|
||||
// thread, in which case it shouldn't be delivered to the worker.
|
||||
bool MaybeInterceptSpecialIOMessage(const Message& aMsg);
|
||||
|
||||
void OnChannelConnected(int32_t peer_id);
|
||||
|
||||
// Tell the IO thread to close the channel and wait for it to ACK.
|
||||
void SynchronouslyClose();
|
||||
|
||||
@ -851,13 +846,6 @@ class MessageChannel : HasResultCodes {
|
||||
// See SetChannelFlags
|
||||
ChannelFlags mFlags;
|
||||
|
||||
// Task and state used to asynchronously notify channel has been connected
|
||||
// safely. This is necessary to be able to cancel notification if we are
|
||||
// closed at the same time.
|
||||
RefPtr<CancelableRunnable> mOnChannelConnectedTask;
|
||||
bool mPeerPidSet;
|
||||
int32_t mPeerPid;
|
||||
|
||||
// Channels can enter messages are not sent immediately; instead, they are
|
||||
// held in a queue until another thread deems it is safe to send them.
|
||||
bool mIsPostponingSends;
|
||||
|
@ -315,8 +315,6 @@ void ProcessLink::OnTakeConnectedChannel() {
|
||||
void ProcessLink::OnChannelConnected(int32_t peer_pid) {
|
||||
AssertIOThread();
|
||||
|
||||
bool notifyChannel = false;
|
||||
|
||||
{
|
||||
MonitorAutoLock lock(*mChan->mMonitor);
|
||||
// Do not force it into connected if it has errored out, started
|
||||
@ -326,17 +324,12 @@ void ProcessLink::OnChannelConnected(int32_t peer_pid) {
|
||||
mChan->mChannelState == ChannelConnected) {
|
||||
mChan->mChannelState = ChannelConnected;
|
||||
mChan->mMonitor->Notify();
|
||||
notifyChannel = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mExistingListener) {
|
||||
mExistingListener->OnChannelConnected(peer_pid);
|
||||
}
|
||||
|
||||
if (notifyChannel) {
|
||||
mChan->OnChannelConnected(peer_pid);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessLink::OnChannelConnectError() {
|
||||
|
@ -434,7 +434,6 @@ class IToplevelProtocol : public IProtocol {
|
||||
virtual void OnChannelClose() = 0;
|
||||
virtual void OnChannelError() = 0;
|
||||
virtual void ProcessingError(Result aError, const char* aMsgName) {}
|
||||
virtual void OnChannelConnected(int32_t peer_pid) {}
|
||||
|
||||
bool Open(UniquePtr<Transport> aTransport, base::ProcessId aOtherPid,
|
||||
MessageLoop* aThread = nullptr,
|
||||
|
Loading…
Reference in New Issue
Block a user