Backed out 8 changesets (bug 1331804, bug 1332100) for windows vm debug dt5 failures a=backout

Backed out changeset 8bf7f0e27c6c (bug 1331804)
Backed out changeset 600c0b9026c2 (bug 1331804)
Backed out changeset 3a5b5b9ecace (bug 1331804)
Backed out changeset c76432c9954e (bug 1331804)
Backed out changeset 46a9096745e7 (bug 1332100)
Backed out changeset 8b751230fa23 (bug 1331804)
Backed out changeset 2810212347fd (bug 1331804)
Backed out changeset be72b7763910 (bug 1331804)

MozReview-Commit-ID: Ywdsr4GZ4a
This commit is contained in:
Wes Kocher 2017-01-24 15:12:21 -08:00
parent 6985d8d31e
commit f7ccafcb58
34 changed files with 43 additions and 201 deletions

View file

@ -66,22 +66,10 @@ TimerCallback(nsITimer*, void* aClosure)
}
void
TimerNameCallback(nsITimer* aTimer, bool aAnonymize, void* aClosure,
char* aBuf, size_t aLen)
TimerNameCallback(nsITimer* aTimer, void* aClosure, char* aBuf, size_t aLen)
{
RefPtr<Timeout> timeout = (Timeout*)aClosure;
// Filename and line-number information is privacy sensitive. If we're
// supposed to anonymize the data, don't include it.
if (aAnonymize) {
if (timeout->mIsInterval) {
snprintf(aBuf, aLen, "setInterval");
} else {
snprintf(aBuf, aLen, "setTimeout");
}
return;
}
const char* filename;
uint32_t lineNum, column;
timeout->mScriptHandler->GetLocation(&filename, &lineNum, &column);

View file

@ -5284,7 +5284,7 @@ nsDocument::UnblockDOMContentLoaded()
MOZ_RELEASE_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
Dispatch("nsDocument::DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
Dispatch("DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
} else {
DispatchContentLoadedEvents();
}
@ -12059,7 +12059,7 @@ nsDocument::PostVisibilityUpdateEvent()
{
nsCOMPtr<nsIRunnable> event =
NewRunnableMethod(this, &nsDocument::UpdateVisibilityState);
Dispatch("nsDocument::UpdateVisibilityState", TaskCategory::Other, event.forget());
Dispatch("UpdateVisibility", TaskCategory::Other, event.forget());
}
void
@ -12600,10 +12600,6 @@ nsDocument::UpdateIntersectionObservations()
void
nsDocument::ScheduleIntersectionObserverNotification()
{
if (mIntersectionObservers.IsEmpty()) {
return;
}
MOZ_RELEASE_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIRunnable> notification =
NewRunnableMethod(this, &nsDocument::NotifyIntersectionObservers);

View file

@ -8552,7 +8552,7 @@ nsGlobalWindow::PostMessageMozOuter(JSContext* aCx, JS::Handle<JS::Value> aMessa
return;
}
aError = Dispatch("PostMessageEvent", TaskCategory::Other, event.forget());
aError = Dispatch("PostMessage", TaskCategory::Other, event.forget());
}
void

View file

@ -1742,8 +1742,7 @@ public:
static void Dispatch(already_AddRefed<NotifyOffThreadScriptLoadCompletedRunnable>&& aSelf) {
RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> self = aSelf;
RefPtr<DocGroup> docGroup = self->mDocGroup;
docGroup->Dispatch("NotifyOffThreadScriptLoadCompletedRunnable",
TaskCategory::Other, self.forget());
docGroup->Dispatch("OffThreadScriptLoader", TaskCategory::Other, self.forget());
}
NS_DECL_NSIRUNNABLE

View file

@ -68,14 +68,14 @@ AsyncEventDispatcher::PostDOMEvent()
RefPtr<AsyncEventDispatcher> ensureDeletionWhenFailing = this;
if (NS_IsMainThread()) {
if (nsCOMPtr<nsIGlobalObject> global = mTarget->GetOwnerGlobal()) {
return global->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
return global->Dispatch("AsyncEvent", TaskCategory::Other, ensureDeletionWhenFailing.forget());
}
// Sometimes GetOwnerGlobal returns null because it uses
// GetScriptHandlingObject rather than GetScopeObject.
if (nsCOMPtr<nsINode> node = do_QueryInterface(mTarget)) {
nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
return doc->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
return doc->Dispatch("AsyncEvent", TaskCategory::Other, ensureDeletionWhenFailing.forget());
}
}
return NS_DispatchToCurrentThread(this);

View file

@ -7206,7 +7206,7 @@ HTMLMediaElement::AsyncResolvePendingPlayPromises()
= new nsResolveOrRejectPendingPlayPromisesRunner(this,
TakePendingPlayPromises());
OwnerDoc()->Dispatch("nsResolveOrRejectPendingPlayPromisesRunner",
OwnerDoc()->Dispatch("HTMLMediaElement::AsyncResolvePendingPlayPromises",
TaskCategory::Other,
event.forget());
}
@ -7223,7 +7223,7 @@ HTMLMediaElement::AsyncRejectPendingPlayPromises(nsresult aError)
TakePendingPlayPromises(),
aError);
OwnerDoc()->Dispatch("nsResolveOrRejectPendingPlayPromisesRunner",
OwnerDoc()->Dispatch("HTMLMediaElement::AsyncRejectPendingPlayPromises",
TaskCategory::Other,
event.forget());
}

View file

@ -1192,8 +1192,7 @@ class WorkerThreadPrimaryRunnable final : public Runnable
public:
explicit FinishedRunnable(already_AddRefed<WorkerThread> aThread)
: Runnable("WorkerThreadPrimaryRunnable::FinishedRunnable")
, mThread(aThread)
: mThread(aThread)
{
MOZ_ASSERT(mThread);
}

View file

@ -4747,11 +4747,7 @@ nsresult
WorkerPrivate::DispatchToMainThread(already_AddRefed<nsIRunnable> aRunnable,
uint32_t aFlags)
{
nsCOMPtr<nsIRunnable> runnable = aRunnable;
if (nsCOMPtr<nsINamed> named = do_QueryInterface(runnable)) {
named->SetName("WorkerRunnable");
}
return mMainThreadEventTarget->Dispatch(runnable.forget(), aFlags);
return mMainThreadEventTarget->Dispatch(Move(aRunnable), aFlags);
}
void

View file

@ -750,8 +750,7 @@ public:
OpenMainProcessActorRunnable(already_AddRefed<ChildImpl>&& aChildActor,
already_AddRefed<ParentImpl> aParentActor,
MessageLoop* aParentMessageLoop)
: Runnable("ChildImpl::OpenMainProcessActorRunnable"),
mActor(aChildActor), mParentActor(aParentActor),
: mActor(aChildActor), mParentActor(aParentActor),
mParentMessageLoop(aParentMessageLoop)
{
AssertIsOnMainThread();

View file

@ -1591,14 +1591,6 @@ MessageChannel::RunMessage(MessageTask& aTask)
NS_IMPL_ISUPPORTS_INHERITED(MessageChannel::MessageTask, CancelableRunnable, nsIRunnablePriority)
MessageChannel::MessageTask::MessageTask(MessageChannel* aChannel, Message&& aMessage)
: CancelableRunnable(StringFromIPCMessageType(aMessage.type()))
, mChannel(aChannel)
, mMessage(Move(aMessage))
, mScheduled(false)
{
}
nsresult
MessageChannel::MessageTask::Run()
{

View file

@ -455,7 +455,9 @@ class MessageChannel : HasResultCodes
public nsIRunnablePriority
{
public:
explicit MessageTask(MessageChannel* aChannel, Message&& aMessage);
explicit MessageTask(MessageChannel* aChannel, Message&& aMessage)
: mChannel(aChannel), mMessage(Move(aMessage)), mScheduled(false)
{}
NS_DECL_ISUPPORTS_INHERITED

View file

@ -220,7 +220,7 @@ for protocol in sorted(allmessages.keys()):
print >>ipc_msgtype_name, """
default:
return "<unknown IPC msg name>";
return "???";
}
}

View file

@ -55,8 +55,7 @@ public:
nsresult status,
int64_t progress,
int64_t progressMax)
: Runnable("nsTransportStatusEvent")
, mProxy(proxy)
: mProxy(proxy)
, mTransport(transport)
, mStatus(status)
, mProgress(progress)

View file

@ -186,8 +186,7 @@ private:
public:
AvailableCallbackRunnable(CacheEntry* aEntry,
Callback const &aCallback)
: Runnable("CacheEntry::AvailableCallbackRunnable")
, mEntry(aEntry)
: mEntry(aEntry)
, mCallback(aCallback)
{}

View file

@ -43,8 +43,7 @@ public:
nsICancelable* aRequest,
nsIDNSRecord* aRecord,
nsresult aStatus)
: Runnable("DNSListenerProxy::OnLookupCompleteRunnable")
, mListener(aListener)
: mListener(aListener)
, mRequest(aRequest)
, mRecord(aRecord)
, mStatus(aStatus)

View file

@ -12,8 +12,7 @@
using namespace mozilla;
nsHtml5SVGLoadDispatcher::nsHtml5SVGLoadDispatcher(nsIContent* aElement)
: Runnable("nsHtml5SVGLoadDispatcher")
, mElement(aElement)
: mElement(aElement)
, mDocument(mElement->OwnerDoc())
{
mDocument->BlockOnload();

View file

@ -1336,7 +1336,7 @@ nsHtml5StreamParser::FlushTreeOpsAndDisarmTimer()
}
mTreeBuilder->Flush();
nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
if (NS_FAILED(mExecutor->GetDocument()->Dispatch("nsHtml5ExecutorFlusher",
if (NS_FAILED(mExecutor->GetDocument()->Dispatch("FlushTreeOpsAndDisarmTimer",
dom::TaskCategory::Other,
runnable.forget()))) {
NS_WARNING("failed to dispatch executor flush event");

View file

@ -265,7 +265,7 @@ nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync()
{
if (!mDocument || !mDocument->IsInBackgroundWindow()) {
nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
if (NS_FAILED(mDocument->Dispatch("nsHtml5ExecutorReflusher",
if (NS_FAILED(mDocument->Dispatch("ContinueInterruptedParsingAsync",
dom::TaskCategory::Other,
flusher.forget()))) {
NS_WARNING("failed to dispatch executor flush event");

View file

@ -56,8 +56,7 @@ public:
CallbackResultNotifier(mozIStorageStatementCallback *aCallback,
mozIStorageResultSet *aResults,
AsyncExecuteStatements *aEventStatus) :
Runnable("storage::CallbackResultNotifier")
, mCallback(aCallback)
mCallback(aCallback)
, mResults(aResults)
, mEventStatus(aEventStatus)
{
@ -94,8 +93,7 @@ public:
ErrorNotifier(mozIStorageStatementCallback *aCallback,
mozIStorageError *aErrorObj,
AsyncExecuteStatements *aEventStatus) :
Runnable("storage::ErrorNotifier")
, mCallback(aCallback)
mCallback(aCallback)
, mErrorObj(aErrorObj)
, mEventStatus(aEventStatus)
{
@ -135,8 +133,7 @@ public:
*/
CompletionNotifier(mozIStorageStatementCallback *aCallback,
ExecutionState aReason)
: Runnable("storage::CompletionNotifier")
, mCallback(aCallback)
: mCallback(aCallback)
, mReason(aReason)
{
}

View file

@ -446,8 +446,7 @@ public:
Connection* aClone,
const bool aReadOnly,
mozIStorageCompletionCallback* aCallback)
: Runnable("storage::AsyncInitializeClone")
, mConnection(aConnection)
: mConnection(aConnection)
, mClone(aClone)
, mReadOnly(aReadOnly)
, mCallback(aCallback)

View file

@ -398,8 +398,7 @@ public:
CallbackComplete(nsresult aStatus,
nsISupports* aValue,
already_AddRefed<mozIStorageCompletionCallback> aCallback)
: Runnable("storage::CallbackComplete")
, mStatus(aStatus)
: mStatus(aStatus)
, mValue(aValue)
, mCallback(aCallback)
{

View file

@ -10634,15 +10634,5 @@
"bug_numbers": [1314220],
"description": "The time duration from tab's media was blocked to unblocked. Now we record from 1 to 90 seconds, but the record by milliseconds, so the bucket is like [1000ms, 2000ms], [2000ms, 3000ms], e.t.c.",
"releaseChannelCollection": "opt-out"
},
"MAIN_THREAD_RUNNABLE_MS": {
"alert_emails": ["wmccloskey@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"keyed": true,
"high": 10000,
"n_buckets": 10,
"bug_numbers": [1331804],
"description": "The time a given main thread runnable took to run (in milliseconds). The key comes from the runnables nsINamed::name value."
}
}

View file

@ -308,7 +308,7 @@ nsBaseAppShell::DispatchDummyEvent(nsIThread* aTarget)
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
if (!mDummyEvent)
mDummyEvent = new mozilla::Runnable("DummyEvent");
mDummyEvent = new mozilla::Runnable();
return NS_SUCCEEDED(aTarget->Dispatch(mDummyEvent, NS_DISPATCH_NORMAL));
}

View file

@ -38,8 +38,7 @@ public:
nsInputStreamReadyEvent(nsIInputStreamCallback* aCallback,
nsIEventTarget* aTarget)
: CancelableRunnable("nsInputStreamReadyEvent")
, mCallback(aCallback)
: mCallback(aCallback)
, mTarget(aTarget)
{
}
@ -129,8 +128,7 @@ public:
nsOutputStreamReadyEvent(nsIOutputStreamCallback* aCallback,
nsIEventTarget* aTarget)
: CancelableRunnable("nsOutputStreamReadyEvent")
, mCallback(aCallback)
: mCallback(aCallback)
, mTarget(aTarget)
{
}
@ -243,8 +241,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
nsAStreamCopier()
: CancelableRunnable("nsAStreamCopier")
, mLock("nsAStreamCopier.mLock")
: mLock("nsAStreamCopier.mLock")
, mCallback(nullptr)
, mProgressCallback(nullptr)
, mClosure(nullptr)

View file

@ -69,17 +69,11 @@ class ThrottledEventQueue::Inner final : public nsIObserver
{ }
NS_IMETHODIMP
Run() override
Run()
{
mInner->ExecuteRunnable();
return NS_OK;
}
NS_IMETHODIMP
GetName(nsACString& aName) override
{
return mInner->CurrentName(aName);
}
};
mutable Mutex mMutex;
@ -119,39 +113,6 @@ class ThrottledEventQueue::Inner final : public nsIObserver
MOZ_ASSERT(mShutdownStarted);
}
nsresult
CurrentName(nsACString& aName)
{
nsCOMPtr<nsIRunnable> event;
#ifdef DEBUG
bool currentThread = false;
mBaseTarget->IsOnCurrentThread(&currentThread);
MOZ_ASSERT(currentThread);
#endif
{
MutexAutoLock lock(mMutex);
// We only check the name of an executor runnable when we know there is something
// in the queue, so this should never fail.
MOZ_ALWAYS_TRUE(mEventQueue.PeekEvent(getter_AddRefs(event), lock));
}
if (nsCOMPtr<nsINamed> named = do_QueryInterface(event)) {
// Increase mExecutionDepth here so that GetName is allowed to call
// IsOnCurrentThread on us and have it be true (in the case when we are on
// the right thread).
mExecutionDepth++;
nsresult rv = named->GetName(aName);
mExecutionDepth--;
return rv;
}
aName.AssignLiteral("non-nsINamed ThrottledEventQueue runnable");
return NS_OK;
}
void
ExecuteRunnable()
{

View file

@ -41,25 +41,6 @@ nsEventQueue::~nsEventQueue()
}
}
bool
nsEventQueue::PeekEvent(nsIRunnable** aEvent, MutexAutoLock& aProofOfLock)
{
MOZ_ASSERT(aEvent);
*aEvent = nullptr;
if (IsEmpty()) {
return false;
}
MOZ_ASSERT(mOffsetHead < EVENTS_PER_PAGE);
MOZ_ASSERT_IF(mHead == mTail, mOffsetHead <= mOffsetTail);
NS_ADDREF(*aEvent = mHead->mEvents[mOffsetHead]);
MOZ_ASSERT(*aEvent);
return true;
}
bool
nsEventQueue::GetEvent(bool aMayWait, nsIRunnable** aResult,
MutexAutoLock& aProofOfLock)

View file

@ -39,10 +39,6 @@ public:
void PutEvent(already_AddRefed<nsIRunnable>&& aEvent,
MutexAutoLock& aProofOfLock);
// Return the first event in the queue without popping it. Returns whether the
// queue was empty or not. aEvent is set to null if the queue was empty.
bool PeekEvent(nsIRunnable** aEvent, MutexAutoLock& aProofOfLock);
// This method gets an event from the event queue. If mayWait is true, then
// the method will block the calling thread until an event is available. If
// the event is null, then the method returns immediately indicating whether

View file

@ -16,17 +16,9 @@ interface nsINamed : nsISupports
* A string describing the purpose of the runnable/timer/whatever. Useful
* for debugging. This attribute is read-only, but you can change it to a
* compile-time string literal with setName.
*
* WARNING: This attribute will be included in telemetry, so it should
* never contain privacy sensitive information.
*/
readonly attribute ACString name;
/*
* Note: The string you pass in should be a compile-time literal.
*
* WARNING: This value will be included in telemetry, so it should
* never contain privacy sensitive information.
*/
/* Note: The string you pass in should be a compile-time literal. */
[noscript] void setName(in string aName);
};

View file

@ -29,14 +29,11 @@ typedef void (*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure);
* via the "TimerFirings" log module.
*
* @param aTimer the timer which has expired
* @param aAnonymize whether the name should avoid including privacy sensitive info
* @param aClosure opaque parameter passed to initWithFuncCallback
* @param aBuf a buffer in which to put the name
* @param aLen the length of the buffer
*/
typedef void (*nsTimerNameCallbackFunc) (nsITimer *aTimer,
bool aAnonymize,
void *aClosure,
typedef void (*nsTimerNameCallbackFunc) (nsITimer *aTimer, void *aClosure,
char *aBuf, size_t aLen);
%}

View file

@ -29,7 +29,7 @@ class ProxyReleaseEvent : public mozilla::Runnable
{
public:
explicit ProxyReleaseEvent(already_AddRefed<T> aDoomed)
: Runnable("ProxyReleaseEvent"), mDoomed(aDoomed.take()) {}
: mDoomed(aDoomed.take()) {}
NS_IMETHOD Run() override
{

View file

@ -31,7 +31,6 @@
#include "mozilla/Services.h"
#include "nsXPCOMPrivate.h"
#include "mozilla/ChaosMode.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/ScriptSettings.h"
@ -196,8 +195,7 @@ class nsThreadStartupEvent : public Runnable
{
public:
nsThreadStartupEvent()
: Runnable("nsThreadStartupEvent")
, mMon("nsThreadStartupEvent.mMon")
: mMon("nsThreadStartupEvent.mMon")
, mInitialized(false)
{
}
@ -336,8 +334,7 @@ class nsThreadShutdownAckEvent : public CancelableRunnable
{
public:
explicit nsThreadShutdownAckEvent(NotNull<nsThreadShutdownContext*> aCtx)
: CancelableRunnable("nsThreadShutdownAckEvent")
, mShutdownContext(aCtx)
: mShutdownContext(aCtx)
{
}
NS_IMETHOD Run() override
@ -361,8 +358,7 @@ class nsThreadShutdownEvent : public Runnable
public:
nsThreadShutdownEvent(NotNull<nsThread*> aThr,
NotNull<nsThreadShutdownContext*> aCtx)
: Runnable("nsThreadShutdownEvent")
, mThread(aThr)
: mThread(aThr)
, mShutdownContext(aCtx)
{
}
@ -1238,23 +1234,8 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult)
if (event) {
LOG(("THRD(%p) running [%p]\n", this, event.get()));
#ifndef RELEASE_OR_BETA
Maybe<Telemetry::AutoTimer<Telemetry::MAIN_THREAD_RUNNABLE_MS>> timer;
#endif
if (MAIN_THREAD == mIsMainThread) {
HangMonitor::NotifyActivity();
#ifndef RELEASE_OR_BETA
nsCString name;
if (nsCOMPtr<nsINamed> named = do_QueryInterface(event)) {
if (NS_FAILED(named->GetName(name))) {
name.AssignLiteral("GetName failed");
}
} else {
name.AssignLiteral("non-nsINamed runnable");
}
timer.emplace(name);
#endif
}
event->Run();
} else if (aMayWait) {

View file

@ -57,11 +57,7 @@ Runnable::GetName(nsACString& aName)
#ifdef RELEASE_OR_BETA
aName.Truncate();
#else
if (mName) {
aName.AssignASCII(mName);
} else {
aName.Truncate();
}
aName.AssignASCII(mName);
#endif
return NS_OK;
}

View file

@ -237,12 +237,6 @@ public:
Runnable() {}
#ifdef RELEASE_OR_BETA
explicit Runnable(const char* aName) {}
#else
explicit Runnable(const char* aName) : mName(aName) {}
#endif
protected:
virtual ~Runnable() {}
private:
@ -265,7 +259,6 @@ public:
virtual nsresult Cancel() override;
CancelableRunnable() {}
explicit CancelableRunnable(const char* aName) : Runnable(aName) {}
protected:
virtual ~CancelableRunnable() {}

View file

@ -548,7 +548,7 @@ nsTimerImpl::LogFiring(CallbackType aCallbackType, CallbackUnion aCallback)
name = mName.as<NameString>();
} else if (mName.is<NameFunc>()) {
mName.as<NameFunc>()(mITimer, /* aAnonymize = */ false, mClosure, buf, buflen);
mName.as<NameFunc>()(mITimer, mClosure, buf, buflen);
name = buf;
} else {
@ -659,32 +659,28 @@ nsTimerImpl::GetName(nsACString& aName)
} else if (mName.is<NameFunc>()) {
static const size_t buflen = 1024;
char buf[buflen];
mName.as<NameFunc>()(mITimer, /* aAnonymize = */ true, mClosure, buf, buflen);
mName.as<NameFunc>()(mITimer, mClosure, buf, buflen);
aName.Assign(buf);
} else {
MOZ_ASSERT(mName.is<NameNothing>());
aName.AssignLiteral("Anonymous callback timer");
aName.Truncate();
}
break;
case CallbackType::Interface:
if (nsCOMPtr<nsINamed> named = do_QueryInterface(mCallback.i)) {
named->GetName(aName);
} else {
aName.AssignLiteral("Anonymous interface timer");
}
break;
case CallbackType::Observer:
if (nsCOMPtr<nsINamed> named = do_QueryInterface(mCallback.o)) {
named->GetName(aName);
} else {
aName.AssignLiteral("Anonymous observer timer");
}
break;
case CallbackType::Unknown:
aName.AssignLiteral("Anonymous timer");
aName.Truncate();
break;
}
}