Bug 1038727 - Convert APZ from nsAutoPtr to UniquePtr. r=kats

--HG--
rename : browser/components/loop/content/shared/js/views.jsx => browser/components/loop/content/shared/js/views.js
rename : toolkit/webapps/tests/test_custom_origin_uninstall_install.xul => toolkit/webapps/tests/test_custom_origin.xul
extra : rebase_source : 2448597696cbf24512b54b6acbdfb52b71995dde
This commit is contained in:
Jeff Muizelaar 2014-07-15 13:44:37 -04:00
parent 60e200d97f
commit af1d060475
3 changed files with 7 additions and 8 deletions

View File

@ -1950,9 +1950,9 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
SendAsyncScrollEvent();
mPaintThrottler.PostTask(
FROM_HERE,
NewRunnableMethod(this,
UniquePtr<CancelableTask>(NewRunnableMethod(this,
&AsyncPanZoomController::DispatchRepaintRequest,
aFrameMetrics),
aFrameMetrics)),
GetFrameTime());
aFrameMetrics.SetPresShellId(mLastContentPaintMetrics.GetPresShellId());

View File

@ -18,7 +18,7 @@ TaskThrottler::TaskThrottler(const TimeStamp& aTimeStamp)
void
TaskThrottler::PostTask(const tracked_objects::Location& aLocation,
CancelableTask* aTask, const TimeStamp& aTimeStamp)
UniquePtr<CancelableTask> aTask, const TimeStamp& aTimeStamp)
{
aTask->SetBirthPlace(aLocation);
@ -26,11 +26,10 @@ TaskThrottler::PostTask(const tracked_objects::Location& aLocation,
if (mQueuedTask) {
mQueuedTask->Cancel();
}
mQueuedTask = aTask;
mQueuedTask = Move(aTask);
} else {
mStartTime = aTimeStamp;
aTask->Run();
delete aTask;
mOutstanding = true;
}
}

View File

@ -12,7 +12,7 @@
#include "mozilla/TimeStamp.h" // for TimeDuration, TimeStamp
#include "mozilla/RollingMean.h" // for RollingMean
#include "mozilla/mozalloc.h" // for operator delete
#include "nsAutoPtr.h" // for nsAutoPtr
#include "mozilla/UniquePtr.h" // for UniquePtr
#include "nsTArray.h" // for nsTArray
namespace tracked_objects {
@ -47,7 +47,7 @@ public:
* obsolete or the TaskThrottler is destructed.
*/
void PostTask(const tracked_objects::Location& aLocation,
CancelableTask* aTask, const TimeStamp& aTimeStamp);
UniquePtr<CancelableTask> aTask, const TimeStamp& aTimeStamp);
/**
* Mark the task as complete and process the next queued task.
*/
@ -90,7 +90,7 @@ public:
private:
bool mOutstanding;
nsAutoPtr<CancelableTask> mQueuedTask;
UniquePtr<CancelableTask> mQueuedTask;
TimeStamp mStartTime;
RollingMean<TimeDuration, TimeDuration> mMean;
};