mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1273520 - NS_NewRunnable* renaming and include task.h r=fabrice
MozReview-Commit-ID: BcAboKGMr3a --HG-- extra : rebase_source : 6c5050527d8dffbce4a5e867bd48254a1041e657
This commit is contained in:
parent
495a804524
commit
20b739aeda
@ -572,7 +572,7 @@ nsGonkCameraControl::PushParameters()
|
||||
if (NS_GetCurrentThread() != mCameraThread) {
|
||||
DOM_CAMERA_LOGT("%s:%d - dispatching to Camera Thread\n", __func__, __LINE__);
|
||||
nsCOMPtr<nsIRunnable> pushParametersTask =
|
||||
NS_NewRunnableMethod(this, &nsGonkCameraControl::PushParametersImpl);
|
||||
NewRunnableMethod(this, &nsGonkCameraControl::PushParametersImpl);
|
||||
return mCameraThread->Dispatch(pushParametersTask, NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ NuwaParent::RecvNotifyReady()
|
||||
// mContentParent have to go the the main thread. The mContentParent will
|
||||
// be alive when the runnable runs.
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewNonOwningRunnableMethod(mContentParent.get(),
|
||||
NewNonOwningRunnableMethod(mContentParent.get(),
|
||||
&ContentParent::OnNuwaReady);
|
||||
MOZ_ASSERT(runnable);
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));
|
||||
@ -200,7 +200,7 @@ NuwaParent::RecvAddNewProcess(const uint32_t& aPid,
|
||||
mBlocked = false;
|
||||
} else {
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewNonOwningRunnableMethodWithArgs<
|
||||
NewNonOwningRunnableMethod<
|
||||
uint32_t,
|
||||
UniquePtr<nsTArray<ProtocolFdMapping>>&& >(
|
||||
mContentParent.get(),
|
||||
|
@ -242,7 +242,7 @@ PreallocatedProcessManagerImpl::ScheduleDelayedNuwaFork()
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<CancelableRunnable> task = NS_NewCancelableRunnableMethod(
|
||||
RefPtr<CancelableRunnable> task = NewCancelableRunnableMethod(
|
||||
this, &PreallocatedProcessManagerImpl::DelayedNuwaFork);
|
||||
mPreallocateAppProcessTask = task;
|
||||
MessageLoop::current()->PostDelayedTask(task.forget(),
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nsVolumeService.h"
|
||||
#include "AutoMounterSetting.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/Hal.h"
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <pthread.h>
|
||||
#include <hardware/gps.h>
|
||||
|
||||
#include "base/task.h"
|
||||
#include "GeolocationUtil.h"
|
||||
#include "mozstumbler/MozStumbler.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
@ -813,7 +814,7 @@ GonkGPSGeolocationProvider::Init()
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_DispatchToMainThread(NS_NewRunnableMethod(this, &GonkGPSGeolocationProvider::StartGPS));
|
||||
NS_DispatchToMainThread(NewRunnableMethod(this, &GonkGPSGeolocationProvider::StartGPS));
|
||||
}
|
||||
|
||||
void
|
||||
@ -1001,7 +1002,7 @@ GonkGPSGeolocationProvider::Startup()
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
mInitThread->Dispatch(NS_NewRunnableMethod(this, &GonkGPSGeolocationProvider::Init),
|
||||
mInitThread->Dispatch(NewRunnableMethod(this, &GonkGPSGeolocationProvider::Init),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
mNetworkLocationProvider = do_CreateInstance("@mozilla.org/geolocation/mls-provider;1");
|
||||
@ -1063,7 +1064,7 @@ GonkGPSGeolocationProvider::Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
mInitThread->Dispatch(NS_NewRunnableMethod(this, &GonkGPSGeolocationProvider::ShutdownGPS),
|
||||
mInitThread->Dispatch(NewRunnableMethod(this, &GonkGPSGeolocationProvider::ShutdownGPS),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <limits>
|
||||
#include "mozilla/dom/network/NetUtils.h"
|
||||
#include "mozilla/fallible.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "nsVolume.h"
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
#include "nsIPowerManagerService.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
#include "nsIVolume.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#undef VOLUME_MANAGER_LOG_TAG
|
||||
#define VOLUME_MANAGER_LOG_TAG "nsVolumeService"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
#include "DiskSpaceWatcher.h"
|
||||
#include "fanotify.h"
|
||||
#include "nsIObserverService.h"
|
||||
@ -24,13 +25,6 @@ namespace mozilla { namespace hal_impl { class GonkDiskSpaceWatcher; } }
|
||||
|
||||
using namespace mozilla::hal_impl;
|
||||
|
||||
template<>
|
||||
struct RunnableMethodTraits<GonkDiskSpaceWatcher>
|
||||
{
|
||||
static void RetainCallee(GonkDiskSpaceWatcher* obj) { }
|
||||
static void ReleaseCallee(GonkDiskSpaceWatcher* obj) { }
|
||||
};
|
||||
|
||||
namespace mozilla {
|
||||
namespace hal_impl {
|
||||
|
||||
@ -311,7 +305,7 @@ StartDiskSpaceWatcher()
|
||||
gHalDiskSpaceWatcher = new GonkDiskSpaceWatcher();
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(
|
||||
NewRunnableMethod(gHalDiskSpaceWatcher, &GonkDiskSpaceWatcher::DoStart));
|
||||
NewNonOwningRunnableMethod(gHalDiskSpaceWatcher, &GonkDiskSpaceWatcher::DoStart));
|
||||
}
|
||||
|
||||
void
|
||||
@ -323,7 +317,7 @@ StopDiskSpaceWatcher()
|
||||
}
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(
|
||||
NewRunnableMethod(gHalDiskSpaceWatcher, &GonkDiskSpaceWatcher::DoStop));
|
||||
NewNonOwningRunnableMethod(gHalDiskSpaceWatcher, &GonkDiskSpaceWatcher::DoStop));
|
||||
}
|
||||
|
||||
} // namespace hal_impl
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "utils/threads.h"
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#include "Hal.h"
|
||||
#include "HalImpl.h"
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/thread.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#include "GonkSensorsInterface.h"
|
||||
#include "GonkSensorsPollInterface.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <sysutils/NetlinkEvent.h>
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#include "Hal.h"
|
||||
#include "HalLog.h"
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "HalLog.h"
|
||||
#include "nsDebug.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/task.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "android/log.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#include "nsWhitespaceTokenizer.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
@ -115,7 +115,7 @@ GeckoTouchDispatcher::NotifyTouch(MultiTouchInput& aTouch, TimeStamp aEventTime)
|
||||
// move events because we might end up dispatching events out of order.
|
||||
// Instead, fall back to a non-resampling in-order dispatch until we're
|
||||
// done processing the non-move events.
|
||||
layers::APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
||||
layers::APZThreadUtils::RunOnControllerThread(NewRunnableMethod<MultiTouchInput>(
|
||||
this, &GeckoTouchDispatcher::DispatchTouchEvent, aTouch));
|
||||
return;
|
||||
}
|
||||
@ -127,7 +127,7 @@ GeckoTouchDispatcher::NotifyTouch(MultiTouchInput& aTouch, TimeStamp aEventTime)
|
||||
MutexAutoLock lock(mTouchQueueLock);
|
||||
mInflightNonMoveEvents++;
|
||||
}
|
||||
layers::APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
||||
layers::APZThreadUtils::RunOnControllerThread(NewRunnableMethod<MultiTouchInput>(
|
||||
this, &GeckoTouchDispatcher::DispatchTouchNonMoveEvent, aTouch));
|
||||
}
|
||||
}
|
||||
|
@ -901,9 +901,9 @@ nsScreenManagerGonk::VsyncControl(bool aEnabled)
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableMethodWithArgs<bool>(this,
|
||||
&nsScreenManagerGonk::VsyncControl,
|
||||
aEnabled));
|
||||
NewRunnableMethod<bool>(this,
|
||||
&nsScreenManagerGonk::VsyncControl,
|
||||
aEnabled));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user