Skip to content

Commit

Permalink
Backed out changeset 4f6302a98ae4 (bug 1372405)
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
  • Loading branch information
BavarianTomcat committed Jun 21, 2017
1 parent 4f57553 commit 8a1350b
Show file tree
Hide file tree
Showing 617 changed files with 3,594 additions and 6,365 deletions.
9 changes: 2 additions & 7 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1799,13 +1799,8 @@ Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
class Runnable final : public mozilla::Runnable
{
public:
Runnable(Accessible* aAcc, nsIContent* aContent, uint32_t aIdx)
: mozilla::Runnable("Runnable")
, mAcc(aAcc)
, mContent(aContent)
, mIdx(aIdx)
{
}
Runnable(Accessible* aAcc, nsIContent* aContent, uint32_t aIdx) :
mAcc(aAcc), mContent(aContent), mIdx(aIdx) { }

NS_IMETHOD Run() override
{
Expand Down
9 changes: 3 additions & 6 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,9 @@ DocAccessible::ScrollPositionDidChange(nscoord aX, nscoord aY)
mScrollWatchTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mScrollWatchTimer) {
NS_ADDREF_THIS(); // Kung fu death grip
mScrollWatchTimer->InitWithNamedFuncCallback(
ScrollTimerCallback,
this,
kScrollPosCheckWait,
nsITimer::TYPE_REPEATING_SLACK,
"a11y::DocAccessible::ScrollPositionDidChange");
mScrollWatchTimer->InitWithFuncCallback(ScrollTimerCallback, this,
kScrollPosCheckWait,
nsITimer::TYPE_REPEATING_SLACK);
}
}
mScrollPositionChangedTicks = 1;
Expand Down
9 changes: 3 additions & 6 deletions accessible/ipc/win/HandlerProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ HandlerProvider::GetAndSerializePayload(const MutexAutoLock&)

IA2Payload payload{};

if (!mscom::InvokeOnMainThread("HandlerProvider::BuildIA2Data",
this, &HandlerProvider::BuildIA2Data,
if (!mscom::InvokeOnMainThread(this, &HandlerProvider::BuildIA2Data,
&payload.mData) ||
!payload.mData.mUniqueId) {
return;
Expand Down Expand Up @@ -237,8 +236,7 @@ HandlerProvider::put_HandlerControl(long aPid, IHandlerControl* aCtrl)

auto ptrProxy = mscom::ToProxyUniquePtr(aCtrl);

if (!mscom::InvokeOnMainThread("HandlerProvider::SetHandlerControlOnMainThread",
this,
if (!mscom::InvokeOnMainThread(this,
&HandlerProvider::SetHandlerControlOnMainThread,
static_cast<DWORD>(aPid), Move(ptrProxy))) {
return E_FAIL;
Expand All @@ -252,8 +250,7 @@ HandlerProvider::Refresh(IA2Data* aOutData)
{
MOZ_ASSERT(mscom::IsCurrentThreadMTA());

if (!mscom::InvokeOnMainThread("HandlerProvider::BuildIA2Data",
this, &HandlerProvider::BuildIA2Data,
if (!mscom::InvokeOnMainThread(this, &HandlerProvider::BuildIA2Data,
aOutData)) {
return E_FAIL;
}
Expand Down
3 changes: 1 addition & 2 deletions accessible/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,7 @@ AccessibleWrap::accSelect(
// is happening, so we dispatch TakeFocus from the main thread to
// guarantee that we are outside any IPC.
nsCOMPtr<nsIRunnable> runnable =
mozilla::NewRunnableMethod("Accessible::TakeFocus",
this, &Accessible::TakeFocus);
mozilla::NewRunnableMethod(this, &Accessible::TakeFocus);
NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL);
return S_OK;
}
Expand Down
7 changes: 2 additions & 5 deletions accessible/windows/msaa/LazyInstantiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
// Call GatherTelemetry on a background thread because it does I/O on
// the executable file to retrieve version information.
nsCOMPtr<nsIRunnable> runnable(
NewRunnableMethod<nsCOMPtr<nsIFile>>("LazyInstantiator::GatherTelemetry",
this,
NewRunnableMethod<nsCOMPtr<nsIFile>>(this,
&LazyInstantiator::GatherTelemetry,
clientExe));
NS_NewThread(getter_AddRefs(mTelemetryThread), runnable);
Expand Down Expand Up @@ -328,9 +327,7 @@ LazyInstantiator::GatherTelemetry(nsIFile* aClientExe)

// Now that we've (possibly) obtained version info, send the resulting
// string back to the main thread to accumulate in telemetry.
NS_DispatchToMainThread(NewNonOwningRunnableMethod<nsString>(
"LazyInstantiator::AccumulateTelemetry",
this,
NS_DispatchToMainThread(NewNonOwningRunnableMethod<nsString>(this,
&LazyInstantiator::AccumulateTelemetry, value));
}

Expand Down
8 changes: 2 additions & 6 deletions accessible/xpcom/xpcAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,8 @@ xpcAccessibilityService::Release(void)
if (count == 1 && !mShutdownTimer) {
mShutdownTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
if (mShutdownTimer) {
mShutdownTimer->InitWithNamedFuncCallback(
ShutdownCallback,
this,
100,
nsITimer::TYPE_ONE_SHOT,
"xpcAccessibilityService::Release");
mShutdownTimer->InitWithFuncCallback(ShutdownCallback, this, 100,
nsITimer::TYPE_ONE_SHOT);
}
}

Expand Down
43 changes: 15 additions & 28 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,9 @@ nsPingListener::StartTimeout(DocGroup* aDocGroup)
timer->SetTarget(aDocGroup->EventTargetFor(TaskCategory::Network));

if (timer) {
nsresult rv =
timer->InitWithNamedFuncCallback(OnPingTimeout,
mLoadGroup,
PING_TIMEOUT,
nsITimer::TYPE_ONE_SHOT,
"nsPingListener::StartTimeout");
nsresult rv = timer->InitWithFuncCallback(OnPingTimeout, mLoadGroup,
PING_TIMEOUT,
nsITimer::TYPE_ONE_SHOT);
if (NS_SUCCEEDED(rv)) {
mTimer = timer;
return NS_OK;
Expand Down Expand Up @@ -1770,12 +1767,10 @@ nsDocShell::DispatchToTabGroup(const char* aName,
NS_IMETHODIMP
nsDocShell::DispatchLocationChangeEvent()
{
return DispatchToTabGroup(
"nsDocShell::FireDummyOnLocationChange",
TaskCategory::Other,
NewRunnableMethod("nsDocShell::FireDummyOnLocationChange",
this,
&nsDocShell::FireDummyOnLocationChange));
return DispatchToTabGroup("nsDocShell::FireDummyOnLocationChange",
TaskCategory::Other,
NewRunnableMethod(this,
&nsDocShell::FireDummyOnLocationChange));
}

bool
Expand Down Expand Up @@ -9649,20 +9644,13 @@ class InternalLoadEvent : public Runnable
bool aLoadReplace,
nsIURI* aReferrer, uint32_t aReferrerPolicy,
nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
uint32_t aFlags,
const char* aTypeHint,
nsIInputStream* aPostData,
nsIInputStream* aHeadersData,
uint32_t aLoadType,
nsISHEntry* aSHEntry,
bool aFirstParty,
const nsAString& aSrcdoc,
nsIDocShell* aSourceDocShell,
nsIURI* aBaseURI,
bool aCheckForPrerender)
: mozilla::Runnable("InternalLoadEvent")
, mSrcdoc(aSrcdoc)
nsIPrincipal* aPrincipalToInherit, uint32_t aFlags,
const char* aTypeHint, nsIInputStream* aPostData,
nsIInputStream* aHeadersData, uint32_t aLoadType,
nsISHEntry* aSHEntry, bool aFirstParty,
const nsAString& aSrcdoc, nsIDocShell* aSourceDocShell,
nsIURI* aBaseURI, bool aCheckForPrerender)
: mSrcdoc(aSrcdoc)
, mDocShell(aDocShell)
, mURI(aURI)
, mOriginalURI(aOriginalURI)
Expand Down Expand Up @@ -14052,8 +14040,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsDocShell* aHandler,
bool aNoOpenerImplied,
bool aIsTrusted,
nsIPrincipal* aTriggeringPrincipal)
: mozilla::Runnable("OnLinkClickEvent")
, mHandler(aHandler)
: mHandler(aHandler)
, mURI(aURI)
, mTargetSpec(aTargetSpec)
, mFileName(aFileName)
Expand Down
6 changes: 1 addition & 5 deletions docshell/base/nsDocShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,7 @@ class nsDocShell final
{
public:
NS_DECL_NSIRUNNABLE
explicit RestorePresentationEvent(nsDocShell* aDs)
: mozilla::Runnable("nsDocShell::RestorePresentationEvent")
, mDocShell(aDs)
{
}
explicit RestorePresentationEvent(nsDocShell* aDs) : mDocShell(aDs) {}
void Revoke() { mDocShell = nullptr; }
private:
RefPtr<nsDocShell> mDocShell;
Expand Down
8 changes: 3 additions & 5 deletions docshell/base/nsDocShellTreeOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,12 +1260,10 @@ ChromeTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent)
}
}
if (mPossibleTooltipNode) {
nsresult rv = mTooltipTimer->InitWithNamedFuncCallback(
sTooltipCallback,
this,
nsresult rv = mTooltipTimer->InitWithFuncCallback(
sTooltipCallback, this,
LookAndFeel::GetInt(LookAndFeel::eIntID_TooltipDelay, 500),
nsITimer::TYPE_ONE_SHOT,
"ChromeTooltipListener::MouseMove");
nsITimer::TYPE_ONE_SHOT);
if (NS_FAILED(rv)) {
mPossibleTooltipNode = nullptr;
}
Expand Down
3 changes: 1 addition & 2 deletions docshell/shistory/nsSHEntryShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ class DestroyViewerEvent : public mozilla::Runnable
{
public:
DestroyViewerEvent(nsIContentViewer* aViewer, nsIDocument* aDocument)
: mozilla::Runnable("DestroyViewerEvent")
, mViewer(aViewer)
: mViewer(aViewer)
, mDocument(aDocument)
{
}
Expand Down
4 changes: 1 addition & 3 deletions dom/animation/Animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,9 +1453,7 @@ Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
DoFinishNotificationImmediately();
} else if (!mFinishNotificationTask.IsPending()) {
RefPtr<nsRunnableMethod<Animation>> runnable =
NewRunnableMethod("dom::Animation::DoFinishNotificationImmediately",
this,
&Animation::DoFinishNotificationImmediately);
NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
context->DispatchToMicroTask(do_AddRef(runnable));
mFinishNotificationTask = runnable.forget();
}
Expand Down
11 changes: 5 additions & 6 deletions dom/asmjscache/AsmJSCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ class FileDescriptorHolder : public Runnable
{
public:
FileDescriptorHolder()
: Runnable("dom::asmjscache::FileDescriptorHolder")
, mQuotaObject(nullptr)
, mFileSize(INT64_MIN)
, mFileDesc(nullptr)
, mFileMap(nullptr)
, mMappedMemory(nullptr)
: mQuotaObject(nullptr),
mFileSize(INT64_MIN),
mFileDesc(nullptr),
mFileMap(nullptr),
mMappedMemory(nullptr)
{ }

~FileDescriptorHolder() override
Expand Down
38 changes: 17 additions & 21 deletions dom/audiochannel/AudioChannelService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ class NotifyChannelActiveRunnable final : public Runnable
class AudioPlaybackRunnable final : public Runnable
{
public:
AudioPlaybackRunnable(nsPIDOMWindowOuter* aWindow,
bool aActive,
AudioPlaybackRunnable(nsPIDOMWindowOuter* aWindow, bool aActive,
AudioChannelService::AudibleChangedReasons aReason)
: mozilla::Runnable("AudioPlaybackRunnable")
, mWindow(aWindow)
: mWindow(aWindow)
, mActive(aActive)
, mReason(aReason)
{}
Expand Down Expand Up @@ -876,9 +874,7 @@ AudioChannelService::AudioChannelWindow::NotifyMediaBlockStop(nsPIDOMWindowOuter
mShouldSendBlockStopEvent = false;
// Can't use raw pointer for lamba variable capturing, use smart ptr.
nsCOMPtr<nsPIDOMWindowOuter> window = aWindow;
NS_DispatchToCurrentThread(NS_NewRunnableFunction(
"dom::AudioChannelService::AudioChannelWindow::NotifyMediaBlockStop",
[window]() -> void {
NS_DispatchToCurrentThread(NS_NewRunnableFunction([window] () -> void {
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (NS_WARN_IF(!observerService)) {
Expand All @@ -888,7 +884,8 @@ AudioChannelService::AudioChannelWindow::NotifyMediaBlockStop(nsPIDOMWindowOuter
observerService->NotifyObservers(ToSupports(window),
"audio-playback",
u"blockStop");
}));
})
);
}

void
Expand Down Expand Up @@ -1052,19 +1049,18 @@ AudioChannelService::AudioChannelWindow::MaybeNotifyMediaBlockStart(AudioChannel

if (!mShouldSendBlockStopEvent) {
mShouldSendBlockStopEvent = true;
NS_DispatchToCurrentThread(NS_NewRunnableFunction(
"dom::AudioChannelService::AudioChannelWindow::"
"MaybeNotifyMediaBlockStart",
[window]() -> void {
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (NS_WARN_IF(!observerService)) {
return;
}

observerService->NotifyObservers(
ToSupports(window), "audio-playback", u"blockStart");
}));
NS_DispatchToCurrentThread(NS_NewRunnableFunction([window] () -> void {
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (NS_WARN_IF(!observerService)) {
return;
}

observerService->NotifyObservers(ToSupports(window),
"audio-playback",
u"blockStart");
})
);
}
}

Expand Down
5 changes: 2 additions & 3 deletions dom/base/CustomElementRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,8 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType
// should be invoked prior to returning control back to script.
// Create a script runner to process the top of the processing
// stack as soon as it is safe to run script.
nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
"dom::CustomElementRegistry::EnqueueLifecycleCallback",
&CustomElementRegistry::ProcessTopElementQueue);
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableFunction(&CustomElementRegistry::ProcessTopElementQueue);
nsContentUtils::AddScriptRunner(runnable);
}
}
Expand Down
7 changes: 2 additions & 5 deletions dom/base/CustomElementRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,8 @@ class CustomElementReactionsStack
private:
class ProcessBackupQueueRunnable : public mozilla::Runnable {
public:
explicit ProcessBackupQueueRunnable(
CustomElementReactionsStack* aReactionStack)
: Runnable(
"dom::CustomElementReactionsStack::ProcessBackupQueueRunnable")
, mReactionStack(aReactionStack)
explicit ProcessBackupQueueRunnable(CustomElementReactionsStack* aReactionStack)
: mReactionStack(aReactionStack)
{
MOZ_ASSERT(!mReactionStack->mIsBackupQueueProcessing,
"mIsBackupQueueProcessing should be initially false");
Expand Down
16 changes: 8 additions & 8 deletions dom/base/DOMRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ DOMRequestService::FireDetailedError(nsIDOMDOMRequest* aRequest,
class FireSuccessAsyncTask : public mozilla::Runnable
{

FireSuccessAsyncTask(DOMRequest* aRequest, const JS::Value& aResult)
: mozilla::Runnable("FireSuccessAsyncTask")
, mReq(aRequest)
, mResult(RootingCx(), aResult)
FireSuccessAsyncTask(DOMRequest* aRequest,
const JS::Value& aResult) :
mReq(aRequest),
mResult(RootingCx(), aResult)
{
}

Expand Down Expand Up @@ -336,10 +336,10 @@ class FireSuccessAsyncTask : public mozilla::Runnable
class FireErrorAsyncTask : public mozilla::Runnable
{
public:
FireErrorAsyncTask(DOMRequest* aRequest, const nsAString& aError)
: mozilla::Runnable("FireErrorAsyncTask")
, mReq(aRequest)
, mError(aError)
FireErrorAsyncTask(DOMRequest* aRequest,
const nsAString& aError) :
mReq(aRequest),
mError(aError)
{
}

Expand Down
16 changes: 5 additions & 11 deletions dom/base/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,7 @@ Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
binding->ExecuteAttachedHandler();
} else {
nsContentUtils::AddScriptRunner(
NewRunnableMethod("nsXBLBinding::ExecuteAttachedHandler",
binding,
&nsXBLBinding::ExecuteAttachedHandler));
NewRunnableMethod(binding, &nsXBLBinding::ExecuteAttachedHandler));
}
}
}
Expand Down Expand Up @@ -1790,14 +1788,10 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
return NS_OK;
}

RemoveFromBindingManagerRunnable::RemoveFromBindingManagerRunnable(
nsBindingManager* aManager,
nsIContent* aContent,
nsIDocument* aDoc)
: mozilla::Runnable("dom::RemoveFromBindingManagerRunnable")
, mManager(aManager)
, mContent(aContent)
, mDoc(aDoc)
RemoveFromBindingManagerRunnable::RemoveFromBindingManagerRunnable(nsBindingManager* aManager,
nsIContent* aContent,
nsIDocument* aDoc):
mManager(aManager), mContent(aContent), mDoc(aDoc)
{}

RemoveFromBindingManagerRunnable::~RemoveFromBindingManagerRunnable() {}
Expand Down
Loading

0 comments on commit 8a1350b

Please sign in to comment.