Backed out changeset af51821b2fc5 (bug 1268313) for causing very frequent bc7 memory leak

--HG--
extra : rebase_source : 0af725bfab61b8f86e0243490aa970535f726503
This commit is contained in:
Carsten "Tomcat" Book 2016-04-29 14:22:04 +02:00
parent dfff02b90d
commit f13688180e
8 changed files with 21 additions and 41 deletions

View File

@ -1580,7 +1580,7 @@ ContentChild::RecvPBrowserConstructor(PBrowserChild* aActor,
hasRunOnce = true;
MOZ_ASSERT(!sFirstIdleTask);
RefPtr<CancelableRunnable> firstIdleTask = NewCancelableRunnableFunction(FirstIdle);
RefPtr<CancelableRunnable> firstIdleTask = NewRunnableFunction(FirstIdle);
sFirstIdleTask = firstIdleTask;
MessageLoop::current()->PostIdleTask(firstIdleTask.forget());

View File

@ -3299,9 +3299,9 @@ PluginInstanceChild::RecvAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
// RPC call, and both Flash and Java don't expect to receive setwindow calls
// at arbitrary times.
mCurrentAsyncSetWindowTask =
NewCancelableRunnableMethod<PluginInstanceChild,
void (PluginInstanceChild::*)(const gfxSurfaceType&, const NPRemoteWindow&, bool),
const gfxSurfaceType&, const NPRemoteWindow&, bool>
NewRunnableMethod<PluginInstanceChild,
void (PluginInstanceChild::*)(const gfxSurfaceType&, const NPRemoteWindow&, bool),
const gfxSurfaceType&, const NPRemoteWindow&, bool>
(this, &PluginInstanceChild::DoAsyncSetWindow,
aSurfaceType, aWindow, true);
RefPtr<Runnable> addrefedTask = mCurrentAsyncSetWindowTask;
@ -4223,7 +4223,7 @@ PluginInstanceChild::AsyncShowPluginFrame(void)
}
mCurrentInvalidateTask =
NewCancelableRunnableMethod(this, &PluginInstanceChild::InvalidateRectDelayed);
NewRunnableMethod(this, &PluginInstanceChild::InvalidateRectDelayed);
RefPtr<Runnable> addrefedTask = mCurrentInvalidateTask;
MessageLoop::current()->PostTask(addrefedTask.forget());
}

View File

@ -498,7 +498,7 @@ void GestureEventListener::CancelLongTapTimeoutTask()
void GestureEventListener::CreateLongTapTimeoutTask()
{
RefPtr<CancelableRunnable> task =
NewCancelableRunnableMethod(this, &GestureEventListener::HandleInputTimeoutLongTap);
NewRunnableMethod(this, &GestureEventListener::HandleInputTimeoutLongTap);
mLongTapTimeoutTask = task;
mAsyncPanZoomController->PostDelayedTask(
@ -525,8 +525,8 @@ void GestureEventListener::CreateMaxTapTimeoutTask()
TouchBlockState* block = mAsyncPanZoomController->GetInputQueue()->CurrentTouchBlock();
RefPtr<CancelableRunnable> task =
NewCancelableRunnableMethod(this, &GestureEventListener::HandleInputTimeoutMaxTap,
block->IsDuringFastFling());
NewRunnableMethod(this, &GestureEventListener::HandleInputTimeoutMaxTap,
block->IsDuringFastFling());
mMaxTapTimeoutTask = task;
mAsyncPanZoomController->PostDelayedTask(

View File

@ -94,7 +94,7 @@ ActiveElementManager::TriggerElementActivation()
// bug properly should make this unnecessary.
MOZ_ASSERT(mSetActiveTask == nullptr);
RefPtr<CancelableRunnable> task = NewCancelableRunnableMethod(
RefPtr<CancelableRunnable> task = NewRunnableMethod(
this, &ActiveElementManager::SetActiveTask, mTarget);
mSetActiveTask = task;
MessageLoop::current()->PostDelayedTask(task.forget(), sActivationDelayMs);

View File

@ -427,8 +427,8 @@ CompositorVsyncScheduler::PostCompositeTask(TimeStamp aCompositeTimestamp)
MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
if (mCurrentCompositeTask == nullptr) {
RefPtr<CancelableRunnable> task =
NewCancelableRunnableMethod(this, &CompositorVsyncScheduler::Composite,
aCompositeTimestamp);
NewRunnableMethod(this, &CompositorVsyncScheduler::Composite,
aCompositeTimestamp);
mCurrentCompositeTask = task;
ScheduleTask(task.forget(), 0);
}
@ -481,7 +481,7 @@ CompositorVsyncScheduler::SetNeedsComposite()
if (!CompositorBridgeParent::IsInCompositorThread()) {
MonitorAutoLock lock(mSetNeedsCompositeMonitor);
RefPtr<CancelableRunnable> task =
NewCancelableRunnableMethod(this, &CompositorVsyncScheduler::SetNeedsComposite);
NewRunnableMethod(this, &CompositorVsyncScheduler::SetNeedsComposite);
mSetNeedsCompositeTask = task;
ScheduleTask(task.forget(), 0);
return;
@ -1365,7 +1365,7 @@ CompositorBridgeParent::ScheduleRotationOnCompositorThread(const TargetConfig& a
if (mForceCompositionTask != nullptr) {
mForceCompositionTask->Cancel();
}
RefPtr<CancelableRunnable> task = NewCancelableRunnableMethod(this, &CompositorBridgeParent::ForceComposition);
RefPtr<CancelableRunnable> task = NewRunnableMethod(this, &CompositorBridgeParent::ForceComposition);
mForceCompositionTask = task;
ScheduleTask(task.forget(), gfxPrefs::OrientationSyncMillis());
}

View File

@ -128,11 +128,11 @@ SoftwareDisplay::ScheduleNextVsync(mozilla::TimeStamp aVsyncTimestamp)
nextVsync = mozilla::TimeStamp::Now();
}
mCurrentVsyncTask = NewCancelableRunnableMethod(this,
mCurrentVsyncTask = NewRunnableMethod(this,
&SoftwareDisplay::NotifyVsync,
nextVsync);
RefPtr<mozilla::Runnable> addrefedTask = mCurrentVsyncTask;
RefPtr<mozilla::CancelableRunnable> addrefedTask = mCurrentVsyncTask;
mVsyncThread->message_loop()->PostDelayedTask(
addrefedTask.forget(),
delay.ToMilliseconds());

View File

@ -305,19 +305,9 @@ class RunnableMethod : public mozilla::CancelableRunnable,
template <class T, class Method, typename... Args>
inline already_AddRefed<mozilla::CancelableRunnable>
NewCancelableRunnableMethod(T* object, Method method, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::CancelableRunnable> t =
new RunnableMethod<T, Method, ArgsTuple>(object, method,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...));
return t.forget();
}
template <class T, class Method, typename... Args>
inline already_AddRefed<mozilla::Runnable>
NewRunnableMethod(T* object, Method method, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::Runnable> t =
RefPtr<mozilla::CancelableRunnable> t =
new RunnableMethod<T, Method, ArgsTuple>(object, method,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...));
return t.forget();
@ -352,7 +342,7 @@ class RunnableFunction : public mozilla::CancelableRunnable {
template <class Function, typename... Args>
inline already_AddRefed<mozilla::CancelableRunnable>
NewCancelableRunnableFunction(Function function, Args&&... args) {
NewRunnableFunction(Function function, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::CancelableRunnable> t =
new RunnableFunction<Function, ArgsTuple>(function,
@ -360,14 +350,4 @@ NewCancelableRunnableFunction(Function function, Args&&... args) {
return t.forget();
}
template <class Function, typename... Args>
inline already_AddRefed<mozilla::Runnable>
NewRunnableFunction(Function function, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::Runnable> t =
new RunnableFunction<Function, ArgsTuple>(function,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...));
return t.forget();
}
#endif // BASE_TASK_H_

View File

@ -502,11 +502,11 @@ MessageChannel::MessageChannel(MessageListener *aListener)
mIsSyncWaitingOnNonMainThread = false;
#endif
mDequeueOneTask = new RefCountedTask(NewCancelableRunnableMethod(
mDequeueOneTask = new RefCountedTask(NewRunnableMethod(
this,
&MessageChannel::OnMaybeDequeueOne));
mOnChannelConnectedTask = new RefCountedTask(NewCancelableRunnableMethod(
mOnChannelConnectedTask = new RefCountedTask(NewRunnableMethod(
this,
&MessageChannel::DispatchOnChannelConnected));
@ -2091,7 +2091,7 @@ MessageChannel::OnNotifyMaybeChannelError()
if (IsOnCxxStack()) {
mChannelErrorTask =
NewCancelableRunnableMethod(this, &MessageChannel::OnNotifyMaybeChannelError);
NewRunnableMethod(this, &MessageChannel::OnNotifyMaybeChannelError);
RefPtr<Runnable> task = mChannelErrorTask;
// 10 ms delay is completely arbitrary
mWorkerLoop->PostDelayedTask(task.forget(), 10);
@ -2111,7 +2111,7 @@ MessageChannel::PostErrorNotifyTask()
// This must be the last code that runs on this thread!
mChannelErrorTask =
NewCancelableRunnableMethod(this, &MessageChannel::OnNotifyMaybeChannelError);
NewRunnableMethod(this, &MessageChannel::OnNotifyMaybeChannelError);
RefPtr<Runnable> task = mChannelErrorTask;
mWorkerLoop->PostTask(task.forget());
}