Skip to content

Commit

Permalink
Bug 1038727 - Convert APZ from nsAutoPtr to UniquePtr. r=kats
Browse files Browse the repository at this point in the history
--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
  • Loading branch information
jrmuizel committed Jul 15, 2014
1 parent 193a66a commit 2b38307
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gfx/layers/apz/src/AsyncPanZoomController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
5 changes: 2 additions & 3 deletions gfx/layers/apz/src/TaskThrottler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ 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);

if (mOutstanding) {
if (mQueuedTask) {
mQueuedTask->Cancel();
}
mQueuedTask = aTask;
mQueuedTask = Move(aTask);
} else {
mStartTime = aTimeStamp;
aTask->Run();
delete aTask;
mOutstanding = true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions gfx/layers/apz/src/TaskThrottler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -47,7 +47,7 @@ class TaskThrottler {
* 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.
*/
Expand Down Expand Up @@ -90,7 +90,7 @@ class TaskThrottler {

private:
bool mOutstanding;
nsAutoPtr<CancelableTask> mQueuedTask;
UniquePtr<CancelableTask> mQueuedTask;
TimeStamp mStartTime;
RollingMean<TimeDuration, TimeDuration> mMean;
};
Expand Down

0 comments on commit 2b38307

Please sign in to comment.