зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2f9561ccd777 (bug 1342927) for asserting at chrome://browser/content/tabbrowser.xml:3995:25 e.g. in browser/browser_menu_item_01.js. r=backout
This commit is contained in:
Родитель
5370d1fe82
Коммит
d936fbcd20
|
@ -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<TabParent> 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<TabContext>
|
||||
ContentParent::GetManagedTabContext()
|
||||
{
|
||||
|
|
|
@ -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<TabContext> GetManagedTabContext();
|
||||
|
||||
virtual POfflineCacheUpdateParent*
|
||||
|
|
|
@ -1022,9 +1022,6 @@ parent:
|
|||
*/
|
||||
async NotifyTabDestroying(TabId tabId,
|
||||
ContentParentId cpId);
|
||||
|
||||
async TabChildNotReady(TabId tabId);
|
||||
|
||||
/**
|
||||
* Starts an offline application cache update.
|
||||
* @param manifestURI
|
||||
|
|
|
@ -34,7 +34,6 @@ protocol PProcessHangMonitor
|
|||
parent:
|
||||
async HangEvidence(HangData data);
|
||||
async ClearHang();
|
||||
async Ready();
|
||||
|
||||
child:
|
||||
async TerminateScript();
|
||||
|
|
|
@ -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<PProcessHangMonitorParent>&& 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<nsUint32HashKey, nsString> mBrowserCrashDumpIds;
|
||||
Mutex mBrowserCrashDumpHashLock;
|
||||
mozilla::ipc::TaskFactory<HangMonitorParent> 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<PProcessHangMonitorChild>&& aEndpoint)
|
|||
|
||||
DebugOnly<bool> 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)
|
||||
{
|
||||
|
|
|
@ -3332,25 +3332,6 @@ TabParent::LiveResizeStopped()
|
|||
SuppressDisplayport(false);
|
||||
}
|
||||
|
||||
void
|
||||
TabParent::DispatchTabChildNotReadyEvent()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
nsCOMPtr<mozilla::dom::EventTarget> target = do_QueryInterface(mFrameElement);
|
||||
if (!target) {
|
||||
NS_WARNING("Could not locate target for tab child not ready event.");
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<Event> 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)
|
||||
{
|
||||
|
|
|
@ -599,8 +599,6 @@ public:
|
|||
void LiveResizeStarted() override;
|
||||
void LiveResizeStopped() override;
|
||||
|
||||
void DispatchTabChildNotReadyEvent();
|
||||
|
||||
protected:
|
||||
bool ReceiveMessage(const nsString& aMessage,
|
||||
bool aSync,
|
||||
|
|
Загрузка…
Ссылка в новой задаче