diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 7855298439c3..abd7f1d76874 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -4250,23 +4250,6 @@ ContentParent::RecvNotifyTabDestroying(const TabId& aTabId, return IPC_OK(); } -mozilla::ipc::IPCResult -ContentParent::RecvTabChildNotReady(const TabId& aTabId) -{ - ContentProcessManager* cpm = ContentProcessManager::GetSingleton(); - RefPtr tp = - cpm->GetTopLevelTabParentByProcessAndTabId(this->ChildID(), aTabId); - - if (!tp) { - NS_WARNING("Couldn't find TabParent for TabChildNotReady message."); - return IPC_OK(); - } - - tp->DispatchTabChildNotReadyEvent(); - - return IPC_OK(); -} - nsTArray ContentParent::GetManagedTabContext() { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 277af8e043c9..bcce037cb2ad 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -491,8 +491,6 @@ public: virtual mozilla::ipc::IPCResult RecvNotifyTabDestroying(const TabId& aTabId, const ContentParentId& aCpId) override; - virtual mozilla::ipc::IPCResult RecvTabChildNotReady(const TabId& aTabId) override; - nsTArray GetManagedTabContext(); virtual POfflineCacheUpdateParent* diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 276c266d6c19..40eabfd39d99 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -1022,9 +1022,6 @@ parent: */ async NotifyTabDestroying(TabId tabId, ContentParentId cpId); - - async TabChildNotReady(TabId tabId); - /** * Starts an offline application cache update. * @param manifestURI diff --git a/dom/ipc/PProcessHangMonitor.ipdl b/dom/ipc/PProcessHangMonitor.ipdl index 0ad30fe4e8ec..07ee7a21118d 100644 --- a/dom/ipc/PProcessHangMonitor.ipdl +++ b/dom/ipc/PProcessHangMonitor.ipdl @@ -34,7 +34,6 @@ protocol PProcessHangMonitor parent: async HangEvidence(HangData data); async ClearHang(); - async Ready(); child: async TerminateScript(); diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp index 7e5d3b921f29..3e69f94907ed 100644 --- a/dom/ipc/ProcessHangMonitor.cpp +++ b/dom/ipc/ProcessHangMonitor.cpp @@ -12,13 +12,11 @@ #include "mozilla/Atomics.h" #include "mozilla/BackgroundHangMonitor.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/TabChild.h" #include "mozilla/dom/TabParent.h" -#include "mozilla/ipc/TaskFactory.h" #include "mozilla/Monitor.h" #include "mozilla/plugins/PluginBridge.h" #include "mozilla/Preferences.h" @@ -196,8 +194,6 @@ public: mDumpId.Truncate(); } - void DispatchTabChildNotReady(TabId aTabId); - private: ~HangMonitoredProcess() = default; @@ -217,7 +213,6 @@ public: void Bind(Endpoint&& aEndpoint); - mozilla::ipc::IPCResult RecvReady() override; mozilla::ipc::IPCResult RecvHangEvidence(const HangData& aHangData) override; mozilla::ipc::IPCResult RecvClearHang() override; @@ -246,8 +241,6 @@ public: private: bool TakeBrowserMinidump(const PluginHangData& aPhd, nsString& aCrashId); - void DispatchTabChildNotReady(TabId aTabId); - void ForcePaintOnThread(TabId aTabId, uint64_t aLayerObserverEpoch); void ShutdownOnThread(); @@ -257,12 +250,6 @@ private: // This field is read-only after construction. bool mReportHangs; - // This field is only accessed on the hang thread. Inits to - // false, and will flip to true once the HangMonitorChild is - // constructed in the child process, and sends a message saying - // so. - bool mReady; - // This field is only accessed on the hang thread. bool mIPCOpen; @@ -274,7 +261,6 @@ private: // Map from plugin ID to crash dump ID. Protected by mBrowserCrashDumpHashLock. nsDataHashtable mBrowserCrashDumpIds; Mutex mBrowserCrashDumpHashLock; - mozilla::ipc::TaskFactory mMainThreadTaskFactory; }; } // namespace @@ -332,11 +318,6 @@ HangMonitorChild::InterruptCallback() if (tabChild) { js::AutoAssertNoContentJS nojs(mContext); tabChild->ForcePaint(forcePaintEpoch); - } else { - auto cc = ContentChild::GetSingleton(); - if (cc) { - cc->SendTabChildNotReady(forcePaintTab); - } } } } @@ -442,8 +423,6 @@ HangMonitorChild::Bind(Endpoint&& aEndpoint) DebugOnly ok = aEndpoint.Bind(this); MOZ_ASSERT(ok); - - Unused << SendReady(); } void @@ -566,12 +545,10 @@ HangMonitorChild::ClearHangAsync() HangMonitorParent::HangMonitorParent(ProcessHangMonitor* aMonitor) : mHangMonitor(aMonitor), - mReady(false), mIPCOpen(true), mMonitor("HangMonitorParent lock"), mShutdownDone(false), - mBrowserCrashDumpHashLock("mBrowserCrashDumpIds lock"), - mMainThreadTaskFactory(this) + mBrowserCrashDumpHashLock("mBrowserCrashDumpIds lock") { MOZ_RELEASE_ASSERT(NS_IsMainThread()); mReportHangs = mozilla::Preferences::GetBool("dom.ipc.reportProcessHangs", false); @@ -637,38 +614,13 @@ HangMonitorParent::ForcePaint(dom::TabParent* aTab, uint64_t aLayerObserverEpoch this, &HangMonitorParent::ForcePaintOnThread, id, aLayerObserverEpoch)); } -void -HangMonitorParent::DispatchTabChildNotReady(TabId aTabId) -{ - MOZ_RELEASE_ASSERT(NS_IsMainThread()); - if (!mProcess) { - return; - } - - mProcess->DispatchTabChildNotReady(aTabId); -} - void HangMonitorParent::ForcePaintOnThread(TabId aTabId, uint64_t aLayerObserverEpoch) { MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop()); if (mIPCOpen) { - if (mReady) { - Unused << SendForcePaint(aTabId, aLayerObserverEpoch); - } else { - // We've never heard from the HangMonitorChild before, so - // it's either not finished setting up, or has only recently - // finished setting up. In either case, we're dealing with - // a new content process that probably hasn't had time to - // get the ContentChild, let alone the TabChild for aTabId, - // set up, and so attempting to force paint on the non-existant - // TabChild is not going to work. Instead, we tell the main - // thread that we're waiting on a TabChild to be created. - NS_DispatchToMainThread( - mMainThreadTaskFactory.NewRunnableMethod( - &HangMonitorParent::DispatchTabChildNotReady, aTabId)); - } + Unused << SendForcePaint(aTabId, aLayerObserverEpoch); } } @@ -766,14 +718,6 @@ HangMonitorParent::TakeBrowserMinidump(const PluginHangData& aPhd, return false; } -mozilla::ipc::IPCResult -HangMonitorParent::RecvReady() -{ - MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop()); - mReady = true; - return IPC_OK(); -} - mozilla::ipc::IPCResult HangMonitorParent::RecvHangEvidence(const HangData& aHangData) { @@ -1114,17 +1058,6 @@ HangMonitoredProcess::UserCanceled() return NS_OK; } -void -HangMonitoredProcess::DispatchTabChildNotReady(TabId aTabId) -{ - MOZ_RELEASE_ASSERT(NS_IsMainThread()); - if (!mContentParent) { - return; - } - - Unused << mContentParent->RecvTabChildNotReady(aTabId); -} - static bool InterruptCallback(JSContext* cx) { diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index b5696ac07a3b..cdebe620619b 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -3332,25 +3332,6 @@ TabParent::LiveResizeStopped() SuppressDisplayport(false); } -void -TabParent::DispatchTabChildNotReadyEvent() -{ - MOZ_ASSERT(NS_IsMainThread()); - - nsCOMPtr target = do_QueryInterface(mFrameElement); - if (!target) { - NS_WARNING("Could not locate target for tab child not ready event."); - return; - } - - RefPtr event = NS_NewDOMEvent(mFrameElement, nullptr, nullptr); - event->InitEvent(NS_LITERAL_STRING("MozTabChildNotReady"), true, false); - event->SetTrusted(true); - event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true; - bool dummy; - mFrameElement->DispatchEvent(event, &dummy); -} - NS_IMETHODIMP FakeChannel::OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo) { diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index ebf36d56363c..548ec4a32ca4 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -599,8 +599,6 @@ public: void LiveResizeStarted() override; void LiveResizeStopped() override; - void DispatchTabChildNotReadyEvent(); - protected: bool ReceiveMessage(const nsString& aMessage, bool aSync,